Jump to content
Stray Fawn Community
Sign in to follow this  
Weasley Wells

Corp drones and turrets shooting through terrain

Recommended Posts

Description of issue:

I've experienced it a couple of time where the drones and turrets from the corporation have been shooting me through the terrain and after looking at it I think it has to do with hitboxes. If a drone is making contact with the terrain they will fire through it and if a turret has the end of it's barrel in the terrain it will do the same. The turrets seem to be less likely to get the position to shoot through terrain however I have seen it happen multiple times.

Version of the game: 0.7.1

Share this post


Link to post
Share on other sites

Does it happen on any other terrain for you?  I've noticed it happening, always on that green terrain.

Share this post


Link to post
Share on other sites

I will give it a try in creative tomorrow to see if it happens on any other terrain. I really don't see why it would change it but I'm up for testing.

Share this post


Link to post
Share on other sites

After testing I can confirm this is a issue with all different terrains. You probably noticed it on the green terrain as that is the most common place for the turrets and drones.

Share this post


Link to post
Share on other sites

I'm not 100% certain, but most likely it's because the point from where the enemy shoots in inside the collider of the terrain. You can see that with the turrets in the video. If an object is spawned inside a collider, the physics engine does not detect a collision. Therefore the bullets is able to freely travel through terrain. Sometimes this also happens to other objects like scrap parts, which gets accidentally spawned inside the terrain (which then freely floats around).

This is a technical limitation of the physics engine. I assume it does that to improve performance. I'm not sure how much we can do against that. We could try to make sure bullet-spawn-points don't move inside colliders/terrain, but that's tricky with turrets, because they can rotate freely and are already close to terrain.

We have to check if there's a solution which does not cost a lot of performance. Thank you very much for sharing the video. Helps a lot debugging the reason for such bugs!

  • Like 1

Share this post


Link to post
Share on other sites

That makes sense. Would it be possible to move the point where the bullet spawns back into the turrets/drones and attempt that as a solution to the issue?

  • Like 1

Share this post


Link to post
Share on other sites

Yes, that would fix the issue for the enemies. If the bullet spawn point is inside the enemy collider and the enemy can't go into terrain, that would fix the issue. But visually it is less compelling, when the bullet spawns inside the enemy, hmm. We have to check.

Maybe only for turrets we could make a custom check if the point is inside the terrain. It seems the chance of turrets spawning in an angle/position in which they could shoot through terrain is quite high, so a custom check might be worth it.

Share this post


Link to post
Share on other sites

I just realised in the video you can see four turrets that have their base in the ground so having that check would probably help quite a lot with the turrets shooting through the ground.

  • Like 2

Share this post


Link to post
Share on other sites

Yeah, i'd rather have a turret floating on a single pixel of terrain than to shoot through it. So a check to make shure the turrets or their projectile-spawn-points are above ground would seem like a solution

Share this post


Link to post
Share on other sites

We did make some changes related to this. Projectiles now check wether they are being spawned inside the terrain and destroy itself automatically.
The same logic is also applied when spawning drone parts inside the terrain using the factory part.

This should reduce the occurrence of this bug.

  • Like 1

Share this post


Link to post
Share on other sites

Note that this same issue happens with Corp fighters spawning inside terrain or ore deposits.

  • Like 1

Share this post


Link to post
Share on other sites

Does it still happen @astroslug? can you make a GIF of when the situation occurs? Maybe we have to add the logic to the enemies as well.

Share this post


Link to post
Share on other sites

Hi @Markus yes, this was happening with 0.7.4 just a day or two ago.  As far as I'm aware that is the latest version.  I did quickly snap a GIF when I passed a fighter inside an ore deposit.  Will try and track it down when I get a chance (it's on another machine that's busy right now).  In that same session I'd encountered several instances of fighters inside terrain, but didn't screenshot.

  • Like 1

Share this post


Link to post
Share on other sites

Here's a GIF of the corp fighter I encountered that was inside an ore deposit.  Unfortunately I snapped it a bit early, but you can clearly see it sitting in there, and then start coming at me.

Nimbatus_GIF_201908260030529144.gif.3d9868129a0d8d85c8590b838577b88e.gif

  • Like 1

Share this post


Link to post
Share on other sites

Perfect, thank you for the gif :) Was a transmitter there?

But yes, I see that we would have to add a terrain check for the enemies too during planet loading :) Already noted on the list. Thank you again for finding a location and posting the video!

Share this post


Link to post
Share on other sites

I don't recall if there was a transmitter on this planet.  It was a few days ago, and my brain has pushed out information.

Here's another interesting one I came across tonight, where a cannon hit one of those purple clouds right next to it, which then covered the cannon in terrain.  The first shot in this video is the curious one, which collides with the edge of the new terrain.  That's followed by a shot through mostly original terrain that manages to get out.

Nimbatus_GIF_201908290119281897.gif.ce9d581eca7b17736f9c075a23f2b23a.gif

On the same planet I also encountered multiple instances of turrets shooting through terrain, but I won't provide images unless you need them -- sounds like you're already on top of that.

Just a thought, it might be useful if you stored some metadata in your GIFs that you can use for troubleshooting.  Things like the random seed for a planet and other basic stuff.  Or maybe you already do this -- I haven't actually checked! 😊

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...