Archived

This topic is now archived and is closed to further replies.

NiteLordz

Pathfinding

Recommended Posts

NiteLordz    808
Does anyone have a web page, or source of a simpel pathfinding demo, say to have models walk around in a bsp level. well, not even worried bout the bsp level part, just walking randomly i guess. just how it is set up and such thanks much Code makes the man

Share this post


Link to post
Share on other sites
bpj1138    113
check out my engine

www.geocities.com/scene3d (click on "demo program" then "files")

i suggest you read this page first though..

www.geocities.com/bpj1138/shortest_path.html

--bart

Share this post


Link to post
Share on other sites
droplet    122
One night I was thinking about it, and it really is very very simple. Although a* may be faster, you should be able to do just about any pathfinding you want by writing an algorithm to do something like this:
a) draw a line (not on the screen, obviously!) from your charachter to target, ignoring all obstacles to getr the shortest route to target.
b) for all the obstacles, move to the closest vacant tile to your target.

Am I missing something? I just cant see how this could fail, and why pathfinding is hyped up as so hard and complicated.

Share this post


Link to post
Share on other sites
Gilzu    122
droplet, you are so, so wrong.

let me show you an example where your system
doesnt work.

0 0 0 0 0 0 0 0
0 X - - 0 - Y 0
0 - - - 0 - - 0
0 - - 0 0 - - 0
0 - - - - - - 0
0 0 0 0 0 0 0 0

X - starting point
Y - Ending point
0 - block tile
- - passable tile

you said that each step where you cant go straight
in the line you drew (X->Y) you go to the next closest
vacant "tile" to the target.

run this in your head. you''ll go right twice,
then cause youre blocked youll go down, cause its the closest,
and then up, cause its the closest? then down, up, down...

also, your solution didnt give the best path, if its not stuck
by an example ive demostrated or any other like that.

pathfinding process should be quick enough so that everytime
that you click on a target, you comp wont stall for more that
number of miliseconds or else the user will get aggrevated.

Gil



Gil Zussman
gil@gilzu.com
http://www.gilzu.com

Share this post


Link to post
Share on other sites