Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics


Package GameMaker rooms and load them as you please · By YellowAfterlife

Issue with layer depth

A topic by Bommel24 created 87 days ago Views: 85 Replies: 8
Viewing posts 1 to 3

I have an issue where my tileset and object layers somtimes get loaded with wrong depth and as such overlay with things they shouldn't. Using latest Version of this extension and GMS 2.


I think your issue might be that you have same-purpose layers automatically assigned to different depths in different rooms, and do not have layers match between rooms either. You can view/override layer depths in layer properties.

There are no rooms overlaying each other in my game in fact the base room is totally empty. In room editor (before using GMRoomPack) my tileset depth is 300 and instance depth is 200 however tiles overdraw instances in some cases. Depth is not changed in code or something and it works when I load the room without GMRoomPack. Also in my GMROOMPack.args.txt file I have saved:


But running this "GMRoomPack.exe C:/Programming/GM/Platformer/rooms C:/Programming/GM/Platformer/scripts/rooms/rooms.gml " in a command line or bat file just gives me the base GMRoomPack interactive output just like when running the exe without parameters.

Another thing is that .yymp extension packages can no longer be drag and dropped or in any way imported into GMS IDE v.2.2.x. So I had to rename it to .zip and import it that way.


What I mean is - let's suppose you have room A with an instances layer and a background layer, and room B with a tiles layer and a background layer. Both instances layer in room A and tiles layer in room B will have the same depth, so loading room B into room A will mix the tiles into the instance layer (which is what you seem to be seeing). If you are confident that you aren't mixing things into the same layer/depth, please send me a sample project where this happens and I'll take a look.

Command-line argument thing is an oversight on my part, I'll upload a new version the next few days. If you need it sooner, send me an email from your purchase email, and I'll email you the updated packer executable alone

Drag and drop import definitely still works. Are you dropping it onto workspace area (rather than onto resource tree, an editor, etc.)? IIRC there was a bug where some users couldn't drag and drop anything onto GMS2, but I thought that was fixed

I sent you an email with a video and a project file :)

Any update on the issue?


Hey, I'm getting to this shortly. It's one of those months when everything is on fire

Developer (1 edit)

So this was because you are loading an Instances_1 layer from room0 (where it is at depth 100) into rm_test, which has an Instances_1 layer at depth 500000, thus causing them to be added to that existing layer. In other words, if you need the added layer to be at a specific depth (that's inconsistent with target room), you would have to name it differently in the to-be-imported room.

I'm not actually sure what's the right way to handle this - if I let GMRoomPack create layer(s) with the same names as existing layers in the target room (but at different depths), you could get any of the same-named ones when asking for a layer by name, which would make a far bigger mess.

Uploaded a new version that fixes packer issues though

I understand the issue however I feel like since Game Maker (by default) names all layers the same, I think the "correct" way to handle this would be to create multiple layers with the same name at different layers. (Maybe if this is not possible I would even go as far as to have a prefix or suffix after the layer name (e.g.: _roomname or _depthvalue). This would be far more convenient than to rename all the layers. I feel like it's not "good" game design to access the layers by name anyways. Far more often you want to have different depth values. Who renames their "Instances" layer in every room for different depth?

Thank you for looking into the issue :)