Game Mechanics RPG Multi-level tiling design

Cyndi

Member
Hey, I'm making my first game with Game Maker Studio 2 and I can't seem to figure out how to create a multi level map without limiting myself in ways. I want to make it so that my character can jump up a level on the map, but I also want them to be able to walk behind those levels and still collide with the back of them, etc. Does anyone have any tips on how I can do this using a base floor layer, as many layers as there are floors above, and a collision layer? Thx!
 

Yal

🐧 *penguin noises*
GMC Elder
I'd advocate having full 3D collision logic in place, and just draw stuff with an y displacement based on their z coordinate, rather than having jumping actually change your y coordinate. Speaking from experience, it's actually much easier to do stuff this way. :p

Feeling comfortable with that idea? The idea basically is that anything on an upper level is placed at the same x/y coordinates as stuff on the lower level, but it's drawn higher based on its z coordinate. You could use different layers for each Z and then use draw_tilemap to draw the tilemaps but shifted based on their z coordinate, for instance.
 

Cyndi

Member
I'd advocate having full 3D collision logic in place, and just draw stuff with an y displacement based on their z coordinate, rather than having jumping actually change your y coordinate. Speaking from experience, it's actually much easier to do stuff this way. :p

Feeling comfortable with that idea? The idea basically is that anything on an upper level is placed at the same x/y coordinates as stuff on the lower level, but it's drawn higher based on its z coordinate. You could use different layers for each Z and then use draw_tilemap to draw the tilemaps but shifted based on their z coordinate, for instance.
Thank you! I actually thought about this, and I think I'll just do that, but do you have any tips for how I could create collision detection with things like the back of buildings, without messing up when I actually am standing on those objects? Thank you! :D
 

Yal

🐧 *penguin noises*
GMC Elder
Thank you! I actually thought about this, and I think I'll just do that, but do you have any tips for how I could create collision detection with things like the back of buildings, without messing up when I actually am standing on those objects? Thank you! :D
Well, if you treat each build-block of a building as a 3D rectangloid, this kinda comes automatically. Let's look at an example...
upload_2017-7-24_17-30-33.png
In this example, the red and orange characters can't move left because there's an obstruction for them at the same z level as they are at, but the green player has no obstruction and can move left. The building is drawn directly left of them, but in reality it's not overlapping with the position left of them.
 
Top