Actors with a
PathFollower behavior now respect other
Actors with a collider. Currently it is done very naively, though effective enough for now.
Briefly: I have created a
MapNavigationService that tracks which units are where. It is an abstraction that treats each tile as a spatial semaphore. If a unit has claimed a tile another can't move in until the previous unit moves away.
remember, this not turn-based
This method will work for now but essentially it was a two day hack. Unfortunately there is still a bit of rigidity to the way units move when they are near each other. I want them to bounce off each other and other physical reactions when they try to occupy the same square.
Once I'm happy with the direction of the game I plan on swinging back around to use a more physics based system to produce a similar feel to Legend of Grimrock 2.
Here are the rules so far:
- Only one squad can exist in a tile at a time.
- When the unit starts to enter a free tile it claims that tile.
- If another unit tries to move into that tile it will be denied.
- When the original unit begins to move into a different tile it will claim that one too. While it is moving between tiles it has a lock on it's destination as well as it's starting position. At this time no other unit can move into either tile.
- Once said unit has finally reached the center of the destination tile it releases the claim on the previous tile.