Alright, since no one seems to be replying to my startup post ill sort of start something.
What if you were to create waypoints in a two dimensional array and store eight variables under each waypoint. These variables would be up, upleft, left, downleft, down, downright, right, and upright. Each one would either contain a 0 meaning that there is no waypoint in sight in that direction or the number of the waypoint that is in that direction. Such as this (This being the array, NOT DATA Information) :
1 2 3 4 5 6 7 8 9
0 0 0 3 0 2 6 4 7
0 0 0 0 0 0 0 0 0
0 0 2 5 0 1 0 7 0
0 0 0 0 0 0 0 0 0
0 6 4 8 0 7 9 0 0
0 0 0 0 0 0 0 0 0
6 3 0 0 4 0 8 0 0
0 0 0 0 0 0 0 0 0
I know that this is really hard to understand so i will "try" to draw an example of the map with the numbers as the waypoints and the star* being the start and dollar$ being the end.(Dont anyone dare make fun of it) :
_________ ___
|3_____ 2| |*|
| | | |____| |
|4 5 |6 _____1|
| | $ | |
| |____| |
|8_____ 7|
| |
| |
_____| |
| |
| 9|
|_______|
Alright, basically, the program would start by finding the closest waypoint in the AI's line of sight(No point on any map would be able to be out of sight of any waypoints meaning that every point can see atleast one waypoint)and moves it to that waypoint. Second, it does the exact same with the endpoint. Then the program starts for exaple at the top(up or the first array variable) if it is equal to the endwaypoint number, it automatically goes there, else it searches through each array variable that isnt equal to zero and finds the one closest to the end waypoint. Of course, to speed up the process and preciseness, you may want to start with the variable in the direction of the endpoint seeing as this is probably the right way.
Any way it finds the closest possible waypoint and goes there(not really! Keep in mind this is all just one function of many required. It is just setting the current pathfinding position to that waypoint. To do this you may have functions that enter the same function and also exit themselves as well. Obviously ill have small code example afterwards.) Anyway it would repeat this process, possibly going back onitself(backtracking) and possible finding the fastest route. When it did find the route that it decides to go with, you can save that data in another array, 3D most likely(one to keep the step number,two for the x cor., and three for the z cor.) Thus, this would happen:
_____________________________________________
1 2 3 4 5 6 7 8 9
0 0 0 3 0 (2) 6 4 7
0 0 0 0 0 0 0 0 0
0 0 2 (5) 0 1 0 7 0
0 0 0 0 0 0 0 0 0
0 6 (4) 8 0 7 9 0 0
0 0 0 0 0 0 0 0 0
(6)(3) 0 0 4 0 8 0 0
0 0 0 0 0 0 0 0 0
Hope fully this helps by circling the path that the program would take along the waypoints.
Alright its a little difficult (HAHAHA, ?A little?) but it does work. BUT!!!! there are better and shorter ways!!!! PLEASE POST!!!
DO NOT USE THE CODE, IT WILL NOT WORK, PART PSUEDO CODE
There are no restrictions to a language...