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

GameMaker Setting individual tilemap size for tileset layers

Gigicom

Member
Hello,

I'm currently experiencing extreme performance issues in the room editor, now I'm at the point where it won't even let me save the room anymore ("unable to save the following files (please see output panel for more details)").
Previously I've mostly been only adding tiles and new tile layers to the room though so I guess that's really the problem. My room is about 80'000 x 90'000 px in size and has at least 30+ tile layers as well as some other instance layers. The size of the room.yy file is alone already 1 GB.
The reason I have this many tile layers is that I haven't really found a way to add depth for tiles. But as far as I know, when a tile layer is created, the tilemap size is still of the whole room even if I just place one tile.

My question: Is there some way to set the tilemap size in the room editor? And if not, does anybody have a suggestion for some other way to optimize this in the room editor?

Thanks in advance!
 

TheouAegis

Member
You have 30+ levels of tile depth? For what?

Why is your room so big?

Either use multiple smaller rooms, or save the tile data to .bin files instead of in the room itself (makes editing a pain in the butt) and load the tiles as-needed.

The only way to resize a tilemap is to resize the room it is in. It's unfortunate, bit it's somewhat a step up from GMS1's tile handling.
 

Gigicom

Member
(Sorry for the late reaction)

Thank you for the response. I found a workaround so in case someone else has this problem, here's my code (Create Event):

GML:
var xCells = room_width/64;
var yCells = room_height/64;
var lowerWallLayer = layer_get_id("LowerWalls")
var lowerWallMap = layer_tilemap_get_id(lowerWallLayer);
var c,l;

for (c = 0; c < yCells; c += 1){
    var triggered = false;
    for (l = 0; l < xCells; l += 1){
        if (tilemap_get(lowerWallMap, l, c)){
            if (triggered == false){
                var newLayer = layer_create(ceil(-(c * 64 / 10)), "WallsLower" + string(c));
                var newMap = layer_tilemap_create(newLayer, 0, c*64, ts_Walls, xCells, 1);
                var triggered = true;
            }

            tilemap_set(newMap, tilemap_get(lowerWallMap, l, c), l, 0);
        }
    }
}
 
Top