Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Pathfinding (https://forums.graalonline.com/forums/showthread.php?t=49870)

Kadar 12-24-2003 04:38 AM

Pathfinding
 
Whats a good way to go about adding pathfinding to graal?

Anyone have any tutorials or anything?

DIABLO2099 12-24-2003 07:27 AM

Search the forum database for pathfinding, there were a number of discussions about it.

osrs 12-24-2003 04:22 PM

I think Giltwist already made a script about it once, just search.

Hevaricubed 12-24-2003 04:58 PM

giltwists script is very laggy though.

tlf288 12-24-2003 07:38 PM

the best way is to read up on a* pathfinding and base your own pathfinding algorithm on it. if you can't think of a good way to do it on your own then reading up on a* will help you tremendously; however, i wouldn't suggest directly implementing a*.

MysticHaste 12-28-2003 03:07 AM

I'm not sure if its worth the effort for graal really.

The easiest way i can see is by making waypoints for npcs to follow along the paths. (For world travel I mean. Just a few points in every level for the NPC to goto as to avoid obsticles.) (Going to adding, going back subtracting)

Have the npc look for next point, goto it, goto the next etc.
To have REAL pathfinding requires too much processer power. But Please do prove me wrong, I'd love to see someone release a real time pathfinding npc, everything I've seen has been terribly stupid (*I think it was rogueshadow that made the ball that just dragged itself left, as soon as it needed to go right it would just sit on the wall)
Or takes a long time to find the path then starts. (Though it worked beautifully when it did start (several minutes later))


But in small areas (like walking to a bakery in a town or a blacksmith) You could always just make pre-scripted walking paths.. (Like The 2k1 Police Officers.. and the fishing guy etc.)

Blue_Dragn 12-28-2003 04:43 AM

Quote:

Originally posted by MysticHaste
I'm not sure if its worth the effort for graal really.
Its not

However i remember that Kaimetsu had a good theory about pathfinding, but all his posts were pruned, if i remember correctly :\

Thought 12-28-2003 05:48 AM

A* pathfinding is very inefficient in GraalScript :o

*pokes Stefan*

adam 12-28-2003 07:26 AM

Quote:

Originally posted by MysticHaste
(*I think it was rogueshadow that made the ball that just dragged itself left, as soon as it needed to go right it would just sit on the wall)
Haha, yeah that was horrible. :)
I hadn't even tried to research it.
Wow you have a great memory, becouse I did that a very long time ago. I have made better one's since then. :)


The best pathfinding from kaimetsu would be extremely laggy if it found it's way to open space. But if you put it in a mace, it would always find it's way right away. It was great. Well, the one I saw anyway.

Python523 12-28-2003 08:17 AM

Quote:

Originally posted by adam


Haha, yeah that was horrible. :)
I hadn't even tried to research it.
Wow you have a great memory, becouse I did that a very long time ago. I have made better one's since then. :)


The best pathfinding from kaimetsu would be extremely laggy if it found it's way to open space. But if you put it in a mace, it would always find it's way right away. It was great. Well, the one I saw anyway.

Kai never posted a pathfinding script I think, plus the one he did and didn't post (at least I think he did) wouldn't be laggy at all, his was more or less a node system

Dach 12-28-2003 08:50 AM

mine took very little time under normal conditions (i.e. not in a maze) otherwise still not very long, unless you have a crap computer like mine is becoming...

D1ce2 12-28-2003 11:45 AM

Do you mean following a specific tile?.. Isn't the command similar to this :
NPC Code:

if(tiles[playerx+1,playery-1) == tile number 1 || tile number 2 || etc)){
//Do this..
}


Or add a variable to it for easier use..
I think this is wrong but.. o-well :(

adam 12-28-2003 04:09 PM

Quote:

Originally posted by Python523


Kai never posted a pathfinding script I think, plus the one he did and didn't post (at least I think he did) wouldn't be laggy at all, his was more or less a node system

I guess he never posted the one i'm talking about.
Believe it or not me and kai used to talk a lot. And exchange scripts. Even work on little things together. :-/

Python523 12-28-2003 08:28 PM

Quote:

Originally posted by adam


I guess he never posted the one i'm talking about.
Believe it or not me and kai used to talk a lot. And exchange scripts. Even work on little things together. :-/

I never said you didn't, why are you being so defensive about such a trivial thing? :-/

ForgottenLegacy 12-28-2003 10:35 PM

1 Attachment(s)
This is the one *I think* Kai made


All times are GMT +2. The time now is 05:54 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.