Page MenuHomeWildfire Games

Use predicted position for spread calculation
ClosedPublic

Authored by temple on Aug 10 2017, 1:40 AM.

Details

Summary

Accuracy should depend on where we aim the projectile, not on the target's current position.

(In general, I think the "predicted position" calculation should be a technology ("ballistics") rather than a given. I'll make a patch or trac ticket for that in the coming days.)

Test Plan

Ranged units should be more accurate vs units charging at them and less accurate vs units running away.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

temple created this revision.Aug 10 2017, 1:40 AM
fatherbushido added a subscriber: fatherbushido.

(In general, I think the "predicted position" calculation should be a technology ("ballistics") rather than a given. I'll make a patch or trac ticket for that in the coming days.)

I don't agree (mainly because we work with unit target and not with point on the map - even if I have that kind of thing for catapult in my mind).


About the patch. It seems worth to consider and ok.
One could find arguments for both (there are many sources of inaccuracy).
I will let it some days here.

fatherbushido abandoned this revision.Aug 20 2017, 4:37 PM
fatherbushido edited edge metadata.

Well we can argue for both range. So I will prefer keep the current value.
So proposal rejected.

Well, as I am almost never convinced - even more by myself - I revert a bit my 'position'.

safety checks:

  • predictedPosition is of the same type
  • Balance won't really change (left side with more archers do a bit better with the patch on combat demo).
  • Hunting doesn't seem affected with the current stats.

On the other side, I am slightly annoyed that we would tend to less 'spread' for a unit charging on yourself. I am also annoyed that we will strech spread in radial fleeing direction for out of range targets.
But well.

This revision was automatically updated to reflect the committed changes.

I'm glad you changed your mind, thanks. I had written up a post but that's unnecessary now. I'll keep this paragraph, even though you probably know it already:

The logic behind the spread calculation is that it's linear with the distance to the target, which roughly means that it's constant in the angle. That is, our chance of missing the target to the left by 10 degrees is the same at 20m as at 60m. This supports that what should matter for accuracy is the point we're aiming at. If we use the target's current position then when he runs away from us we're more accurate than we should be, because the accuracy is calculated like he's close to us and taking up a big angle of our vision, but when the projectile lands he's actually far away and takes up a small angle. When he runs towards us it's the opposite, with the accuracy based on him being small even though he's big when the projectile lands.