Recommended setting for NodeSize

I’m trying to use the smallest node size that I can because otherwise it’s too many nodes for a large map. But I found when I set the node size to the diameter of the character he won’t enter doorways he is otherwise able to enter. My game supports modding, so I don’t know what the diameter of the character is and calculate it programmatically by doubling the radius.

In this screenshot, when I set the node size to .5 the unit was able to enter the building. But that means I would need 4X as many nodes as present.

What formula do you recommend for the node size?

Presuming that there is no choice but to use a small node size, are there options I have to also support a large map?


What node size to use depends entirely on what the size is of the minimal feature you have to represent.
In your case that might be the door opening, so you will need a node size that is definitely a bit smaller than that.

One thing that I note in your settings is that the ‘Diameter’ setting for the Collision testing is set to the same value as the node size. Note that the diameter setting is in ‘nodes’, not world units. So 1.0 corresponds to the diameter being the same as the node size, 2.0 would make it twice as large as the node size, etc.

Generally in case of modding, I think it’s a slippery slope to go down if you start to modify the graph based on the diameter of your modded agents. It’s probably much easier and more predictable for players if you support say characters with a diameter above say X meters (for some value of X), rather than trying to make it work with every possible mod. But then again, it might make sense for your game.

You could also try to use a recast graph. That will be able to support a large map with very high quality, but it might take too long to generate the graph (assuming you do it at load time).

Thanks for the quick answer. My understanding is layered grid graph is represented by a graph of nodes, each of whose length is equal to “Node Size.” In the worst case scenario, the edge between two nodes would be in the middle of the doorway. So in order to support a door with minimum width w, I would need the node length to be less than w/2. Does that sound correct?

If you allow buildings that are not snapped to any kind of grid, yes that sounds correct.