Advertisement

Techniques of dodging/path planning

Started by September 16, 2006 03:45 AM
14 comments, last by Nice Coder 18 years, 5 months ago
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