Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 17,416 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 12 1 2 3 4 5 11 12
Re: ez_path -- for alpha testing! Simple Pathfind [Re: clone45] #44601
04/20/05 05:29
04/20/05 05:29
Joined: Aug 2003
Posts: 7,440
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,440
Red Dwarf
Thanks for seeing what you can do.

regards


p.s.: i know that feeling

Last edited by Michael_Schwarz; 04/20/05 05:29.

"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: ez_path -- for alpha testing! Simple Pathfind [Re: clone45] #44602
04/21/05 03:05
04/21/05 03:05
Joined: Nov 2000
Posts: 1,534
hamburg
Samb Offline
Serious User
Samb  Offline
Serious User

Joined: Nov 2000
Posts: 1,534
hamburg
well I think that are too much nodes:

the engine freezes at the position on the picture

here you can download the level: CLICK HERE

Re: ez_path -- for alpha testing! Simple Pathfind [Re: Samb] #44603
04/21/05 03:48
04/21/05 03:48
Joined: Mar 2002
Posts: 580
San Francisco
clone45 Offline OP
User
clone45  Offline OP
User

Joined: Mar 2002
Posts: 580
San Francisco

Hi Samb!

Ouch!!! Well, thanks for running that test! I'll download the level and test it over the weekend. I owe you one!!

- Bret

Re: ez_path -- for alpha testing! Simple Pathfind [Re: mk_1] #44604
04/21/05 05:12
04/21/05 05:12
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline
Expert
Locoweed  Offline
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Good job Bret,

I wish I had more time to play around with it. I did find one minor problem. If the moving entity can't see the first node the program crashes. This could be a problem if someone has wondering monsters that might somehow not be able to see the first node in some circumstance or a moveable object blocks the entity's view to the first node. The program really should just not move the entity and return a 0 or something for move not being possible in that case instead of the program crashing. I suppose this could be tested for in C-Script, but it would be better if the dll handled it I think, or maybe not, but your sample program should show how not to have this happen, because it will eventually happen somewhere when people use the dll.

I do like how simple you made it to use. Very nice.

Loco


Professional A8.30
Spoils of War - East Coast Games
Re: ez_path -- for alpha testing! Simple Pathfind [Re: Locoweed] #44605
04/21/05 07:14
04/21/05 07:14
Joined: Mar 2002
Posts: 580
San Francisco
clone45 Offline OP
User
clone45  Offline OP
User

Joined: Mar 2002
Posts: 580
San Francisco
Locoweed - Ah yes! You're correct! I fixed the issue and it'll be included in the next update.

Samb - You tripped upon a pretty crafty issue. It will definitely take me a few days to solve your issue. Here's what I think is happening. Each node can have a maxium of 4 neighbors. During the initialization stage, the nodes try to link to their neighbors. In fact, they try to link to ALL of their neighbors. The problem is that nodes don't necessarily know who their neighbors are. They just accept the first ones they can find, which may not be necessarily the closest ones. Once all 4 neighbor slots are full, the rest are ignored.

I need to improve the initialization routine so that it prefers closer neighbors over ones that are farther away. That change will have to wait for the weekend.

Thanks for the bug reports!! I'll get 'em all cleaned up as soon as possible!
- Bret

Re: ez_path -- for alpha testing! Simple Pathfind [Re: clone45] #44606
04/21/05 13:06
04/21/05 13:06
Joined: Nov 2000
Posts: 1,534
hamburg
Samb Offline
Serious User
Samb  Offline
Serious User

Joined: Nov 2000
Posts: 1,534
hamburg
well I hope you can fix it
then I make a little pacman clon
but very good work
the easiest pathfinding I'd ever seen here

Re: ez_path -- for alpha testing! Simple Pathfind [Re: Samb] #44607
04/21/05 17:21
04/21/05 17:21
Joined: Mar 2002
Posts: 580
San Francisco
clone45 Offline OP
User
clone45  Offline OP
User

Joined: Mar 2002
Posts: 580
San Francisco

Samb,

This problem turns out to be VERY difficult to solve. I woke up numerous times last night thinking about a solution, and most of them weren't adequate.



The question is, how do you know which neighbors you should connect to? "All of them" isn't always a good idea. Check out this example:



The green lines represent neighbors connected to our source node. The red lines represent a possible path that could be choosen to reach the goal. I might be able to fix this by following closer neighbor nodes first. Yeah... maybe that's the ticket. It would require sorting the neighbor nodes by distance, which might slow down the initialization a bit...

I'll keep thinking on it.

- Bret

Re: ez_path -- for alpha testing! Simple Pathfind [Re: clone45] #44608
04/21/05 18:04
04/21/05 18:04
Joined: Mar 2002
Posts: 580
San Francisco
clone45 Offline OP
User
clone45  Offline OP
User

Joined: Mar 2002
Posts: 580
San Francisco

Ah...

Sorry for thinking out loud, but I wanted to correct a flaw I made. In the last example that I had posted with the red path.... that path would not have been choosen as the final path. The correct path still would have been used.

I won't go into details, but sorting the neighbor nodes by distance still seems like a great solution. I'll code it once I have a chance. I could leave them unsorted, but sorting them during the initialization stage will potentially save time during the actual pathfinding.

Cheers!
- Bret

Re: ez_path -- for alpha testing! Simple Pathfinding. [Re: clone45] #44609
04/24/05 06:50
04/24/05 06:50
Joined: Mar 2002
Posts: 580
San Francisco
clone45 Offline OP
User
clone45  Offline OP
User

Joined: Mar 2002
Posts: 580
San Francisco

Ok!! I think that I ironed out some of those bugs. Download the new version at the same url:
http://www.gamebeep.com/freebies/ez_path_src.zip

There are a few changes, but the most important ones are:

1) The function pf_to_ent() doesn't crash if there's no start node in sight. Instead, it returns "1" if everything is ok and "0" otherwise. It'll return 0 if there's no available start node.

2) After some intense programming, I fixed the "neighbor" problem that was causing some issues. It's ready for round #2 of testing!!


I also added these .dll functions:

DLLFUNC long pf_set_node_collision_distance(var dist)
An entity will reach a node when they get a certain distance to it. This method can set that distance, which defaults to 20 quants.

DLLFUNC long pf_set_max_path(var dist)
Defines the maximum path search distance.

DLLFUNC long pf_set_ent_collision_distance(var dist)
Defines the distance that an entity has to be within its target to trigger the my._PF_REACHED_TARGET flag. Defaults to 10 quants.

I'll write more about these functions later once I update the documentation.

Have fun!!
- Bret

Re: ez_path -- for alpha testing! Simple Pathfinding. [Re: clone45] #44610
04/24/05 07:46
04/24/05 07:46
Joined: Mar 2002
Posts: 580
San Francisco
clone45 Offline OP
User
clone45  Offline OP
User

Joined: Mar 2002
Posts: 580
San Francisco

Oh, one other thing. Samb, your pacman level should work with the new .dll. It works for me now!!

Page 3 of 12 1 2 3 4 5 11 12

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1