[2.0.18] Turret rotates past its firing arc limit.

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
wodzu93
Inserter
Inserter
Posts: 35
Joined: Thu Apr 20, 2017 3:57 pm
Contact:

[2.0.18] Turret rotates past its firing arc limit.

Post 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 786 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.
IT student that likes modding in his free time.

Shameless self-promotion:
http://steamcommunity.com/sharedfiles/f ... =555765765
http://steamcommunity.com/sharedfiles/f ... =575758597
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5417
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post 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
User avatar
Fishbus
Inserter
Inserter
Posts: 48
Joined: Sat Sep 28, 2024 8:20 pm
Contact:

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

Post 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!
Last edited by Fishbus on Sun Sep 14, 2025 3:01 am, edited 3 times in total.
User avatar
Fishbus
Inserter
Inserter
Posts: 48
Joined: Sat Sep 28, 2024 8:20 pm
Contact:

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

Post 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
Attachments
2025-09-05 14-22-07.zip
game footage + commentary
(35 MiB) Downloaded 16 times
Bilka
Factorio Staff
Factorio Staff
Posts: 3636
Joined: Sat Aug 13, 2016 9:20 am
Contact:

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

Post by Bilka »

Ref: 130816
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Modding interface requests”