For Eclipse we needed some type of way to move around in the world. So my solution was a navigation mesh for the player and the enemies for our diablo3 inspired game.
So i started in an grid based dijkstra algorithm in TGA2D and it was a good start because it had a lot of visual feedback,the green is walkable,blue is unwalkable , pink is start and end and red is the path.
After that i made it take triangles instead of a 2d grid
Then i made the triangles know its three neigbors and checked if it was still able to find the path from start to end, after that i started doing the harder part and added funneling using the Simple Stupid Funnel Algorithm and then i have my navmesh system.
After that i made it fit in into our engine and changed the djikstra to an A*.
How we created the navmesh was exporting it from unity as it was the program our level desingers were using and unity allows the navmesh to be exported.
For project 7 i wanted to expand it and not use A* if it was not behind an obstacle so i expanded it to use line intersection to se if the player was in a straight line infront of the enemy if not it will still use the A* method. and to make the path straight when using A*.
I took all walk points and see if i can walk from one of the points to the one after the one its able to walk to it and i remove all the unnecessary path points. An other inportant i added was dynamic line witch blocked of doors so enemies did not walk trough them.
The red triagles are all the triangles it have to pass, the black triangles are non walkeble, white is the start, dark gray is the end and the green is the path
created with
Website Design Software .