Best way to streamline 100+ pre-made levels?

Problem:
I completed my games mechanics for my plat-former; Ex. player movement, AI, walls , hazards, etc.
So basically all their’s left is to make the levels. Let say you were to make 100 non-random levels that include hazards, walls , floors , enemy’s. Is making 100+ scenes really the best way to create that many levels? I was thinking of making one scene storing all my “level structures” in an array, and perhaps calling the level using the specific index, but even though i’m a beginner something about my method seems off. Any suggestions?

Well of course creating a 100 different scenes looks like not the best way to go. Since you say they are supposed to be non-random, then just like you said writing a manager and editing / hardcoding(not recommended though) your level structures inside your manager would be the best way to go. Since I don’t know what your game is about, I can’t point you into the best direction. But what I can say is that, write a manager, or if you have too many different gameplay elements through your levels try to categorize them into a couple titles and write seperate managers for each of them, and let your scripts assign your levels, sprites, prefabs and necessary behaviours.

So, if your “level structures” are only visual, then what you can do basically is:

As you said, store them into gameobjects in a single scene’s hierarchy, or let’s say make 10 scenes and only hold 10 structures in each to save some loading time, then enable the necessary structure’s base object depending on your level.

A better way would be, generating these level structures through code on the loading time, which will save you a lot of editing time, but ofcourse it depends on your game, simply editing those levels through the Unity Editor would be easier/more manageble way if your game has a lot of elements that needs to be hand-placed etc.

But again, in summary, don’t create 100 different scenes for that. If you really want to seperate things, then categorize them and create 10, or 20 scenes. There are no limitation as far as I know that you should never ever create 100 scenes, its just that it would be pretty hard to manage them all through your production time.

Cheers.

Thanks. That definitely helped point me in the right directions

I’ve recently used custom class scriptable objects for storing level data. In the following example, prefabs are stored in an array and the custom ‘Data’ class contains the position, rotation, animation target vector (for moving platforms), prefab ID and a custom tag string.

Wow that’ts pretty awesome. How do you handle memory?

The test project is very much a prototype in need of optimization, but as the map data class is referenced during initialization it ‘should’ be quite efficient. The intention is to incorporate an array or list of scriptable objects for scene switching.

If you’re using Unity 2018.1.0f2 or later take a look at the following project, it’s very basic but serves well as an example…

Scriptable Object Prototype Link

Arrow keys to navigate, down arrow for moving platforms.

You can create a new map object from the ‘Project / Create menu’…