Jump to content
  • Advertisement
Sign in to follow this  
AoS

Pathfinding Preprocessing

This topic is 1970 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I really want to get to work on improving the AI, and the pathfinding/performance of the AI. One thing I was wondering was about pre-processing various aspect of the map.

 

One thing I was really wondering about was whether I should mark the openings of convex map features as closed. Say I have a large area that only opens on one side. When moving from squares on the open side to places on the other sides it would save a lot of work to not have to search that area. I think. I don't really know because its not my area of expertise.

 

Do these sorts of things ever help? Is there some pitfall I'm missing? Maybe it would take too long to load the map if you had to check all these things?

 

If these things do help, are there any I haven't thought of that would be good?

 

Alternatively could I populate a of blocked squares list for each map and then just load that? I.e. I add blocked square list to the map class and then the map save populates it before saving so I can just reload it every time instead of having to process the map during the actual game.

Edited by AltarofScience

Share this post


Link to post
Share on other sites
Advertisement

I am doing a pathfinding preprocessing upon loading a level. It is not strictly speaking A* (although I do have an implementation of A* too, for testing purposes), but I managed to reduce the complexity to 5-10 conditions, which is plenty fast even on a cell phone, let alone PC/XBOX.

 

So, figure out exactly which part is slowest, and how much memory will it cost you.

 

I can say, for my part, that preprocessing as much info as possible on walkable / connectable areas of the level has helped tremendously and now I don't have to be afraid even if 20 enemies decide at one frame to start the pathfinding...

 

I haven't exactly profiled that particular aspect, but the new optimized pathfinding is not recursive at all, just linear (with few early-out conditions) impact of which on the level design is manageable (not ideal, but a reasonable compromise).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!