Page MenuHomeWildfire Games

Unit Motion - Fix vertex optimisation / re-extend the clearance for unit-unit collision
Needs ReviewPublic

Authored by wraitii on May 19 2019, 5:08 PM.


Group Reviewers
Restricted Owners Package(Owns No Changed Paths)

So I've been searching for a cause to the issue that units sometimes don't take the obvious best path when using the short pathfinder.

It appears to me to be because there is an issue with out handling of the "quadrant" optimisation.
This introduces two changes:

  • Compute the outward quadrants once and for all instead of setting them dynamically, because there is no reason why we should always arrive from the same quadrant as the first time we see a vertex.
  • don't consider quadrants for the start-vertex, because of the edge expansion (which can put us in illegal quadrants)

These result in better paths for probably very slightly worse performance.

Because of this, we can also bump up the clearance reduction hack.

Test Plan

Review code. Compile. Test ingame

Diff Detail

rP 0 A.D. Public Repository
Lint OK
No Unit Test Coverage
Build Status
Buildable 7546
Build 12306: Vulcan BuildJenkins
Build 12305: arc lint + arc unit

Event Timeline

wraitii created this revision.May 19 2019, 5:08 PM

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

Link to build:

Crynux added a subscriber: Crynux.Sun, Jun 2, 8:49 PM

Quoting this here as well:

In D1911#80640, @Crynux wrote:

@Crynux Could you look at D1908? I think it fixes the same issue that you are trying to fix here.

@wraitii Yep - did some quick tests. It seems to be an improvement over the existing implementation. However, in some cases it's still possible for units to not find their way round the outer corner.