Bigger units



I am trying to figure out how bigger units may occupy 6 or 9 tiles instead of one for smaller units.

Has someone managed to do it?
Could you please point me into the right direction? :slight_smile:

(Leslie Young) #2

replied on unity forum to same question;

Assuming you are working off the ideas presented by the examples …

Each Unit could keep a list of nodes, rather than one. When it binds with a node it will also bind with whatever additional nodes (so for example all neighbours of the main node) so that they seem to be occupied, and of course fill its own list so it knows which nodes to clear/unbind from when it moves off these nodes.

The path finder callback could then see these nodes as occupied. It will still be tricky to figure out if there is space for a big Unit to fit through. I am thinking one idea could be to also get the neighbour nodes of each node the path might follow (if the Unit is 2 tile radius for example) and include that in decision of he path callback. It will make this path finding slower though.

Check some of the previous posts. I think there was discussion about wide units before. It might only apply to MapNav 1 though.