Following this, which I thought was a bug, but now pretty sure it isn't:
viewtopic.php?f=29&t=70151
Having experimented some more I've discovered that lead_target_for_projectile_speed works the opposite way around to what I thought. In vanilla, worms use it with a value of 0.3375 to fire just ahead of the player. I tried that value for my energy projectile turrets and was getting fire at absurd angles, yards and yards ahead of the target, so I thought, I'll reduce the value. That made things worse.
I now think that actually, it's based on a value of 1.0 for no lead at all. Reducing the value from that gives you an increasing lead.
The value isn't documented - clearly there's some relationship with the speed of the projectile and range here. Does anyone have any insight into how that works? I ended up with a value of 0.5 for my projectiles, and they hit by leading from the target much better now, even at a range of 40-50. Suspiciously, the projectiles have a maximum speed of 1 and accelerate up from 0.1, so the average speed is pretty close to 0.5 ... is that a coincidence or not?
Leading projectile fire?
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Leading projectile fire?
It's not. The value directly relates to projectile speed. Where that's defined depends on the type (projectile or stream) but for projectiles it's straightforward. If your bullets move with a speed of 1.5 then you set the lead to 1.5 as well and the turrets become pretty much unerring.
This assumes constant projectile speed. If they accelerate, rocket or torpedo style, you have more of a problem, but you can reckon it by working out the average likely speed based on range, acceleration rate and maximum speed. You can make that easier for yourself by jigging the maximum speed to occur near the edge of maximum range. This can help.