• 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!

Game Mechanics Top down movement with different tile heights?

Z

zombieattack

Guest
Can anyone explain a good approach to designing a top down movement system where the player can jump up and down from map tiles of different heights? It doesn't have to be full 3D mechanics (i.e. multiple platforms above each other), just one map surface with varying height.

I can imagine that moving characters would have to constantly check whether they are standing on a surface or falling, gravity would need to be included in the z-direction, and you would have to check if the next tile you are trying to walk on is too high up and therefore you are hitting a wall/cliff, but the overall design is unclear to me and feels awkward.

Thanks
-Zombieattack
 

Yal

šŸ§ *penguin noises*
GMC Elder
The simplest approach would be just storing the map height of every single tile, so anything below the 'surface level' is solid. You'd need to store x, y and z positions of each object and do some 3D collision checking, but all really mild stuff - you can't move past an obstacle if your bottom Z isn't above its top Z, and you can't move to a different map tile if the Z difference isn't smaller than your maximal slope step size.
 
Top