Best way to create multiple, large, non-random maps

I’m thinking of creating a maze game, but I don’t want to generate the mazes automatically/randomly (they need to be solveable, and I’d like to be able to place items, enemies, etc. along/near the solution route). So that means I need to include a bunch of mazes and then create the maps based off those. The mazes could be made up of grids 100x100 in size (where each grid cell is ~50px).

What’s the best way to do this?

My only thought is to have text files with the mazes made up of ASCII characters (e.g. # is a wall object, @ is the player’s starting position, etc.). Then I’d read in a text file, and go through each character creating the matching object in the game.

Pros:

  • Text files are minimal in terms of storage
  • As I’m reading in the characters from the file, I can be creating the objects at different relative X,Y positions to create slightly different mazes (i.e. 8 mazes (normal rotated 4 ways, flipped rotated 4 ways))

Cons:

  • Not as ideal as just having each maze pre-built as an external layout

Is this the best way to do it? Or are external layouts better? Or is there a better way I haven’t considered?

One thing I did in Alanna The Princess Of Puzzles is to set only one GameScene to all events and 24 scenes for each map, a lot of Sprites are global so it’s easy to share between scenes the maps created with Tiled divided in images of 960x640 so the impact in the performance is not bad.

This is one of the levels


And the events as you can see only a Link to GameScene

1 Like

Thanks @UlisesFreitas. I’d heard about tilemaps before but had no idea what they were or what they were used for. After looking into them a bit, they sound like exactly what I need.