Jump to content
  • Advertisement
Sign in to follow this  

Stuck with some 2d pathfinding

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


A problem that has been on my mind lately is pathfinding in my new game. Its a 2d platformer and uses Chipmunk for physics.

In my other small projects when I implented pathfinding I had something like
bool[SizeX,SizeY] Map;

which decided which tile was empty or not.
So here is my problem;

Barrel falling down(cause of gravity) and overlapps two tiles?

I was thinking something like collision-meshes-alike system, but how would I use that for a pathfinding function?

Share this post

Link to post
Share on other sites
The halfway barrel counts either as an obstacle in both tiles, or an obstacle in one tile and negligible in the other.
You need to check for moving obstacles in addition to the static obstacles stored in the mentioned boolean array.
Really smart pathfinding would predict the future positions of barrels: a barrel that falls out of the way before it can be reached is no obstacle at all, while distant barrels can become obstacles in a far future part of the path being computed.

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!