[2.0.66] Turrets with a limited turn_range and a square hitbox will turn themselves to keep firing at entities

Things that has been reported already before.
petrathekat
Inserter
Inserter
Posts: 27
Joined: Fri Apr 19, 2024 7:12 pm
Contact:

[2.0.66] Turrets with a limited turn_range and a square hitbox will turn themselves to keep firing at entities

Post by petrathekat »

Hello,
I encountered this bug when playing with https://mods.factorio.com/mod/snouz_long_electric_gun_turret. When it selects an entity to fire on, if the entity moves to the left or right of its firing cone, the turret rotates itself to keep the target in the firing cone.

This is easiest to test with Strafers, because they move to the sides. (Harder to get biters to move like that, but I managed to reproduce it by pushing them with belts.)

If I patch the collision_box of the focussed gun turret to be the slightly-rectangular {{-0.71, -0.7}, {0.71, 0.7}} (instead of {{-0.7, -0.7}, {0.7, 0.7}}) and set turret_base_has_rotation=true, then it stops rotating itself.

This feels like unintended behavior to me, as the whole point of a turret with a restricted firing cone is that it can't fire outside of that cone. Also, this case never happens in the vanilla game, because the turrets with restricted turn range (railguns and flamethrowers) happen to have non-square hitboxes; this leads me to believe it is an oversight.

I have attached the log. Thank you!
Attachments
factorio-current.log
(11.28 KiB) Downloaded 8 times
Bilka
Factorio Staff
Factorio Staff
Posts: 3636
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [2.0.66] Turrets with a limited turn_range and a square hitbox will turn themselves to keep firing at entities

Post by Bilka »

Duplicate: 121473
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 “Duplicates”