So i have been interested trying to create a A* algoritm and looked it up on the internet. I found many tutorials and guides about how the algorithm works and so i started to build one up. The algorithm works kinda… It will for sure find the path but the path isn’t a straight line. I have been working with this for three days now and i will pass this on if somebody could find a solution!
Some info to get you started
This is where the main algoritm is handled.
These is the “node” that are traced to find the path
You can set rows and columns in public variables.
Only traces the end node in begin play
Only traces the start node in begin play
I tried to comment everything there is. RED comment means that i am not sure if that is corrent. There is a function to bubble-sort but i could not get it to work. Maybe that is the reason why the path is so strange? Also the algorithm is acting strange… If you are looking all nodes in the open list there is every single node in there. For some reason it wont go towards the two points only. Easy way is to change the material color.
If you can find what the problem is, please tell me! I will continue to build up this project and add more features. You can use this with your own projects/ stuff also. Now i am just so tired and frustrated for building this almost non stop :).
Oh! And the controllers. Left Mouse will move the starting point. Right mouse add or remove wall and space will move the ending point. There might be huge bugs so don’t try anything fancy :). The number that is shown means F-Value.