Converting 2 dimensional array to node structure
Hello,
I am currently teaching myself C++ and would like to investigate pathfinding more. I have built an environment with a 2 dimensional array, with a structure determining whether there is a wall true/false. The walls are then located appropriated by searching through the array.
I have built a simple algorithm which currently follows the walls always trying to turn left where possible, which ultimately finds the exit -> see video.
YouTube - Fire Simulator 1
For further algorithms e.g depth first it seems I need to convert the array into a node structure, where each cell is a node and has possible edges to connecting nodes north/east/south/west. Any suggestions on the best method for creating this?
It would be also be great to have up to 8 connections allowing for diagonal movement, at this stage I am asking for help with creating the node structure allowing me to investigate the searching algorithms later :)
Many thanks :)