From the beginning of this project there was a major limitation of the engine's default navigation system for unit movement. So I wrote a simple but effective custom system that was working but units didn't really have collisions and were able to walk through the castle and each other.
Today I decided to revisit this old problem and completely rewrite the navigation system. Units are now using spatial grid movement like in any other RTS game.
Unit Movement
- Units now navigate around buildings rather than walking into them. Structures placed mid-lane are routed around instead of becoming a pile-up.
- Units no longer push each other inside the castle and other buildings.
- Units spawned into tight gaps between closely packed buildings now find their way out instead of remaining wedged.
- Units that genuinely cannot reach what they are attacking now look for something else to do instead of standing still.
- Crowd movement is smoother overall - less shoving and jostling.
- Large units are no longer displaced unrealistically far when smaller units walk into them.
- Ground units no longer tilt up or down when facing a target at a different height.
Combat
- Fixed units being revived by damage that landed on them after they died in rare cases.
Performance
- Reduced per-unit background cost, improving frame times in large battles.
