Best physics implementation for a 2.5D isometric platformer

Started by
-1 comments, last by SimLeek 9 years, 1 month ago

Hello!

So, I came here because I hit a bit of a speedbump in development. I've been trying to develop a 2.5D game where the visual part is 2D isometric, but the player can jump from platform to platform and scale stairs in a building. I was able to get the layers to change decently when interacting with a building...

HiPbcgE.gif

(Test Sprite)

...but strapping on a z-dimension to Box-2D made things a bit too glitchy. I'm sure I could do it well given enough time, but I don't want to reinvent a 3D physics engine. Also, that demo there required me to create huge collision maps for every level of the buildings and every object. (I couldn't use Tiled's tile collisions because they were 2D. )

What I was planning on doing instead was creating 3D collision meshes for the tiles, then using blender+python to copy and paste those collision meshes into one large mesh, join the objects and duplicated vertices, and then perform the 'limited dissolve' operation. Then I would export the resulting mesh.

7oaFA.png

(Thanks, http://blender.stackexchange.com/a/7498)

But before I write that script and add Bullet to my game, are there any other implementations of these types of 2.5D collisions I should look into? Am I overcomplicating things or doing anything that would cause the game to run slowly?

I mean, I could use the player's position and just look for any collidable objects within a certain distance from the player, but I feel like it'll still be much faster if I combine the collission meshes and use Bullet.

Also, is there a better way to predetermine which tiles should disappear when the character walks into a building? And is there a good way to detect an enclosed space like a building? I suppose I could use ray tracing on the collision mesh from the camera to the center of every tile that can be walked on, but only removing those tiles from the view would create a very small hole to view the character from, and it would also remove items that can be walked behind. I suppose I could add exceptions for objects that are classified as items or less than two or three blocks high, but then things get complicated, especially if I want to make a rocky, cave-like enviornment where there may be somewhat tall pillars. I also don't want to remove anything from surrounding buildings, like what happens now.

tmpf9b3202_thumb22222.png

(Yay! Ray tracing! http://what-when-how.com/advanced-methods-in-computer-graphics/collision-detection-advanced-methods-in-computer-graphics-part-6/)

This topic is closed to new replies.

Advertisement