Any pointers on pathfinding?
by Dan Rubenfield · in Torque X 2D · 07/16/2007 (2:41 am) · 5 replies
I need some simple pathfinding stuff that respects collision. Any logic/pseudocode/pointers or suggestions?
About the author
#2
Following one I set up isnt' too bad, but the map could potentially change, which might cause some difficulty.
07/16/2007 (2:53 am)
Well, Ideally would be best path. Respecting collisions with walls and/or other objects.Following one I set up isnt' too bad, but the map could potentially change, which might cause some difficulty.
#3
swampthingtom.blogspot.com/2007/07/pathfinding-sample-using.html
An A* Pathfinding example. Maybe not the simplest solution, but at the very least you can use it to see what you need to get a solution working.
I've been planning to make something similar in TorqueX but not for the project I'm working on right now so I dont have anything TorqueX specific for you. But i think i understand it pretty well so any questions feel free to ask.
07/16/2007 (4:30 am)
In that case I suggest you take a look at this:swampthingtom.blogspot.com/2007/07/pathfinding-sample-using.html
An A* Pathfinding example. Maybe not the simplest solution, but at the very least you can use it to see what you need to get a solution working.
I've been planning to make something similar in TorqueX but not for the project I'm working on right now so I dont have anything TorqueX specific for you. But i think i understand it pretty well so any questions feel free to ask.
#4
If you want a tip, what helped me finally cross the concept -> implementation bridge was to do everything on paper in pseudocode and see if the equations worked themselves out. And don't do what I did, start with just moving a player to a static point on your "map". I decided to skip that and make my players move to a point which was in essence another player who also was moving so that point in which say a lineman needed to move to was the linebacker who was also moving. I always have to do things the hard way for some odd reason.
I still find bugs in my pathfinding code but I'm slowly working them out.
07/16/2007 (6:39 am)
I use the A* method in my football game I'm working on and after awhile of tweaking it works quite well. It's one thing to understand the concept but the implementation takes the longest. If you want a tip, what helped me finally cross the concept -> implementation bridge was to do everything on paper in pseudocode and see if the equations worked themselves out. And don't do what I did, start with just moving a player to a static point on your "map". I decided to skip that and make my players move to a point which was in essence another player who also was moving so that point in which say a lineman needed to move to was the linebacker who was also moving. I always have to do things the hard way for some odd reason.
I still find bugs in my pathfinding code but I'm slowly working them out.
#5
07/16/2007 (7:43 am)
My suggestion would be to find a complete path around static objects, and calculate 'mini paths' around dynamic objects as needed, that might include simple waiting for the dynamic object to move so they don't take a 50 mile detour because something is in the way at this moment. I remember many old games I've played where guys took those kind of detours. 'nooooooooo' :)
Torque Owner Josh Butterworth
and when you say respects collision, are these static collisions with walls or collisions with other game objects?