Pathfinding

Started by
3 comments, last by NiteLordz 22 years, 4 months ago
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
Code makes the man
Advertisement
You haven''t looked at the resource section, have you ?
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
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

--bart
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.
If at first you dont succeed, destroy all evidence that you tried at all.
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
[email=gil@gilzu.com]Gil Zussman[/email]Check out Goose Chase, Coming this fall!http://www.gilzu.com

This topic is closed to new replies.

Advertisement