vikingcode wrote:
I hope someone else can help because I don't know much about the Horde3D Game Engine. I am just starting to use Horde3D itself.
Possibly, the game engine has some kind of plugin for AI or path finding.
If not, you will have to code the AI to avoid obstacles etc.
You don't need a grid. The scene graph is the grid.
You would have to traverse the scene nodes and check against their bounding boxes to make sure you will not collide with them on your current path. When you find that you are going to collide, you have to recalculate a pathway around the obstacle using some kind of shortest path algorithm, then continue back on your main path.
It's not easy.
How early and how often you change direction can affect the efficiency and effectiveness of your algorithm.
You could wait until you collide, but it is better to calculate check points so to speak. You could calculate a few way-points to get around an obstacle before you get too close. But you also must consider that the character you are following can change direction any time.
It may be effective to update the 2nd characters path (towards the 1st character) every few cycles (or hundred cycles!), but whenever you find an obstacle that alters your path then focus only on getting around the obstacle by following your calculated way-points. Only start following the 1st character again once you are past the obstacle, or only follow the 1st character again if it changes direction (angle) by more than a certain amount.
Also there may be some other libraries out there that can help with path finding.
Well Thank U so much !
I respect and appreciate the thing that u brought into consideration ! i have worked with some kind of grid but the things that u r letting me know are abit at bigger level then mine as i just started using horde3d
not only horde 3d but also game engines , i never used any game engine before so that may be i should have idea about how to traverse nodes and etc
anyways i m just new to it and may be that task takes abit or more longer time for begginer ... I have to show only character following a path , and i guess that
easiest possible could be letting 1 move in one direction for some time and then taking a turn and then moving other with key board to catch other..
as i said to other friend that i can control both characters with key board but now its kind of making one to move automatically on a defined path so that the other one catches him
after following him May be as i said counting number of steps and letting her move for say 50 steps forward and then moving left and again forward 50 steps and so on
but for that i dun know how to count steps etc
Regards Imran Habib