View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0005680 | Spring engine | General | public | 2017-07-31 16:59 | 2017-07-31 17:17 | ||||||||
Reporter | sprung | ||||||||||||
Assigned To | |||||||||||||
Priority | low | Severity | minor | Reproducibility | have not tried | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | 103.0 +git | ||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0005680: Projectile leading might be wrong | ||||||||||||
Description | https://github.com/spring/spring/blob/develop/rts/Sim/Weapons/Weapon.cpp#L1210 It takes the projectile ETA to *current* target position (L 1212) and then aims at the spot that the target will be after this time (L 1213). That other spot might not have the same ETA. See attached picture. |AC| = 100 |BC| = 200 |AB| = 100*sqrt(3) = 173 Unit A wants to shoot at B with a 10 speed weapon. B is moving towards C at speed 5. ETA to current pos: 173 distance / 10 speed = 17 time. After 17 time, B will be at point D, so unit A shoots at point D. However |AD| = 108 so the weapon will be there after 0000013:0000011 time, which is 6 time before B arrives there. The correct place to shoot would be about 60 distance from B which is 120 distance from A, so that both the projectile and the unit arrive after 12 time. In general the equation only works when the target is moving in a circle around C (so that distance to current pos == distance to leading target pos). | ||||||||||||
Additional Information | This sounds somewhat hard in that there are multiple subproblems to consider: * what if the unit is moving away faster than the projectile? That makes the lead pos not exist. Currently there always exists a lead pos, however inaccurate. * performance. Doing this correctly requires solving quadratic equations, sounds way slower than current. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Checked infolog.txt for Errors | |||||||||||||
Attached Files |
|
![]() |
|
sprung (reporter) 2017-07-31 17:03 |
That ticket link was "after approx. 11 time" and the last sentence of descriptions should read "circling around A". |
Kloot (developer) 2017-07-31 17:17 |
Known. The lead inaccuracy becomes problematic only with projectiles that move slowly relative to units, most of the time it is hidden by unit collision volumes not being points. Major rabbit holes should not be entered right before a release. |