Larger node size results in incorrect graph

Hi there,

I have had my node size set to 1, which was resulting in extremely jagged paths (my characters are 10 units wide). So I have attempted to change my node size to 5, however then when scanning the result is completely incorrect.

Changing it back to 1 (and adjusting the width/height) then scans correctly again. Am I doing something wrong?

I am in 2D.

Any help is greatly appreciated!

Here’s a screenshot of the two results:

The left is correct, the right is not. Nothing else has been changed except for the node size and grid width/height.

Huh. You haven’t by any chance modified the Collision Testing -> Diameter setting?

Thanks for the response! I hadn’t. But now you just made me check what the Diameter setting actually is, and it turns out it’s nodes as opposed to world units. So in changing the node size I obviously need to change the diameter size.

Annoyingly I’ve also learned some of my doors are situated evenly on two nodes, so the system thinks an AI couldn’t fit in there. Will have to find a way around that!

Hi

Well, you will not want to reduce it below one at least as it’s then it might miss some obstacles.

This is the collision check that a diameter of 1 corresponds to (sorry about the unevenly spaced lines).

Also. Are you using erosion?
Erosion will erode away a number of nodes, and if you have a larger node size then it will erode more.

Hi Aron, thanks for the response. I’m not using erosion.

So to clarify, are those 6 separate collision checks? If so then that’s how I’d assumed it was happening. Though I hadn’t considered (or known you could) use non-whole numbers.

I have a character with a radius of 5, and if I set the node size to 1 and the diameter to 10 it seems to be pretty accurate. However I believe I should be leaving a slight buffer, right? I’d also like to increase my node size as I assume that would help performance.

With my decimal knowledge, I seem to be getting OK results at node size 3, diameter 3.3, but that’s technically slightly too small for the character? The issue is that door sizes are uniform, but where they fall on the grid is what’s causing issues.

Hi

Yes, those are 6 separate collision checks for 6 separate nodes.
Yeah, usually you will leave a small margin, though it’s usually best to just tweak it until it feels good.
5 nodes per character width is quite a high resolution however. If your world is large you may run into memory or performance limitations.

Yeah I played around an have managed to get the character width to 1.95 nodes and still have all of my doorways usable. I worry about not having a buffer, but I suppose I’ll tackle that issue if it comes up!

1 Like