I started work on the pathfinding algorithm. I know the stages of the algorithm (how it should look like in the end), bellow is almost pseudocode (it`s real code but I haven`t started building/debugging)
void FindPath(int Startx, int Startz, int Endx, int Endz)
{
Surrounding Sectors[8];
for(int i = 0; i < 8; i++)
{
Sectors[i].distance = -1;
Sectors[i].excluded = false;
}
if(NodeCoord(Startx, Startz +1).access)//N
{
Distancex = NodeCoord(Startx, Startz +1).x - Endx;
Distancez = NodeCoord(Startx, Startz +1).z - Endz;
Sectors[0].distance = sqrtf(Distancex * Distancex + Distancez*Distancez);
}
else
{
Sectors[0].excluded = true …