Test it out here: https://github.com/wraitii/0ad/tree/D13_UM_rewrite_core
This includes the absolutely-needed diffs D981, D53 and D438, as well as 2 others.
This is a mostly complete rewrite of UnitMotion (and associated parts). The goals are:
- vastly increased code clarity and quality
- reducing chances to shoot oneself in the foot when updating unitMotion
- bug fixing
The main change is a philosophy change: UnitMotion now always tries to reach the goal, and never assumes more than that. UnitAI is now in charge of stopping when it wants to (this logic has only be partially applied to UnitAI in this diff to keep things… small-ish).
Gameplay-wise, this does:
- Fix all instances of gliding units (current and hopefully future by structuring the code better)
- Drastically reduce the number of stuck units by improving short-range/long-range pathfinder compatibility (without changes to the pathfinders themselves!)
- Allow unitAI to do things while walking (such as fighting or gathering - unimplemented for now, as this will also need animation engine changes)
- Keep formations and current functionality
- Set us up for pushing by using a manager.
Performance-wise, ought to be similar (the use of the manager reduces the number of messages sent, but this is offset by probably a little slowness passing around more things)