Maze Generator, Is there a ready-made algorithm?

Hi! Is there an extension for generating mazes from sprites?

You can see all available extensions at the link: Extensions [GDevelop wiki]

Perhaps this extension will help you: Extension: Dungeon Generator by Victris Games

Please write in English.

1 Like

Thank you, this is a bit not the option. I wanted something like this:

I came up with an example template that might help you. You can visit this page to download it:

The full source code for Gdevelop is downloadable, to learn how I did it and/or use it as a base to start your own project from.


Unfortunately your page is not working

oops, forgot to make it public. Try it now

1 Like

A great example! But very difficult for me. I still haven’t figured out how to increase the size of the maze or reduce it
Can you explain to me how to do this?

Oh wow, this is really neat! Here are some thoughts:

  1. You don’t need to create unique IDs for floor objects because the CreateMultipleCopies extension already adds a CreationID (and RowID, ColumnID)

  2. I need to study how your logic works. You did a lot with very few events!

  3. Are you interested in turning this into a public extension? :wink:


1 Like

I understood how to enlarge the map. but there are two questions:

  1. Is it possible to speed up the construction algorithm?
  2. Complicate the maze?
    The work is just great!

Thanks, glad you like it! It could maybe be sped up by using variables and logic to generate the maze without the help of actual objects, then only create the objects at the end.
If you’re just trying to remove the awkward pause on startup, the maze building progress could be done over multiple frame steps while a progress bar fills up on a black screen or something.
I’m not exactly sure what you meant by complicate the maze. I guess make it harder so solve? I haven’t yet studied what exactly makes a maze harder or easier so solve, but there might be some simple ways to achieve this but it would take some experimentation.
Maybe, combine a few smaller mazes into one large maze by lining up their exits and entrances? Or, add a step at the end that checks for spaces that have 3 open sides (no walls) and close one of the sides.

1 Like

I have been learning to use extension features of gdevelop recently, with some mixed success and difficulties. When building this I tried to make it customizable, in that you can change the sizes of the maze object, the walls and the floors, and to some degree it should still work. But, I haven’t done much testing to see if it works smoothly in practice.
I did like how this turned out though, so I am thinking of doing some more with it. Let me know if you have any ideas on what common features of mazes that could go into a maze generator.

1 Like

Please tell me how you can increase the thickness of the walls to 16 pixels? I increased the size of the sprites of the walls - but the maze “broke”
I wanted to add textures to the floor and walls

I was able to get resizing to work.

One point is that the walls need to have length equal to the length of the square floor. Also, the corner piece has to have length both vertical and horizontal equal to thickness of the walls.

Also, if you just resize the objects that start out in the room, the maze gets messed up because the objects being created by the events start out at their default size, based on the sprite.

The solution for that is to change the size of the sprites themselves. The menu in the sprite editor for that is here:


It still doesn’t work((

Could you show me your project with a size of 16 pixels?
I’m probably too stupid…

I will sent the updated version, just size of objects have changed, through a temporary link:

Thank you very much! This is a super example! :smiley:

Can you share the online file link? It has expired!

I did end up making this into an extension. There is a demo example here.

I submitted it as a community extension to make it available, but not released yet I don’t think. If you have time to do some testing and add some comment to github page, that might help!