ammo-turret turn_range Improvements

AJ3D
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Aug 13, 2016 12:19 pm
Contact:

ammo-turret turn_range Improvements

Post by AJ3D »

Hello,

I've been experimenting with setting the turn_range under attack_parameters on ammo-turrets.

It works perfectly if turn_range is set at .25 or lower. The turret will only engage and fire at target enemies that fall within the green.

However, if the turn_range is larger than .25, the turret can rotate itself if the target would fall within the green area from various orientations.

Here is a quick test with a gun turret with turn_range set to .5. There is a potential target circled in red.
Image

I plop the turret facing north. As soon as it engages the target, it rotates itself to the west, and remains at that orientation after the target is destroyed.
Image

Perhaps there is another setting I'm over looking? It would be great if I could get turn_range to work the same way on ammo-turrets as it does on fluid-turrets.

Thanks!
Rseding91
Factorio Staff
Factorio Staff
Posts: 14913
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: ammo-turret turn_range Improvements

Post by Rseding91 »

turn_range was never meant to be used on a turret that's meant to have 360 degree orientation and as such has weird quirks like you see.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5341
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: ammo-turret turn_range Improvements

Post by Klonan »

Rseding91 wrote:turn_range was never meant to be used on a turret that's meant to have 360 degree orientation and as such has weird quirks like you see.
Maybe a 'can_change_orientation' prototype flag would be enough to resolve this, such that is the flag is false, the turret will always return to its original direction
Rseding91
Factorio Staff
Factorio Staff
Posts: 14913
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: ammo-turret turn_range Improvements

Post by Rseding91 »

Klonan wrote:
Rseding91 wrote:turn_range was never meant to be used on a turret that's meant to have 360 degree orientation and as such has weird quirks like you see.
Maybe a 'can_change_orientation' prototype flag would be enough to resolve this, such that is the flag is false, the turret will always return to its original direction
That wouldn't work. The fluid turret stores an extra property to remember the original direction. Ammo turrets do not.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1197
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: ammo-turret turn_range Improvements

Post by Mooncat »

Rseding91 wrote:
Klonan wrote:
Rseding91 wrote:turn_range was never meant to be used on a turret that's meant to have 360 degree orientation and as such has weird quirks like you see.
Maybe a 'can_change_orientation' prototype flag would be enough to resolve this, such that is the flag is false, the turret will always return to its original direction
That wouldn't work. The fluid turret stores an extra property to remember the original direction. Ammo turrets do not.
I hope you can implement such extra property for ammo turrets, maybe even for vanilla Factorio. I remember the first day when I started playing with turrets, I felt weird that some turrets changed their directions, until I figured out that happened after they engaged enemies. You know there are people who love turrets to face outside from their base, just like they are really protecting the base instead of monitoring the base. If ammo turrets can return to their original direction when back to idle, we will be much happier. :D
posila
Factorio Staff
Factorio Staff
Posts: 5440
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: ammo-turret turn_range Improvements

Post by posila »

For 0.15, I added "turret_base_has_direction" to all three turret entity types, but it has to be always true for fluid-turret, because of pipe connections. When true, turn_range will work properly and turret will remember its original direction and will always return to it.
AJ3D
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Aug 13, 2016 12:19 pm
Contact:

Re: ammo-turret turn_range Improvements

Post by AJ3D »

Thank you very much guys!

I really appreciate the devs taking time to look into this.

I've been experimenting with a mod that would replace the 360 degree gun turrets with concrete bunkers with a narrow lane of fire. I've added line of fire to the bullets, so a player would need to carefully design bunker layouts to maximize firing areas while minimizing friendly fire.

This will also be a nice feature to have for modded turrets that shoot rounds with a high area of effect, so players can avoid friendly fire.

I'm super pumped for the other new features in .15, especially the new turret control features. Thanks again guys for listening to player input!
Post Reply

Return to “Implemented mod requests”