• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

GMS 2.3+ My rooms are too big, and I can't shrink them

Wainggan

Member
(I'm not sure if this is the correct forum for this, but it was the closest I could find)
So... basically
Here's what a room of my game looks like:
Screenshot 2021-03-28 172233.png
I make the rooms big because I usually need the space, but now that I'm done with this level, there is all this unused space above the level that ends up taking up a lot of disk space. If I try to lower the room size, it shrinks it from the bottom, so it destroys all the tiles below.
Is it possible to shrink the room from the top?
 

kburkhart84

Firehammer Games
The easiest way would be to use the room editor to select and move all the instances up. Depending on the resource type you may be able to do it in groups or may have to do it one at a time(I think tiles and assets can't be selected like instances can, I could be wrong).

That said, Having a room oversized like that really shouldn't be taking up disk space or anything. Have you got a source or something showing how this is actually affecting your game? If it is all empty space, it shouldn't be affecting you in the slightest. On top of that, the room size itself is just more for the room editor. In game, you can easily move the camera outside of that area, and you can easily have instances go out of that area as well. You just can't easily use that space in the room editor. So yeah, I don't see how that empty space is going to have any effect at all on your performance, space taken, memory, or much of anything else either, with the only exception being if you have code that depends on it.
 

Wainggan

Member
The easiest way would be to use the room editor to select and move all the instances up. Depending on the resource type you may be able to do it in groups or may have to do it one at a time(I think tiles and assets can't be selected like instances can, I could be wrong).

That said, Having a room oversized like that really shouldn't be taking up disk space or anything. Have you got a source or something showing how this is actually affecting your game? If it is all empty space, it shouldn't be affecting you in the slightest. On top of that, the room size itself is just more for the room editor. In game, you can easily move the camera outside of that area, and you can easily have instances go out of that area as well. You just can't easily use that space in the room editor. So yeah, I don't see how that empty space is going to have any effect at all on your performance, space taken, memory, or much of anything else either, with the only exception being if you have code that depends on it.
Screenshot 2021-03-28 174359.png
My game should not be 100 megabytes large. It only has 4 2-minute songs, and the graphics are very small!
When the game is in a zip file, it is only 38.1 megabytes
Screenshot 2021-03-28 174620.png
Something is taking up the space, and I think it is the level.
 

kburkhart84

Firehammer Games
Something is taking up the space, and I think it is the level.
The quickest way to test that assumption is to change the room size and re-build. The instances wouldn't even move in the editor as far as I know. You could also add a few massive empty rooms and see if the size increases. Unless I'm missing something, you will see barely if any difference though.

I'm also leaning audio with curato. Compressed music is normally stored outside of the data.win file, but I'm not seeing any in your picture. That leads me to think you are using them as uncompressed, and uncompressed WAVs take up LOTS of space. Feel free to show us audio settings for those 4 music tracks if you think that we are wrong about that.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Guys, you're forgetting tiles... ;)
These will take up space in an empty room due to the way they're stored. Every tile cell that exists takes up space, even if there's no tile in it, as that means an empty tile ID needs to be stored. If you have multiple tile layers in a massive room, that adds up quickly. It's not entirely unreasonable to believe that the rooms are the issue.

@Wainggan:
Select all tiles on a layer. In case you missed the toolbar above the room editor window that lets you select tiles, there's a toolbar above the room editor window that lets you select tiles.
Cut the tiles, then paste them at the top-left.
Do the same with instances, except you can also move those after selecting them by clicking and dragging them around rather than cutting and pasting.
Then shrink the room.
 

kburkhart84

Firehammer Games
Guys, you're forgetting tiles... ;)
These will take up space in an empty room due to the way they're stored. Every tile cell that exists takes up space, even if there's no tile in it, as that means an empty tile ID needs to be stored. If you have multiple tile layers in a massive room, that adds up quickly. It's not entirely unreasonable to believe that the rooms are the issue.
I've never heard of tile cells taking of Megabytes of storage space though. That data is generally pretty small, just numbers. The graphics is what takes up the space. Maybe I'm missing something else. We are still waiting on the OP to check the audio settings too.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Try it. Make a new project, add a sprite, tileset and room. Add a tile layer. Make the room 16000x16000. Save. Bam, 10 MB room file that translates to a 4 MB data.win.

Upon closer inspection, empty tiles of an untouched tile layer take up 11 bytes per empty tile (each tile = one instance of 2147483648, in the file). I can certainly see how this can take up a lot of space very quickly... but that seems a bit off to me. Notably, replacing the "default" empty tile of a tile layer with the proper (top-left) tile of the tileset turns the series of INT_MAXes into 0,, which takes up 9 bytes less space per tile. So... make sure your empty tiles are properly empty, I guess? (As expected, this cut the room size down to 2 MB.)

I'll retest this on the latest beta tomorrow to check if this has been changed, as that seems suboptimal at best and like a bug at worst. I'll file a report if I find out that it still happens.

Meanwhile, if you have any leftover "default" empty tiles in a room that already has a bunch of proper tiles placed in it and don't want to mess around with replacing every default empty tile with a proper empty tile, a simple search and replace across the entire room file in a text editor from 2147483648 to 0 should set all of them to the proper empty tile and reduce the file size accordingly.
 

kburkhart84

Firehammer Games
Try it. Make a new project, add a sprite, tileset and room. Add a tile layer. Make the room 16000x16000. Save. Bam, 10 MB room file that translates to a 4 MB data.win.

Upon closer inspection, empty tiles of an untouched tile layer take up 11 bytes per empty tile (each tile = one instance of 2147483648, in the file). I can certainly see how this can take up a lot of space very quickly... but that seems a bit off to me. Notably, replacing the "default" empty tile of a tile layer with the proper (top-left) tile of the tileset turns the series of INT_MAXes into 0,, which takes up 9 bytes less space per tile. So... make sure your empty tiles are properly empty, I guess? (As expected, this cut the room size down to 2 MB.)

I'll retest this on the latest beta tomorrow to check if this has been changed, as that seems suboptimal at best and like a bug at worst. I'll file a report if I find out that it still happens.

Meanwhile, if you have any leftover "default" empty tiles in a room that already has a bunch of proper tiles placed in it and don't want to mess around with replacing every default empty tile with a proper empty tile, a simple search and replace across the entire room file in a text editor from 2147483648 to 0 should set all of them to the proper empty tile and reduce the file size accordingly.
I don't know how many rooms the OP has(or if they are even using the tile system though it appears that they may be). I'm just not convinced that this is the issue despite your possible evidence. I guess if the OP ever shows us the audio settings we might be able to confirm more.
 

TsukaYuriko

☄️
Forum Staff
Moderator
True, audio files may very well also be part of the problem. I'm not saying they can't be, or that they aren't in this case. I just wanted to be very clear about it being possible that room size can be a factor here as long as there are tilesets involved. :)

In other news, figured I'd test it on the most recent beta before I forget and it still happens. Filing report.
 

kburkhart84

Firehammer Games
True, audio files may very well also be part of the problem.
The other reason I really suspect it is audio is that the folder there in the OP's picture doesn't show any audio, and compressed audio is stored outside the data.win file(unless I have something mis-understood). That would mean that in theory the 4x 2minute music tracks were set to not be compressed, so they would take up all that extra space easily enough.

At the least this discussion led you to the issue for the report, I'll call that a WIN!!!
 

Wainggan

Member
I don't know how many rooms the OP has(or if they are even using the tile system though it appears that they may be). I'm just not convinced that this is the issue despite your possible evidence. I guess if the OP ever shows us the audio settings we might be able to confirm more.
Sorry, I'm back
The songs were not compressed, so I ticked them all to compressed, and it did actually save a lot of space!
Screenshot 2021-03-29 152226.png
But that is still 80 megabytes, so I decided to create a new 10000x10000 room with 5 tile layers(each with a selected tileset) to see if that would increase the size of the game.
Screenshot 2021-03-29 152713.png
It did

Guys, you're forgetting tiles... ;)
These will take up space in an empty room due to the way they're stored. Every tile cell that exists takes up space, even if there's no tile in it, as that means an empty tile ID needs to be stored. If you have multiple tile layers in a massive room, that adds up quickly. It's not entirely unreasonable to believe that the rooms are the issue.

@Wainggan:
Select all tiles on a layer. In case you missed the toolbar above the room editor window that lets you select tiles, there's a toolbar above the room editor window that lets you select tiles.
Cut the tiles, then paste them at the top-left.
Do the same with instances, except you can also move those after selecting them by clicking and dragging them around rather than cutting and pasting.
Then shrink the room.
I'm going to try that right now, I guess. I have a lot of levels, and it's just really tedious because I have a lot of tile layers per room, that's why I was asking about shrinking the room from the top, not the bottom
 

Wainggan

Member
I have went through every level and removed all the unused space, and I am happy with the results
Screenshot 2021-03-29 174637.png
Thanks for the help!
 

TsukaYuriko

☄️
Forum Staff
Moderator
Glad you were able to resolve this! :) But now that we're already at it...

The songs were not compressed, so I ticked them all to compressed, and it did actually save a lot of space!
Probably overshooting the boundaries of this topic by a bit, but there's one thing I noticed about this... it's the total lack of audio files in the exported game's folder. This leads me to believe that you're not streaming your BGM assets. It's generally recommended to stream music (Compressed - Streamed) rather than any of the other options that decompress the entire audio file at run time (for reasons best explained in greater detail by the manual). That would also push them out of the data.win file. It doesn't save any space, but it does avoid the stutter when trying to play compressed audio that you probably just introduced to your game by switching from uncompressed to compressed audio for music. It's usually not the best idea to on-demand decompress audio files containing multiple megabytes of audio.
 

Wainggan

Member
Glad you were able to resolve this! :) But now that we're already at it...


Probably overshooting the boundaries of this topic by a bit, but there's one thing I noticed about this... it's the total lack of audio files in the exported game's folder. This leads me to believe that you're not streaming your BGM assets. It's generally recommended to stream music (Compressed - Streamed) rather than any of the other options that decompress the entire audio file at run time (for reasons best explained in greater detail by the manual). That would also push them out of the data.win file. It doesn't save any space, but it does avoid the stutter when trying to play compressed audio that you probably just introduced to your game by switching from uncompressed to compressed audio for music. It's usually not the best idea to on-demand decompress audio files containing multiple megabytes of audio.
That makes since, thank you!
Should I compress sound effects as well?
 

TsukaYuriko

☄️
Forum Staff
Moderator
You generally want those to be uncompressed so that they are immediately available when needed. Otherwise, you may notice small hiccups the first time a sound is played.
 
Top