How to integrate 100+ levels into a game?

Hi guys, I wanna have multiple levels for a casual game and I also want to be able to choose from them through a menu.
While I know how to stitch things together, I’m not sure of which approach I should take. I only have one idea in mind right now and it is to create 100 separate levels which doesn’t sound optimal at all.
Hope you understood what I mean and thanks :slight_smile:

Depending on the scope, storing level data may be a feasible option that will also allow you to integrate procedural / random elements.

You could nest structs defining the elements of the playfield. Rather than loading a level, you wipe the existing one and loop through your structs respawning what’s needed.

Another benefit of this approach is the relative ease of storing modified structs in a save game - were we to return to the level that has been completed, its data reflects that (if you saved it)

Consider it.

Seems like a good approach too. If I understand well, this means I’m still gonna need a 100 struct right? How would it affect the size of the game?

That’s the best part. It wouldn’t, not really. It obviously will take space but it depends on how clever you are with organising data. Perhaps some data is common for some levels and does not need repeating.

You could easily find out by creating a dummy struct reflecting what data needs saving. Automate making hundred of them and save it.

Unless you know precisely what goes into the game and have written and extensive GDD triple that space.

1 Like

In this case it’s the perfect approach, thanks man I really appreciate it, this is isn’t the first time you’re lending me a hand :heart:

1 Like

You could also use a mixed approach. Perhaps among the 100 levels there are 10 general themes / biomes / planets. You name it.

You could create 10 hand crafted base levels, and then populate each with 10 data variations stored in a struct.

1 Like