Advertisement

Stuck with some 2d pathfinding

Started by December 05, 2010 09:23 AM
0 comments, last by LorenzoGatti 13 years, 11 months ago
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?
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.

Omae Wa Mou Shindeiru

This topic is closed to new replies.

Advertisement