3D Pathfinding

Software: Other

OEGInc, Newbie
Posted: 26 April 2014 09:33 PM   Total Posts: 27

Not necessarily Away3D specific, but I’m trying to gather some input on your thoughts of how this might work.

First off, the specifics.  It’s a game where users can place various objects around the map at random (similar to an old-school RTS, they pick an object and then place it on the map).

So for simple 2D path-finding, I’m used to pre-generating a pathfinding grid based on the predefined map, however in this situation there is no predefined map.  It can change from minute to minute…  So how do I generate the grid to do my pathfinding from?  I was thinking I could create a blank grid then loop thru all of the objects in my scene, grab their mesh bounds and mark those off as non-traversable in my grid?  The problem I see with that is that I have some objects that have overhangs (like a house with a porch) that the NPC should be able to walk under, but still avoid any walls (like the front door)...

Secondly, I was thinking it’d be cool to implement 3D pathfinding to help solve the problem above, as well as let NPC’s be able to “hop over” low objects like a small wall, or fence…  But I’m not really sure what the best way to implement this is…

Any ideas?
—Rob

   

Avatar
theMightyAtom, Sr. Member
Posted: 26 April 2014 09:51 PM   Total Posts: 669   [ # 1 ]

You can use A*, a common pathfinding algorithm. I have previously used a 2D version and adapted it for height.

A quick google gives you, for example this…
http://not-so-stupid.com/3d-pathfinder/

Good Luck!

   

OEGInc, Newbie
Posted: 26 April 2014 10:48 PM   Total Posts: 27   [ # 2 ]
theMightyAtom - 26 April 2014 09:51 PM

You can use A*, a common pathfinding algorithm. I have previously used a 2D version and adapted it for height.

A quick google gives you, for example this…
http://not-so-stupid.com/3d-pathfinder/

Good Luck!

Thanks for the reply.  In my example above, I was specifically referring to A* pathfinding, but I’m not sure how to create the map and after some research I’m not sure A* is the best choice in the first place.  Looks like Flow-Field pathfinding might be a better option since I plan to have lots of units, several goals, and lots of dynamic obstacles.

That being said, I’m not sure I follow your quick google example, I already know pathfinding over 3D terrain can be done, what I’m talking about would be more like pathfinding thru a tunnel and how would you calculate that?

Thanks again!
—Rob

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X