Cannon shell range_modifier causes issues with automatic cannons

Bugs that are actually features.
sh4dow
Burner Inserter
Burner Inserter
Posts: 13
Joined: Sun May 26, 2019 8:50 pm
Contact:

Cannon shell range_modifier causes issues with automatic cannons

Post by sh4dow »

The range_modifier of cannon shells only extends the range of the gun that's shooting them; for ammo with directional targeting this means that range_modifier value doesn't have any (significant?) effect in vanilla games.

However, when using automatically firing cannons, the range_modifier of 125% causes surprising issues: The shell still dies after it's normal range (eg. 30), but it tries to shoot at targets that are up to 25% further away, wasting ammo.

Since the range_modifier doesn't affect vanilla, the easiest solution might be removing it from non-explosive cannon shells. Changing range_modifier to also apply to the range of the projectile might or might not be more intuitive, but it would change the effective range of vanilla tank shells. Another approach would be to limit automatic firing to the actual projectile range of the ammo, though that might cause issues with more complex ammo types (eg. air burst canister ammo that separates into flechettes after 30 units, which fly on for another 30 units)...

Reproduction:
1. Install Lex's Aircraft, and place down the one with the cannon
2. Fuel it and fly it to be just of of range of some enemy entity (placing down unpowered enemy turrets in the editor suffices)
3. Load it up with basic cannon shells, and slowly move it closer to the enemy entity - it will start firing well before it's actually in range (to make the effect more noticeable, use a legendary aircraft - 25% of a larger range translates to a bigger difference between engagement range and projectile range)
4. Repeat 3. with explosive shells - now everything works as expected, and it only starts shooting when it can actually hit the target

Since both types of ammo and the cannon all have the same range (in the mod, it's changed to 50), one would intuitively assume these ranges would be compatible with each other, yet the non-explosive ammo with the 125% range_modifier will start shooting when it can't hit it's target.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15881
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Cannon shell range_modifier causes issues with automatic cannons

Post by Rseding91 »

Thanks for the report however this all seems to be working correctly. As a mod, any mod is free to simply adjust any values they want. If they don't want the cannon to have a 25% range they can simply change it.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Not a bug”