Page 1 of 1

[2.0.18] Turret rotates past its firing arc limit.

Posted: Thu Nov 14, 2024 7:49 pm
by wodzu93
Turret that has limited firing arc, no turret base direction (turret_base_has_direction = false) and matches any of these situations:
  • turn_range >= 1/4 AND placeable in four directions (N, E, S, W)
  • turn_range >= 1/8 AND placeable in eight directions (N, NE, E, SE, S, SW, W, NW) ("building-direction-8-way" flag)
  • turn_range >= 1/16 AND placeable in sixteen directions (has "building-direction-16-way" flag)
will shift its facing direction, and therefore firing arc, when tracking a target sufficently close to the left/right edge of it's arc, and STAYS facing that direction after target leaves or dies.

Here's the demonstration, with an ammo turret prototype with:
  • "building-direction-8-way"
  • turn_range = 1/3 (exceeds 1/8 for 8-way directional placing)
  • turret_base_has_direction = false
Turret is placed facing NW, and after leading a biter group past it, rotates towards NE and stays facing that direction, way past it's supposed firing angle. This would ruin any defense line after any attack, since it no longer faces the desired direction.
Anim2D.gif
Anim2D.gif (23 MiB) Viewed 788 times


Note, changing "turret_base_has_direction" to "true" fixes this behaviour, but has a side effect of rotating the collision box of the turret base, which is not desired for my use case.

Re: [2.0.18] Turret rotates past its firing arc limit.

Posted: Thu Nov 14, 2024 8:00 pm
by Klonan
wodzu93 wrote: Thu Nov 14, 2024 7:49 pm Note, changing "turret_base_has_direction" to "true" fixes this behaviour, but has a side effect of rotating the collision box of the turret base, which is not desired for my use case.
Well, unfortunately that flag is exactly what control this behavior, so this is more of a feature request than a bug report, or at least, a currently unsupported case

I will move this to modding interface requests

Allow "turret_base_has_direction = false" to not turn if it has a "turn_range" value

Posted: Thu Sep 04, 2025 11:38 am
by Fishbus
Heya,

I have this annoying bug where a turret that has turret_base_has_direction = false and some turn_range limit the turret will turn its base to face the direction if an enemy exits its cone of view and then become locked into that new angle. These turrets also have the 8-way-direction flag.

If I make the turret_base_has_direction = true, the turret will stop rotating its base, sure, but the turret now has a diagonal grid when you place it on a 45 degree angle.

Since the base is a rotationally symmetrical circle/square, I'd expect rotating the base to not change the collision to diagonal (e.g. if the collision is 3x3, it should always be 3x3 even on the diagonal.

Is there a way to make this work? Or is this just a sneaky bug that has flown under the radar for a long time?

Either 1) don't have the turret rotate out of its turn-range (what is the case it would ever want this to be intended?), or 2) Allow for a way to disable using a diagonal grid when rotating 45 degrees (e.g. non_diagonal_base = true ).

Cheers!

Re: Allow "turret_base_has_direction = false" to not turn if it has a "turn_range" value

Posted: Fri Sep 05, 2025 1:27 pm
by Fishbus
I've included a zipped .mkv video of in game footage of this issue happening.

(This is when turret_base_has_direction = false)

Cheers

Re: [2.0.18] Turret rotates past its firing arc limit.

Posted: Sat Sep 13, 2025 8:37 pm
by Bilka
Ref: 130816