I’m making a turn based game using a GridGraph and would like the units to be able to walk around each other, they shouldn’t be able to pass through one another. Each node corresponds to a map tile and each character is one tile big.
I’ve got it working at the moment but I don’t like it as it is fiddly. Each character sets the node they are on to be unwalkable (using a custom GridGraphObject). This means units will path find around each other but also means I have to set the selected character’s node to walkable before doing any pathfinding otherwise it doesn’t work. I can’t say I’ve noticed a performance hit because only one character moves at a time but the code is easily broken if the graph update events don’t fire properly when I change code.
From what I can tell, here are my two options:
-
I’m using the free version but I’ve seen that the pro version has local avoidance. Would this fit my bill? If this could dynamically make nodes appear unwalkable because a character is on it then that is what I’m after. I would also like to have characters of different sizes (e.g. 2x2 or 3x3) which I’m not sure is possible with this framework. Would this be able to handle that too?
-
There is a post (Ignore self during Pathfinding) that mentions using tags for the players but I am intending to have a massive map with probably hundreds or even thousands of characters.
I appreciate your input,
Farran