• Advertisement
Sign in to follow this  

Stuck with some 2d pathfinding

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

Hi

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;

Scenario:
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
Advertisement
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