Page MenuHomeWildfire Games

Unit Motion - make sure units don't get stuck in the special long-path computation step.
ClosedPublic

Authored by wraitii on Aug 31 2019, 6:56 PM.

Details

Summary

The issues reported at #5569 seem to stem from situations in which units end up stuck having failed 3 paths, and never actually 'failing' when computing further long paths. So they end up stuck permanently in this 'I need to compute a long path now' state.

The reason for that is from the POV of 'PathResult', the long paths computed are legitimate: they get the unit in-range.
However the unit cannot move at all since it's immediately obstructed by other units nearby. So it never ends up incrementing the failed paths counter, nor resetting it.
This isn't really solvable while we keep the multiple pathfinder systems, so to avoid this I'll just increment the counter when computing a long path in this special state, which means that units can never be stuck in it.

I guess that happened more often in MP games because turn lengths are longer, thus more opportunity to be stuck.

Test Plan

Play MP games and check for idles in GATHERING state for example.

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

wraitii created this revision.Aug 31 2019, 6:56 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/17/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/526/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Sep 1 2019, 9:31 AM
This revision was automatically updated to reflect the committed changes.

There is actually a better fix, see D3203 which reverts this -> if m_FailedPathComputations is increased when the unit fails to move instead of fails to path, this problem is solved. The fact is units very rarely actually _completely_ fail to path.