Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Algorithms and other Pathfinding Techniques

Author
Message
Ruler8163
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Atlanta, GA
Posted: 14th Apr 2005 11:23
Alright, ive been looking around and I havent seen a forum for some goos pathfinding code yet! So...I figured that I'd make one for everyone to post thier knowledge of pathfinding techniques in. Of course, this isnt just for the good of the community. I obviously need some help in this category as well.

If anyone has any knowledge or experience in this subject, No Matter How Small!!!, please post here. Unfortunately, I have decided that i wont start this forum off with an example, no... not because i dont know any, but because i probably dont know the best way and I'm looking for examples from other people as well.

Happy Postings!!!

There are no restrictions to a language...
Ruler8163
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Atlanta, GA
Posted: 15th Apr 2005 13:28
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...
Ruler8163
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Atlanta, GA
Posted: 17th Apr 2005 14:28
Alright, the above code obviously doesn't work so im going to post code that, if you give the proper input according to my last text, will work and return a path from one point to another. Or atleast it should.

There are no restrictions to a language...
Ruler8163
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Atlanta, GA
Posted: 20th Apr 2005 06:27
Is anyone else having trouble opening the source code? I was going to revise what i had written but im too lazy to rewrite that whole thing. Can someone else post it so i can copy and paste?

There are no restrictions to a language...
Ruler8163
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Atlanta, GA
Posted: 20th Apr 2005 09:06
Ok i think this forum is broken or malfunctioning becuase it tells me that there are eleven posts and i only see 3. Is this true for anyone else?

There are no restrictions to a language...
dononeton
19
Years of Service
User Offline
Joined: 12th Jun 2004
Location: Tusaloosa, AL : USA
Posted: 28th Apr 2005 12:41
I see 5
Baggers
19
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 2nd May 2005 22:46
Hmm well i've done a fair bit of work in path finding but that was in DarkbasicPro, however this is the tutorial i learnt it all from, though i have serious doubts it could be made in fpsc....anyway good luck guys
http://www.gamedev.net/reference/articles/article2003.asp

Ruler8163
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Atlanta, GA
Posted: 3rd May 2005 10:04
path finding

what do you mean?

There are no restrictions to a language...
Ruler8163
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Atlanta, GA
Posted: 3rd May 2005 10:11
Oh sorry i think this may be the wrong forum,

Sorry about the confusion.

There are no restrictions to a language...
uman
Retired Moderator
19
Years of Service
User Offline
Joined: 22nd Oct 2004
Location: UK
Posted: 3rd May 2005 20:20
FPSC already has a good pathfinding system - together with a little fpi scripting you can make enemies do almost anything you want. As far as I have tested the system thus far it seems to work as well as any I have seen in an indie engine so why are you looking to complicate Pathfinding any further?

It is unlikely you will better what FPSC already gives you.

Login to post a reply

Server time is: 2024-04-19 17:39:13
Your offset time is: 2024-04-19 17:39:13