ZeroK-RTS / Zero-K

Open source RTS game running on the Spring/Recoil engine
https://zero-k.info
GNU General Public License v2.0
673 stars 204 forks source link

Rocko suffers from bad engine projectile leading #1881

Open dvr333 opened 7 years ago

dvr333 commented 7 years ago

I was playing a game on Intersection, and while I built Rockos to deal with snoke's Warriors, the Rockos kept over-leading their shots slightly and barely missing. I'm not sure if this is a speed issue, a unitAI issue, a collision volume issue, or an issue with Warriors using the pathfinder instead of ignoring it for raw move (Anarchid's suspicion).

Game: http://zero-k.info/Battles/Detail/444850 Rocko-Warrior engagements start around 11 minutes in.

Anarchid commented 7 years ago

On closer inspection i no longer suspect raw move:

There are a lot of incredibly narrow misses against seemingly straight moving Warriors but again on closer inspection they seem to be imperfectly straight world lines. They stutter, make pauses, and make small heading changes. That these small heading changes are sufficient to dodge may be an issue.

But i'm not sure i want to see map-spanning lines of rockos again.

sprunk commented 7 years ago

Is this still a problem after Hoko projectile speed buff f315e830ab2d2fcff3cebc856350bf12e4502d9c ?

sprunk commented 7 years ago

Engine. Engine leading is wrong: https://github.com/spring/spring/blob/d5771b9cfdf35491853f6130106535585bf5b6bb/rts/Sim/Weapons/Weapon.cpp#L1244

A shoots B with a projectile, 10 speed B walks towards C at 5 speed Projectile ETA from A to B = 17 time 17 time * 5 speed = 85 distance (point D) Projectile ETA from A to D = 11 time Projectile arrives at D 6 time units before the target. Overshoot.

GoogleFrog commented 7 years ago

So raw move made units move in lines that are straight enough to reveal aiming issues?

sprunk commented 7 years ago

I think it might rather be lines not straight enough over time. Rocko seems to be able to lead just at the edge of the hitbox so any tiny changes in heading can cause a miss. Raw move can apply such tiny changes when spamming orders but regular move just keeps going along the 8 cardinal directions.

sprunk commented 7 years ago

https://springrts.com/mantis/view.php?id=5680

sprunk commented 3 years ago

Apparently Bandit can fail to hit Glaive, unsure if the same root cause: https://zero-k.info/Battles/Detail/1192709

https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaRules/Gadgets/weapon_projectile_retarget.lua now exists and reproduces the engine behaviour. Maybe it could implement a proper solution and then any problematic units (rocko etc) could be handled there.

GoogleFrog commented 3 years ago

Just so we don't lose it.

Niarteloc — Yesterday at 14:38 100% accurate single sqrt flight time for projectile leading equation: t = (-2*dot(v_unit, dist_to_unit) + sqrt(4*dot(v_unit, dist_to_unit)^2 + 4*(v_projectile^2 - v_unit^2)*dist_to_unit))/(2*(v_projectile^2 - v_unit^2)

sprunk commented 8 months ago

Engine ticket beyond-all-reason/spring#746