Jump to content
Stray Fawn Community

Corp drones and turrets shooting through terrain


Weasley Wells

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

Link to comment
Share on other sites

  • Weasley Wells changed the title to Corp drones and turrets shooting through terrain

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
Link to comment
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.

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
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
Link to comment
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
Link to comment
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!

Link to comment
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
Link to comment
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
×
×
  • Create New...