Techniques of dodging/path planning

Started by
14 comments, last by Nice Coder 17 years, 6 months ago
Thanks to everyone for the inputs.
For now, I just searching google for 3d pathfinding
I only got pathengine from the results which is commercial
It doesn't seem to be a corresponding source found in the open source community
Thanks
Jack
Advertisement
Steering behaviours help with small obstacles. I believe there is an OpenSteer library available for you.
if you want path finding then try the A* algorithm.
if you want a demo of it go to www.gametutorials.com and it's in one of their windows examples.

However, if you want a cheap n cheerful path finding then try my own very special brand:


at way point 1. Want to go to way point z.
get yaw required from pt1 to ptz. Choose the waypoint connected to pt1 that is closest to this yaw - call this pt2. Go to this pt2.
Then repeat the above:
get yaw required from pt2 to ptz. Choose the waypoint connected to pt2 that is closest to this yaw (but don't choose pt 1 unless there are no other connections)- call this pt3
Then repeat the above:
get yaw required from pt3 to ptz. Choose the waypoint connected to pt3 that is closest to this yaw (but don't choose pt 2 unless there are no other connections)- call this pt4
repeat until you get to point z.


By the way - this is efficient but not too good when there are dead ends.


cheers

Dear,
Seems good. But I am worrying about the load of the GPU.
Because I have a fair bit of objects to implmement at the same time
Can your approach apply to multi-objects scenrio?
Thanks
Jack
sorry it took a while to get back to you - in my game I have 300 buildings, 180 enemies and the average fps is about 90fps.
Not sure how much gaming experience you have but:

1) frustum cull all of the buidings so you're only drawing the ones nearby
2) if you have a lot of bots then only bother doing the AI for enemies nearby - if they're further than 200m say then don't bother doing the AI for them.




ade-the-heat -> A* is just a little more complex that that, and it works well even with non-convex polygons (so long as you give it the right nodes to choose from).

lucky6969 -> Assuming you mean CPU load, an easy way to do this is with a priority que for the bots pathfinding, with the priority being how close they are to the player.

Those right next to him get their paths done instantly, those further away have to wait longer and longer and those that are very very far away may be starved entirely (until the player walks closer).

Maybe a kd tree or similar to efficiantly determine the bots closest to the player ? (which might come in handy later on as well)
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.

This topic is closed to new replies.

Advertisement