Clearing up some Q's about GridNodes in the GridGraph

Just to clear up some confusion I’m having:

  1. GridGraphs store all the nodes in a variable called “nodes” declared like this:

    public GridNode[] nodes;

  2. The size of this array is always width*length. Even if the original scan finds unwalkable nodes, the nodes are still in that array

  3. The order of the array is correct and sequential. Index 0 or nodes[0] is the bottom left node in the grid, nodes[width] is the bottom right, nodes[(height-1) * width] is the top left, and node[width * height - 1] is always the top-right node at the grid (assuming you make a normal, default setup grid).

Is all that correct?

1 Like
  1. Correct.
  2. Correct.
  3. Correct.

Great! Should save me a lot of time then, thanks :smile: