• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Physics Pathfinding / Movement

Mool

Member
Hello guys,

currently I develop a new update for my game. The so called "mob update". (implementing physics characters with special abilitys, that fight against each other in a physics based world)
All works fine, but I still feel not satisfied, since the movement / pathfinding isnt good.

At the moment I just check where the next enemy is and move the mob into that direction, if there is a obstacle he try´s to jump. Thats all.
I want a better pathfinding, which works for a physics based world. The performance is VERY important, since this game runs on Phones.


I am looking for ideas how I could solve this.

Thanks :)Box2D.PNG
 

NightFrost

Member
Complex pathfinding like that is the domain of A* algorithm and its peers. To sum it in a single sentence, you throw a description of a terrain to A* with start and goal positions, and it returns the shortest path between them. I don't know what your level of familiarity with coding is, but I would put A* as an intermediate subject at least... You can find many guides to A* out there that work on a grid-like terrain and I think it may be best to familiarize yourself with the concept on those. It however does not need to run on grid-like terrain description, and in platformers it pretty much wouldn't. The vertices (the dots) would generally describe the layout of the platforms, and the edges (the lines) would describe the movement options between them (or lack thereof by their absence).
 
Top