Grid map path finder for TGE
by Jari · 02/17/2008 (1:12 am) · 22 comments
Hi, this is my first blog post.
I have been improving the pathfinding I used in one of my projects and extened it to 3D. It's AStar algorithm , basically, that operates on automatically built 3D grid map on terrain and interiors. So no need to place those nodes manually anymore.
Here's some screen shots for you to look:
img204.imageshack.us/my.php?image=screenshot00200001bc2.jpg
img257.imageshack.us/my.php?image=screenshot00200002vc8.jpg
Many houses, on top of eachother, large grid
Pathfinder Menu
I have also recorded some videos about the player walking though the grid when destination is selected by cliking. Maybe I'll post those later.
Videos:
www.youtube.com/watch?v=yx0l5S4dmMU
www.youtube.com/watch?v=NKzOJ6obihk
www.youtube.com/watch?v=M8rJZ2lU_ww
I have been improving the pathfinding I used in one of my projects and extened it to 3D. It's AStar algorithm , basically, that operates on automatically built 3D grid map on terrain and interiors. So no need to place those nodes manually anymore.
Here's some screen shots for you to look:
img204.imageshack.us/my.php?image=screenshot00200001bc2.jpg
img257.imageshack.us/my.php?image=screenshot00200002vc8.jpg
Many houses, on top of eachother, large grid
Pathfinder Menu
I have also recorded some videos about the player walking though the grid when destination is selected by cliking. Maybe I'll post those later.
Videos:
www.youtube.com/watch?v=yx0l5S4dmMU
www.youtube.com/watch?v=NKzOJ6obihk
www.youtube.com/watch?v=M8rJZ2lU_ww
#2
02/17/2008 (3:09 am)
Look excellent, Jari!
#3
02/17/2008 (3:24 am)
Ok got me intressted :)
#4
02/17/2008 (4:47 am)
Look great!
#5
02/17/2008 (5:39 am)
Very cool as there hasn't been a solution for building on interiors yet as far as I know.
#6
02/17/2008 (8:08 am)
That looks really interesting.
#7
02/17/2008 (9:35 am)
Awesome!!! It would be really cool if you could release this as a resource. The interior solution looks great.
#8
02/17/2008 (7:43 pm)
Hey this looks cool. Throw my vote in for wanting to see this as a resource!
#9
02/17/2008 (8:01 pm)
Wow this looks great! Well done!
#10
02/18/2008 (1:41 pm)
Thanks. I was actually thinking of selling this, because there is quite a lot more than the grid but also the pathfinding and PathPlayer.
#11
02/18/2008 (7:21 pm)
Hi Jari - can you post the video? I'd also be interested.
#12
02/19/2008 (8:18 pm)
Hows this different from the other gridbased pathfinding i've been seeing pop up lately?
#13
I assume that all the other pathfinding implementations require you to place the nodes (where the player travels) by hand in the editor. This does that automatically.
Ok here are the videos:
www.youtube.com/watch?v=yx0l5S4dmMU
www.youtube.com/watch?v=NKzOJ6obihk
www.youtube.com/watch?v=M8rJZ2lU_ww
And new screen shot:
Link
02/19/2008 (11:15 pm)
@Ramen-sama: I assume that all the other pathfinding implementations require you to place the nodes (where the player travels) by hand in the editor. This does that automatically.
Ok here are the videos:
www.youtube.com/watch?v=yx0l5S4dmMU
www.youtube.com/watch?v=NKzOJ6obihk
www.youtube.com/watch?v=M8rJZ2lU_ww
And new screen shot:
Link
#14
Nice work, man. I'll buy one. :)
02/20/2008 (10:43 pm)
Wow, that was awesome. Please sell it to us, lol.Nice work, man. I'll buy one. :)
#15
02/21/2008 (3:47 pm)
Agreed, videos look great Jari. I'm sure we could find ways to use it. Placing spawn points and nodes can be a pain, and our environment ends up looking so stale after a while without mixing it up. I'm thinking we could use something like this for vehicles if that would work - minus the stair climbing ;) Might work well with Andy Hawkins' wait/load system (?) - http://garagegames.com/blogs/31800/14254. This plus a good Boids/flocking resource would be great additions to the envirnoment pack imho. Let me know when you need an early purchaser/adopter/tester.
#16
Great work though!
02/26/2008 (6:51 pm)
I'm curious -- are you putting every vertex on the open list, with a connection to every other vertex? Cause.. that's a lot of nodes! :) Great work though!
#17
02/27/2008 (1:22 pm)
Devon, I'm not sure what is the open list, here, but you can define the grid size and also change the node placement radius.
#18
Also, how did you get the node lines to render? I wrote my own fxRenderObject to draw paths, not nodes, but even that became very cumbersome. I had to store every vertex to be rendered as a persistant field, which was a lot of code since I don't think you can store arrays in a persistant field. So I have a whole mess of persistant fields for just 10 nodes... there is also the problem of having to make the renderobject's render box huge so the lines don't vanish when the object is out of sight. I'd love to know what route you took for the green node lines.
Good job with everything. It looks like it is shaping up well.
03/05/2008 (7:29 pm)
I've recently taken Ramen-sama's A* example and converted it into something very similar to what you are doing here. In my case I represent the terrain using a 2000x2000 grid. Early benchmarks show it just barely starts to hiccup with around 50 pathfindings of 100 nodes taking place simultaneously every 500ms on a 2Ghz processor. Have you done any benchmarking to see how well your implementation functions? I have several ideas for speeding the process up later.Also, how did you get the node lines to render? I wrote my own fxRenderObject to draw paths, not nodes, but even that became very cumbersome. I had to store every vertex to be rendered as a persistant field, which was a lot of code since I don't think you can store arrays in a persistant field. So I have a whole mess of persistant fields for just 10 nodes... there is also the problem of having to make the renderobject's render box huge so the lines don't vanish when the object is out of sight. I'd love to know what route you took for the green node lines.
Good job with everything. It looks like it is shaping up well.
#19
I have done speed tests but can't say much else than that it works for my game projects fast enough when I set limit for pathfinding nodes. Because the game it self is real time.
03/05/2008 (9:27 pm)
Jason, I used an array to store the nodes. This is where the AStar operates and from where the points for rendering are fetched.I have done speed tests but can't say much else than that it works for my game projects fast enough when I set limit for pathfinding nodes. Because the game it self is real time.
#20
03/05/2008 (9:45 pm)
So you were able to store an array in a persistant field? Or were you not using the concept of a render object to display the nodes to each connected client? If you know of a resouce displaying something similar I'd be happy to go check it out, I'm probably missing an obvious way of doing it without any hassel.
Torque Owner Steve L