I am trying to create a graph of nodes for my AI to walk around. The AI itself is fine but creating the node system is causing me trouble. Myabe Im going about it the wrong way.
Im trying to create a system where I can place the nodes in places, like corners etc and then each node knows the location of its neighbours so I have a class which is just an array of neighbours. But I dont want to go to each node, specify its size as well as drag and drop all its neighbours in. Too time consuming and I probably will make a mistake.
I drew a diagram as an example. The left is my nodes and the right is what id like, maybe shown with gizmos
My nodes are all in a grid shape if that makes implementation easier i.e. same X and Z values for rows and columns. Is there some sort of algorithm to give each node its correct list of neighbours?
So far I have a master node class that has the list of nodes in an array and a list of the unique X and Z values but Im not sure what to do with all the info I have or what I would need to make this work.
Anyone have experience in this? Thanks.