OpenSAGE is a free, open source re-implementation of SAGE, the 3D real time strategy (RTS) engine used in Command & Conquer: Generals and other RTS titles from EA Pacific. Written in C#. Not affiliated with EA.
We need to construct a navmesh from the passability data stored in the map file, create paths for bridges and carve out areas where there are buildings and other map objects. The navmesh should be efficient to update with newly constructed and destroyed buildings. We then need to implement a pathfinding algorithm (probably A*) to query the navmesh.
I did a highly scientific experiment which suggests that units are not included in the nav mesh:
The tanks are in an another team than the officer in the middle, so they don't move to let him through. When I order the officer to move out of the square of tanks, he'll start moving but gives up when he reaches the point nearest to his goal.
If I try to move to a completely unreachable place (like this conveniently placed group of barracks) instead, the cursor turns to 🚫 when I hover over it, and the unit moves to the closest point it can.
(The cursor is different because my screenshot key combination includes CTRL)
Unit movement "plans" can be seen by holding down ALT. The same key is also used to give multiple move orders in a row. Using that + good old spam clicking resulted in the following image:
All unit positions are aligned to a grid, perhaps with a resolution of 1 game unit. This might or might not tell something about the navmesh.
Likely depends on #104.
We need to construct a navmesh from the passability data stored in the map file, create paths for bridges and carve out areas where there are buildings and other map objects. The navmesh should be efficient to update with newly constructed and destroyed buildings. We then need to implement a pathfinding algorithm (probably A*) to query the navmesh.
I did a highly scientific experiment which suggests that units are not included in the nav mesh:
The tanks are in an another team than the officer in the middle, so they don't move to let him through. When I order the officer to move out of the square of tanks, he'll start moving but gives up when he reaches the point nearest to his goal.
If I try to move to a completely unreachable place (like this conveniently placed group of barracks) instead, the cursor turns to 🚫 when I hover over it, and the unit moves to the closest point it can.
(The cursor is different because my screenshot key combination includes CTRL)
Unit movement "plans" can be seen by holding down ALT. The same key is also used to give multiple move orders in a row. Using that + good old spam clicking resulted in the following image:
All unit positions are aligned to a grid, perhaps with a resolution of 1 game unit. This might or might not tell something about the navmesh.