Pathfinding script (Christmas gift)

Posted By: EpsiloN

Pathfinding script (Christmas gift) - 12/17/07 18:45

A-Star Pathfinding script , working in 3D.
http://www.coniserver.net/coni_users/web_users/pirvu/au/scripts/pathfinding.zip

PS.: Before you try anything and post that the code isnt working , read the readme files! I hate winter
Posted By: Straight_Heart

Re: Pathfinding script (Christmas gift) - 12/17/07 19:18

thanks for thr contribution.....

I've read your readme file and dont understand why you want the user to manually type in every adjacent node for each node, just so you can have those few choice nodes to see each other as your stair example. So to make it easy for those few node connections such as jumping, you choose to make the whole network to be created manualy?!

This sounds incredibly time consuming, and a pain to readjust node positions later if you make a level change.

What you should do is start out the level with c_traces like george's AUM example, but include a manual node to node connection where the user can manually type in which nodes he wants to see each other or be part of the same path.
Posted By: EpsiloN

Re: Pathfinding script (Christmas gift) - 12/17/07 19:36

Everyone can do that , because I've separated the nodes action from the rest of the script. You can add c_scan or trace and write the results automaticaly in the file.
"pain to readjust node positions"...I made an editor for this task. You walk real-time in the level , with a movement script and a crosshair. If you point at a node and click LMB you can change every adjacent (even a few more properties , like jumping or camping pos) but I'll keep the editor for myself. It is quite unstable , and gives errors if not used exactly how it was intended and everyone will only start to complain about it.
I dont think its painful or annoying to make the connections , because it took me no more than 5 minutes to write them all down on paper (for 30 nodes scattered on 3 floors).

PS.: Its a contribution , if you dont want it just ask the right persons to remove it from AU...
EDIT : BTW , adding 'ignore node' in the pathfinding and tactical information to the nodes , or in your example automatically writing the node connections to .txt files is very easy because it wont interfere with the pathfinding script. The only problem with automatically writing the nodes in a file is that you might not always get the shortest path (or maby not get a path at all!)
Posted By: JimFox

Re: Pathfinding script (Christmas gift) - 12/17/07 21:04

It was very thoughtful to offer this script as a contribution. Thanks for that! I am pretty sure that it will be quite helpful.

Marry Christmas to you.
Posted By: Anonymous

Re: Pathfinding script (Christmas gift) - 12/19/07 16:01

cool can you maybe upload an test level???
Posted By: frazzle

Re: Pathfinding script (Christmas gift) - 12/19/07 18:17

Thanks for the source

Cheers

Frazzle
Posted By: EpsiloN

Re: Pathfinding script (Christmas gift) - 12/19/07 20:39

If I find a way to transfer the test level from the other computer on this one I will email it to you.

PS.: I 'wish you a marry Christmas' (Is that phrase correct? or I remembered it wrong , I'm not that good in English).
Posted By: Wulf

Re: Pathfinding script (Christmas gift) - 12/20/07 07:17

aye the phrase is correct :_).


I'm not far enough into my project yet to start dabbling in path finding, but hopefully i can use this as an example ^^.
Posted By: Blink

Re: Pathfinding script (Christmas gift) - 12/20/07 11:36

In the U.S. it's Merry Christmas. Happy holidays to all! I have been in this community for almost 2 years, everyone here has been great! thanks for the contribution, Epsilon.
Posted By: croman

Re: Pathfinding script (Christmas gift) - 02/16/08 11:51

Hi,

Great contibution, thanks. It's just what we need for our current project. BUT, there is always "but". I don't get it. Now, is it possible to make it write node connections automatically or not? Can you upload a test level?

Thanks,
Alen
Posted By: EpsiloN

Re: Pathfinding script (Christmas gift) - 02/16/08 15:11

Yes , it is possible. And actualy this :
Quote:

but include a manual node to node connection where the user can manually type in which nodes he wants to see each other or be part of the same path.



Is a solution to the problem I described with the automatic writing. I guess I didnt really read it 'in depth' before. Adding a function to ignore predefined connections (from a .txt file) will be easyer and shorter version.

I'm sorry , but I do not have the test level anymore. I was cleaning my HDD and I forgot where the test level was , so I deleted it. I desided to learn some 2D , 3D and PHP skills , otherwise I would have probably contributed a 'stable' editor by now
Posted By: EpsiloN

Re: Pathfinding script (Christmas gift) - 04/02/08 16:05

Yesterday I decided to try a few things again with the pathfinding , I created a new level. Test level \:\)
Here's the link:
PathFinding
It has two bot functions in it. One follows the nodes , the other one is my 'base' for the AI , it still goes to random possitions , but it has more 'control'.
So far there are two 'problems' with this script. One is in the pathfinding , I guess I have a bug... It sometimes skips nodes from the 'look-up' process , so if it doesnt find the shortest path it'll atleast find the second shortest. The second problem is with the first bot I mentioned. Its easy to fix , but I'm not going to do that. When it follows a path sometimes it can get in a loop between two nodes.(Because of the bug I mentioned) The easyest way to avoid that is to check if the next node is the same as the last one , to move ahead directly to the second node on the list. The other way is if you store the whole path for the bot and move it one node at a time. (Currently it calls pathfind at every node it goes.)
F12 activates the debug panel so you can monitor which nodes are the goal node & the current targeted node of the bot. (First two digits on screen , upper left) The other is 'self-explaining' if you look at the debug panel in the .wdl file.

PS.: Simply run the level , its already builded (Otherwise you'll have to re-texture it) And about the link...Its on my home PC , so I dunno if it'll work all the time. If it doesnt , send me a PM or e-mail , I'll restart the server.
Posted By: VeT

Re: Pathfinding script (Christmas gift) - 04/10/09 09:39

PM you as link not works smile
© 2024 lite-C Forums