0 registered members (),
1,397
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Tip of the Week #10: New Pathfinding Solution!
#435118
01/03/14 06:27
01/03/14 06:27
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
OP
Senior Expert
|
OP
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
A new tip of the week has arrived which is basically just a contribution. It's a new pathfinding solution written from scratch - although similar to my last one from the goodies.zip archive it has many advantages such that it does not need to pre-calculate all paths in a level (and store all those nasty text files in your game folder), that those paths can be changed dynamically (for example when a gate opens), that you don't have to attach a path manually to the entity and that it is in general much more flexible. See here, TotW #10 (fixed link): http://opserver.de/swik10/index.php?title=PathfindingThe idea behind this pathfinding script is to use regions (optional but highly recommended!) and WED paths and to divide the level into small logical segments. Those segments can be corridors, houses, hangars and so on. See the following screenshot: The usage is as simple as follows:
action enemy()
{
while(1)
{
VECTOR temp;
hpf_region_get_target(temp,my,player.x,HPF_XYZ);
turn to temp;
move to temp;
wait(1);
}
}
It is just the first version of the script completed minutes ago so please notify me of any bugs that you may find. There is a newer version/ update which you can find below.
Last edited by Superku; 08/08/15 08:29.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Tip of the Week #10: New Pathfinding Solution!
[Re: Superku]
#435312
01/06/14 08:27
01/06/14 08:27
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Thank you very much man! I'll test this, as soon as I'll have a chance! Your "Tip of the Week" series are the most useful I've seen on this forum! Greets
|
|
|
Re: Tip of the Week #10: New Pathfinding Solution!
[Re: Superku]
#435331
01/06/14 12:15
01/06/14 12:15
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
Looks nice. But you should really take node distance into account for better heuristic
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: Tip of the Week #10: New Pathfinding Solution!
[Re: Rackscha]
#435333
01/06/14 12:25
01/06/14 12:25
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Not trying to be an ass, but do it yourself? It's open source code and I'm sure Superku would be glad if other people with knowledge would get behind it as well.
Also, where are all the people who were crying about missing pathfinding solutions? There you have one that's easy to use, shouldn't you rejoice and kiss Superkus feet now or something?
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Tip of the Week #10: New Pathfinding Solution!
[Re: rayp]
#435351
01/06/14 16:39
01/06/14 16:39
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
OP
Senior Expert
|
OP
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
You are welcome! I've thought about using real node distances, I may do that in the future, too, at least optionally, but it does not really add much. It may get more intuitive this way and more accurate by a few quants but the algorithm will rather get slower, not faster this way (because of additional calculations/ sorting, right now it does at most n/2 iterations with a total of 2n node checks).
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Tip of the Week #10: New Pathfinding Solution!
[Re: Superku]
#435383
01/07/14 05:59
01/07/14 05:59
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
THANK YOU Superku!!! I've been telling my friends how awesome you are Wait till they hear about this lol
|
|
|
Re: Tip of the Week #10: New Pathfinding Solution!
[Re: WretchedSid]
#435388
01/07/14 08:46
01/07/14 08:46
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
Not trying to be an ass, but do it yourself? It's open source code and I'm sure Superku would be glad if other people with knowledge would get behind it as well. 1) i wrote my own systems for pathfinding Some years ago i presented a demo of an AI which chases the player through a level. EDIT to 1: Whoops, sorry JustSid, thought you accused me for being a potential parasite. But you meant it the way that i should help if i know how it works. Need more coffe! 2) currently i have no time to contribute to anything 3) I am a Softwaredeveloper, and to avoid later complications, my boss likes to know before i publish something in my sparetime. I know, the german law only restricts to direct concurrent actions, which is mostly not the case. But that job feeds me, so better be on the safe side I wrote a sheetpaper with some points, as i want to discuss which types of projects i can release without asking before. But that'll need some time. PS: @Justsid you have a pending PM from me o.O Greetings Rackscha
Last edited by Rackscha; 01/07/14 08:58.
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: Tip of the Week #10: New Pathfinding Solution!
[Re: Rackscha]
#435412
01/07/14 18:54
01/07/14 18:54
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
3) I am a Softwaredeveloper, and to avoid later complications, my boss likes to know before i publish something in my sparetime. WHAT?! Dude, seriously, find a new job! (Yes, strap on your job helmet and jump into the job cannon etc. blahblah). Your boss has NO say whatsoever over your free time and what you do with it, unless it involves selling company secrets to the competition. If you employer thinks he has a say over what projects you publish and which not, there is something seriously wrong with your relationship with them. PS: @Justsid you have a pending PM from me o.O Yes! I've actually read it I was waiting how long it would take for you to find out that all questions in there are answered in the Rayne thread
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|