Page MenuHomeWildfire Games

Unit Motion - optimisations to avoid recomputing paths too often

Authored by wraitii on Jul 13 2019, 2:29 PM.


Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
rP22474: Unit Motion - optimisations to avoid recomputing paths too often

3 things:

  • Assume a certain incertain based on distance to the target, to avoid recompute paths every turn when the target is far way and moving.
  • Handle cases where the target is unreachable to the long-range pathfinder and we would be recomputing every turn.
  • If we went straight, assume we don't need to recompute a path.

These together mean entities recompute paths far less often.

Test Plan

Order units somewhere impassable: notice paths don't get recomputed every turn.
Order an infantry unit to guard a cavalry and move the cavalry away - notice how the path doesn't get recomputed after a while.

Diff Detail

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

Event Timeline

Build failure - The Moirai have given mortals hearts that can endure.

Link to build:

wraitii updated this revision to Diff 8859.Jul 13 2019, 5:55 PM

Rerun tests

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

Link to build:

This revision was not accepted when it landed; it landed in state Needs Review.Jul 14 2019, 1:08 PM
This revision was automatically updated to reflect the committed changes.