Graal Forums

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

Soul-Blade 08-05-2003 01:59 AM

Quote:

Originally posted by Kaimetsu


Making one NPC per node is not necessarily the best way. My system holds them all in an array.

Using a array could get enourmously annoying, I think a NPC would be the best way personally. I mean, graal handles NPCs with no script rather nicely.

Kaimetsu 08-05-2003 02:49 AM

Quote:

Originally posted by Soul-Blade
Using a array could get enourmously annoying, I think a NPC would be the best way personally. I mean, graal handles NPCs with no script rather nicely.
Okay, let's say you use independent NPCs to represent the nodes. How are you going to pathfind through them? Before you start applying the algorithm, you need to know the positions of every node in the web, and details on how they interlink. How will you represent that?

Angel 08-05-2003 07:07 AM

Do what G2k1 did for railroad tracks lol. and whatever Soul Blade said is false graal wont handle a npc with nothing in it. It will just go bye bye when you come to execute it on a server. You need to define something like a string (setstring this.realnpc,true;) then use say save[] and then the pathfinding npc can easy find each of the nodes in order.

Kaimetsu 08-05-2003 07:13 AM

It will not work, I tell you.

Soul-Blade 08-05-2003 08:44 AM

Quote:

Originally posted by Kaimetsu
It will not work, I tell you.
Well, when I get back from camping next week, I will show what I am working on.

It will work, I can promise you that...you'll see. The way I plan on making it work, it would probably be easy to use an array as well as NPCs.

No time to explain, need to sleep.

adam 08-05-2003 05:21 PM

I'm thinking, positiong the path nodes with npc's and use another npc to store them in an array and gather info on which one's are connected to which.

Dach 08-05-2003 08:46 PM

Um, whether you like it or not, the easiest thing to do would be what Kai is saying

adam 08-05-2003 11:28 PM

Quote:

Originally posted by Dach
Um, whether you like it or not, the easiest thing to do would be what Kai is saying
Depends on if you want lazy people who can't even write a sign script to be able to set the nodes in a level or not?

Projectshifter 08-06-2003 08:42 AM

Quote:

Originally posted by Soul-Blade
Using a array could get enourmously annoying, I think a NPC would be the best way personally. I mean, graal handles NPCs with no script rather nicely.
Arrays are generally the best way to store strings of numbers. It is not practical for HUGE amounts of data that YOU input, but as long as the NPC is handling it, then arrays are generally the best way. You can always do a simple 'for' loop and have it do something such as:
NPC Code:
for (i=0; i<arraylen(var); i++)


Have it check all the coords, for example this.x and this.y as arrays. I still don't understand HOW the nodes are supposed to work, perhaps if it was explained in depth then I could be more helpful.
---Shifter

Kaimetsu 08-06-2003 09:36 AM

1 Attachment(s)
Quote:

Originally posted by Projectshifter
I still don't understand HOW the nodes are supposed to work, perhaps if it was explained in depth then I could be more helpful.
---Shifter

Define nodes.
Define links between the nodes.
Let the NPC figure out the way from A to B, following the desired links.

See diagram.

Projectshifter 08-06-2003 11:19 AM

I understand the rough concept of WHAT a node is I suppose, but more as how opposed to HOW they work. Isn't it they have built-in pre-defined paths to detect the best movement paths? I just don't get how they interact and read from eachother.
---Shifter

Kaimetsu 08-06-2003 11:26 AM

Quote:

Originally posted by Projectshifter
I understand the rough concept of WHAT a node is I suppose, but more as how opposed to HOW they work. Isn't it they have built-in pre-defined paths to detect the best movement paths? I just don't get how they interact and read from eachother.
---Shifter

In the system I describe, a node is just two numbers (x and y coords) with information about the other nodes to which it links. They don't interact with anything, they merely specify waypoints that the NPC can use in going from A to B. There are no predefined paths, the NPC chooses which links to follow.

Projectshifter 08-06-2003 11:28 AM

OH!. So instead of looking for ALL points across the entire level(s), it finds the best NODE system to follow, and THEN calculates the path based on those nodes???
---Shifter

Kaimetsu 08-06-2003 11:37 AM

Quote:

Originally posted by Projectshifter
OH!. So instead of looking for ALL points across the entire level(s), it finds the best NODE system to follow, and THEN calculates the path based on those nodes???
---Shifter

Eh, pretty much. Its path is defined in nodes, not tiles.

Projectshifter 08-06-2003 11:41 AM

So the nodes are just placed in walkable places around levels? All they do is limit the search of the best path then? LOL, I thought the node held strings and arrays!
---Shifter


All times are GMT +2. The time now is 08:42 PM.

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