Jump to content
  • Advertisement
Sign in to follow this  
pandaa

Clearance-based pathfinding with dynamic obstacles

This topic is 2072 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

Advertisement

Yes.  

 

As an example, the obstacle would need to alter the map tiles when being set or released.  Typically, I would recommend generating an function that processes all the blocks in a given region.  Vector A to Vector B.  When the map loads, that gets processed as the entire map.  Vector(0,0) to Vector(?100,?100).

 

Next, when an obstacle is placed, wreckage, downed bridge, whatever, it marks the tiles it needs to as Blocked.  Then calls the function to recheck the tiles allowable unit size for all the tiles surrounding the ones that were changed.  I.e.  I put an obstacle at (5,5) and (5,6)  I would then run the sizing function for all the tiles from (3,3) to (7, 8)

 

This presumes that each tile holds an integer for unit size allowed.  One that is editable.

 

Maps can be saved with this information already stored, to reduce processing on load time.  And otherwise the performance will be minimally affected by short range size updates.  A* is going to be a huge hog compared with this.

Share this post


Link to post
Share on other sites

Additional Note, I hadn't seen or considered, Clearance Based Path Finding before.  I like it, and will definitely use it.  I do apply similar tactics though, for instance AI for Non-Military units takes into account enemy positions and reduces the value of tile positions the closer to enemies the path is, making it far less likely to use an enemy riddled path.  It is somewhat similar, but this is most useful.  

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!