Hi Aron, I need help!
I’m integrating this project into my 2d side scrolling platformer game based on the rocket5 studio tutorial, I was able to copy the same logic in creating my own customized grid graph, which for the most part is very similar. If you are familiar with the rocket5 tutorial, my pics will make more sense to you. Everything was going fine, but upon further testing, I noticed a issue of which has been beating me on the head for a day, which I haven’t been able to solve. Basically I have no clude why the A* algorithm is coloring two different areas when the map is totally symmetrical in nature. See pics.
Heres a pic of the issue showing the area lines drawn by the A* project after a scan.
Heres a pic of the same issue but now showing my debug rendering of the custom states of the nodes which is the same code as the rocket5 tutorial. Not sure if this will help you out, but helps me figure out if things are setup correct for my custom grid graph nodes.
Heres a bit of my code showing my implementation of the IsValidConnection(). Note I really simplified the code just to debug this issue. Basically it checks for if a node is on top of another node, then make the connection false if it is a bottom-top direction. If it is a top-down direction, then it returns true by default.
public override bool IsValidConnection(GridNode n1, GridNode n2)
{
bool validConnection = true;
Platform2dGridNode node1 = (Platform2dGridNode)n1;
Platform2dGridNode node2 = (Platform2dGridNode)n2;
Vector3 nodePos1 = (Vector3)node1.position;
Vector3 nodePos2 = (Vector3)node2.position;
if (nodePos1.y < nodePos2.y)
validConnection = false;
return validConnection;
}