HomeWildfire Games

Unit Motion - Stop when targets have an invalid position.

Description

Unit Motion - Stop when targets have an invalid position.

Previously, unitMotion had no code that checked particularly if the target was still in the world.
When the target moved out of the world, unitMotion would follow the path to its last known position, then send a "MoveSucceeded" message once there.

Following rP22366, this message was no longer sent. Thus unit would follow their path to its last waypoint and stay there, unable to carry on or finish the order. UnitMotion now explcitly sends a "MoveFailed" message.

This still changes behaviour from A23, requiring further revisions to UnitAI (see D1992 for one such case).

Minohaka tested an earlier version of this change (which incorporated D1992) and accepted it.

Differential Revision: https://code.wildfiregames.com/D1979

Event Timeline

elexis raised a concern with this commit.Jul 1 2019, 2:30 PM
elexis added a subscriber: elexis.

Reproduce:

  1. Select starting units
  2. Set them to gather chicken

Expected result:

  • 2 units gather from the target chicken
  • the other units gather from nearby chicken

Observed result:

  • 2 units gather from the target chicken
  • The other units stop on their way once the target is dead

Before this commit:

  • 2 units gather from the target chicken
  • The othe runits walk to the targe chicken and look at it idle
  • Bisecting shows that 22361 didn't have that bug, but 22372 has it (so it was introduced somewhere in between)
This commit now has outstanding concerns.Jul 1 2019, 2:30 PM

This Is introduced by this revision and is fixed by D1992.

Well to be perfectly exact rP22366 introduced the first breakage, as noted above. This revision changes behaviour slightly: the unit will stop in its track instead of following its waypoints. D1992 still fixes it.

elexis removed an auditor: elexis.Jul 2 2019, 12:31 PM
This commit no longer requires audit.Jul 2 2019, 12:31 PM