Use of pathfinding algorithms for obstacle ridden environment

Hi,



Is it possible to use a breadth-first search or A* for path finding in a maze-like custom build 3D map where the movement is along X and Z axes. The main issues here being:


  1. how would you move the automated bot/enemy along that path e.g. can addLocal be used??


  2. how would you feed where 3D obstacles are e.g. walls?



    I have seen a thread or two on this algorithm but nothing as such implemented in examples… Are there any examples available to check regarding such pathfinding algorithms and indeed is it possible to do so with problems mentioned above?



    Regards,



    Dev


1) how would you move the automated bot/enemy along that path e.g. can addLocal be used??

Once you have your path complete you can simply feed it to your AI controller or whatever to move the bot. Usually that would be changing the position of the bot every frame to move toward the target, possibly playing some walk animation.

2) how would you feed where 3D obstacles are e.g. walls?

If you are using grid based A* you can convert the 3D data by sending a ray from the top of each grid block to the buttom and checking if the scene graph collision is higher than a certain height, you can then mark that grid block as an obstacle.
1) how would you move the automated bot/enemy along that path e.g. can addLocal be used??

2) how would you feed where 3D obstacles are e.g. walls?

1) i'm using addlocal
2) the other way round. i generate the dungeon into my jme independant format and generate both the navigation graph and scenegraph from it. it's quite tricky to "parse" a navigation graph out of a scenegraph...i wouldn't do it

Hi guys,



Thanks for your reply.



@Momoko_Fan - From what you say feeding 3D obstacles in graph would be really tricky and cannot be implemented in a short time. The concept seems a bit advanced as well.



@HamsterofDeath - So I assume you are using some dungeon or maze generation algorithm, using A* or BFS on the 2D graph, using imagebasedheightmap to generate 3D structure and then move the object along the path decided by the algorithm using A*.



I just wanted to find out if this idea was feasible and although it is, it seems way too complicated for what I am trying to achieve. HamsterofDeath I know you have plenty of experience with games programming(as you are working on your own) how do you determine line of sight for the enemy bot?


What exactly is this "navigation graph"? For A* you only need a pathability grid to compute a path.



My method will probably take 10± lines to implement in jME, I don't think it's complicated at all. Of course if you're already starting with a maze and need to create everything from it like in HamsterofDeath's situation then it would be easier to just do it his way.

10+ lines?? really Momoko_fan? Could you please explain more as I am not from AI background and still fail to see your vision clearly. I have to demonstrate the game in 4 days and if I have a robot that finds the player it would make it really interesting.