Tile occupied by units
Posted: 02 Dec 2013, 10:00
Is there an existing way to tell if a tile (node) is occupied by unit(s) and which unit(s)?
Saw a gridPointTree (quad-tree-like object) though it is optimised for region queries.
I need to query as arbitrary map positions (for moveBlockingTileCallback to tell that we can't see waypoint through friendly units) as the whole map tile by tile (to construct costFactorMap<->blockingMap for A*). Thus i have doubts about querying gridPointTree mapWidth*mapHeight times.
At the moment i added additional info about standing units to the MAPTILE struct. But i don't like the way it's working now (through tracking MOVEINACTIVE/MOVENAVIGATE state changes).
A question related to viewtopic.php?f=30&t=11391
Saw a gridPointTree (quad-tree-like object) though it is optimised for region queries.
I need to query as arbitrary map positions (for moveBlockingTileCallback to tell that we can't see waypoint through friendly units) as the whole map tile by tile (to construct costFactorMap<->blockingMap for A*). Thus i have doubts about querying gridPointTree mapWidth*mapHeight times.
At the moment i added additional info about standing units to the MAPTILE struct. But i don't like the way it's working now (through tracking MOVEINACTIVE/MOVENAVIGATE state changes).
A question related to viewtopic.php?f=30&t=11391