Leading projectile fire?
Posted: Fri May 03, 2019 1:26 pm
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?
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?