Page MenuHomeWildfire Games

Unit Motion - Remove m_FinalGoal
Needs ReviewPublic

Authored by wraitii on Wed, May 15, 11:06 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Yet another case of redundant state removal cleaning up code and letting us make things better in the future.

UnitMotion stores a target (see D1887), which isn't equivalent to a pathing goal. Several functions need to be able to compute / update a Goal from said Motion Request. Instead of doing this weirdly, we'll just recompute a goal from the motion request whenever necessary.

This makes the code more flexible since one doesn't have to be careful about whether one uses the move request data or the goal data, and it lets one update the goal more sanely. And it removes state.

This is a slightly extensive change as I merge the "goal computation" logic from MoveToTargetRange and MoveToPointRange together - needs to be reviewed.

Test Plan

Compile. Review UpdateMotionGoal. Test on the pathfinding integration test map.

Diff Detail

Event Timeline

wraitii created this revision.Wed, May 15, 11:06 PM

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

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

(this revision probably includes a few unrelated changes... I'll clean things up later)

Stan added a subscriber: Stan.Thu, May 16, 12:06 PM
Stan added inline comments.
source/simulation2/components/CCmpUnitMotion.cpp
617

Definition could be put out of the class, no ?

1260

ternary ?

1321

spaces between math operators.

wraitii updated this revision to Diff 8081.Sun, May 19, 4:58 PM
wraitii marked 3 inline comments as done.

Updated

Stan added inline comments.Sun, May 19, 5:01 PM
source/simulation2/components/CCmpUnitMotion.cpp
1260

I guess that's a no ^^

wraitii added inline comments.Sun, May 19, 5:08 PM
source/simulation2/components/CCmpUnitMotion.cpp
617

could, but won't be called for anything else than UnitMotion, so better to keep it here.

1260

meh, makes for a longer line.

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

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