Page MenuHomeWildfire Games

UnitMotion - clarify what CheckTargetMovement is doing, improve the logic.
ClosedPublic

Authored by wraitii on Jun 15 2019, 9:45 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22430: UnitMotion - rename CheckTargetMovement to PathingUpdateNeeded for clarity, and…
Summary

CheckTargetMovement was the function in charge of updating the goal if the target has moved / we wouldn't reach it with our current path.

It did a pretty shoddy (and weird) job of it.
This new version compares our final waypoint with the goal and uses reachability checks to know if we will be in range or not.

Test Plan

Compare unit behaviour when chasing a target.

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.Jun 15 2019, 9:45 PM

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

Link to build: https://jenkins.wildfiregames.com/job/differential/1735/display/redirect

wraitii updated this revision to Diff 8696.Tue, Jul 2, 10:39 PM

Correct handling of no-waypoint situation, and use BeginPathing to benefit from direct/short-range movement to unstuck some units.

With this diff whales roaming is fixed. Chasing is improved but still needs D1987 to really connect.

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

Link to build: https://jenkins.wildfiregames.com/job/differential/1879/display/redirect

Some self-review

source/simulation2/components/CCmpUnitMotion.cpp
1135 ↗(On Diff #8696)

There's a more straightforward way to write this

1138 ↗(On Diff #8696)

Move comment below

1160 ↗(On Diff #8696)

Perhaps introduce/expose an "AreShapesInRange" function in the obstruction manager?

wraitii updated this revision to Diff 8705.Wed, Jul 3, 6:29 PM

Use a function in ObstructionManager for range check, improve function.

Vulcan added a comment.Wed, Jul 3, 6:36 PM

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

Link to build: https://jenkins.wildfiregames.com/job/differential/1886/display/redirect

Vulcan added a comment.Wed, Jul 3, 7:53 PM

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

Link to build: https://jenkins.wildfiregames.com/job/differential/1890/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Wed, Jul 3, 8:07 PM
This revision was automatically updated to reflect the committed changes.