Question
Hello everyone! What’s the best way to create over 800 levels for a 2D game while keeping the project as small as possible? I’ve heard of this approach: using a text representation of the levels, where levels are created using text files, and textures are loaded via code. I would like to hear the opinions of professionals on which method you would use. The main goal is to minimize the project’s size.
Sounds like a task for randomly generated levels, taking a seed and generating a level will give you the best disk-usage to levels ratio.
Godot does already store scene .tscn as text files, though you can compress it in a number of ways. Spelunky used text based levels where symbols like # would represent blocks, and say ^ would be a gem. When exported Godot automatically compresses scene files so you may not be saving that much space.
Thanks for the answer! Yes, I was thinking about random generation, but I would like to create the levels in advance. I heard that you can create all the levels in a text file, where, for example, # is the walls, ^ is the floor, @ is the player and other elements. But I wanted to ask if there is something easier for a beginner, because I heard that you can use one scene for 50 levels and give one atlas. But will it take up a lot of disk space? My goal is for people to download the app, and when choosing a level, for example the first one, everyone would play the same level as the others. After all, random grain generation will create different random levels.
Probably the largest (disk) part of creating a level will be the textures/art, if you have only one simple tileset then you will have little disk usage. You can use the same tileset for every map making it a small barrier to enter, then the level files are small while the art is big and seperate.
This is why I mentioned “Taking a seed and generating a level”, with generated levels you can give a “seed” to the program and it will create the same level every time. So if you distribute only the seed it will be extremely small.
Yes, I agree, taking the level-generating grain as a basis is a good idea, but I don’t think it’s suitable for a beginner. If I divide 800 levels into 8 scenes, where each scene will have 80-100 mini-levels distributed using Tilemap 2D, and I use the same atlas with a small number of textures (4-6), this will be the best option, requiring less programming and suitable for beginners. If I understood you correctly, you said that I can use the same tiles, for example, grass block or walls, and in my case it won’t increase the disk usage significantly, right?
Correct, if the tileset is saved seperately from the levels then you will have one “big” disk-usage spend for art and collision data, then 800 little spends for arranging those tiles.