Posts

Robants Path Finding: A quick tour of our C# A* implementation. All movement in Robants lives on a two dimensional grid. There are a few key requirements of our path finding algorithm: Not all entities move by the same rules. For instance some can move diagonally and others can't. Different types of movement can take different amounts of time. For instance, backing up is significantly slower than moving forward. In addition, different kinds of tiles have different speed modifiers. Going up hills is slower than the flat and, while deep water is forbidden, shallow water is slow. Some entities are bigger than one tile and not all are square. We need to keep track of orientation as a 1x2 entity touches different tiles when its orientation changes. We use struct MapPoint as a simple structure to reference a location on the map. In addition, we generate paths for entities which occupy more than one grid square so we need to track the orientation as well. I defined a struct P...