[0.17.34] lead_target_for_projectile_speed always targets player

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

[0.17.34] lead_target_for_projectile_speed always targets player

Post by Deadlock989 »

Hi,

I saw the (not in wiki) lead_target_for_projectile_speed parameter set for worms, which are a kind of enemy turret at their core.

If you set this parameter in your own modded turrets, they start start shooting at you (i.e. they shoot at where they think you'll be when the projectile gets there) rather than leading from the enemy target that activates them. This happens if the turret is set to target_type direction or entity (I haven't tested position).

Expected behaviour: friendly turrets lead from the target they're actually firing at, not at the player who just happens to also be within firing range.

I just got a load of torpedos in my face unexpectedly, it was most disconcerting.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5311
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.17.34] lead_target_for_projectile_speed always targets player

Post by Klonan »

Can you post the mod
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.17.34] lead_target_for_projectile_speed always targets player

Post by Deadlock989 »

Klonan wrote: Tue Apr 30, 2019 5:28 pm Can you post the mod
Sorry, can't, it's bundled with a ton of other stuff. I will try and make a demonstration mini-mod for it when I get time.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.17.34] lead_target_for_projectile_speed always targets player

Post by kovarex »

Moved to pending until we get a way to reproduce.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.17.34] lead_target_for_projectile_speed always targets player

Post by Deadlock989 »

OK, I think this is probably not a bug, just some weird behaviour brought about by not understanding how this parameter works.

I tried to reproduce this using only vanilla entities using the attached minimod and save. I don't get quite the same erratic player-centred behaviour as I do with my modded turrets, but it's close. I think what is happening is that lead_target_for_projectile_speed just doesn't work well with turrets that have a long range. It consistently targets ahead, and if the entity is moving at a tangent, that works out to be way ahead. Also, acceleration on the projectile massively confuses it. In certain cases, when the targeted enemy is far enough away, the lead it calculates just happens to centre on the player - because that's where the enemy is headed anyway ...

Load up the attached, there are biters to the south, aggro them by shooting one briefly and then lead them back up to the modded laser turrets (which shoot explosive cannon shells). Once the turrets have activated, run back and forth east to west. Occasionally you will see the turrets fire at a really odd location.

If you have any documentation that would help with picking sane values for lead_target_for_projectile_speed, it would be great to see it. In the base game, it's always 0.3375, and I have no idea where that comes from - but it is only used on worm and spitter streams, which are all pretty similar to each other.
Post Reply

Return to “Pending”