This project contains a set of BSP Maze Generator scripts, which are ideal for procedurally generated games like rogue-likes, adventures, or even Spelunky-style platformers.


  • Easy to use
  • Easy to customise
  • Only four main variables modify radically the maze generated
  • Fully commented code
  • Adapts to any room size
  • Accepts any base "tile" resolution.
  • Includes scripts to spawn walls, doors, enemies, potions... whatever you need!
  • Demo room with player, walls, doors, floor etc...


Further Information

BSP stands for Binary Space Partitioning, and it's a method of dividing up an area. In this case, it's used in a series of scripts that can be used to generate a maze (or map, or dungeon) for any game, complete with rooms, corridors and doors. The engine adapts to any room size and base tile size, and it can be adjusted is several ways to get different results each time.

You can also use these scripts (with a minimum of customisation) to add features to your created mazes like enemies, switches, power-ups etc.

NOTE: While I strived to make these scripts as accessible as possible, you will need to know the GameMaker Language to use them and they are not recommended for absolute beginners.

The demo project supplied with these scripts permits you to test the main features of the engine and you can get an idea of how it works in a real game by pressing from the main options room. This will create a maze using your set parameters and add a player, walls, doors, floor tiles and some enemies.

This set of scripts is particularly suited to use my Autowall, Object Optimisation and Aura Lighting scripts which can be found from the following links:

The full set combined give you a highly optimised and graphically consistent maze/dungeon map for your rogue-like or adventure games.

More info

End User Licence Agreement (EULA).

Changes in 1.1.3

Major Update!

  • New scripts added to populate the whole maze or a single room area with instances
  • Spawning now takes the sprite width/height into consideration and prevents over-laps (if required)
  • New ESSENTIAL object added, the "obj_BSP_Collision_Parent" (required for the spawn scripts).
  • Floor tiles can now be any size and shape and will be scaled to fit
  • Extra instances added to the demo room: potions, enemy boss, and gold.
  • More comments added to certain parts of the code-base
  • Minor bug fixes to spawning code and other scripts

Version 1.1.3. Published August 6, 2014

Created with GameMaker: Studio v1.99.182

Age Rating: 4+

Privacy Policy

Average Rating

Your review

You can only review assets you've bought.


Anonymous 17 April 2019


Gadyka 5 28 January 2019

Please fix!

VERY nice work! But there is a bug- player sometimes spawns in a wall! Please fix! I really want to use this asset!


Anonymous 18 December 2018


john b 16 November 2018


Ednei N 28 September 2018

Excellent script but ....

It's a great script but it seems the support is no longer available.
I tried to contact support, but got no response.
There are no topics in the forum to ask questions.

Edit:I requested the support by email and by pm of the forum .... Thank you very much


Nocturne Games (Publisher) 20 September 2018

Hi there! I'm SO sorry you haven't heard back from me... How have you contacted me? Normally just using the contact form from the marketplace is enough to reach me, although sometimes they get marked as spam (but I'll be more vigilant about checking my spambox from now on). Please try again, and I really apologise for not getting back to you. I do still support ALL my assets!


Anonymous 12 April 2018

Thx for Source!

Hello! I'm living to KR.
It took a long time to translate everything.. it is very difficult because I am a beginner.
But I will trying it.
It's definitely hard for beginners to use
But This very kind and I do not think it will take long.
Thank you for source! I go to try.


Anonymous 10 April 2018


Andrew K 01 October 2017

Awesome Example

Well commented and in-depth code. Exceptional work!


Wizio G 13 February 2016

Great Asset!

I really like this asset. It's very fast and cleverly coded. You can understand everything at first look.


Collin W 10 June 2015

Really Great

This is very in-depth and useful to me. I'd been following along with your tech blog and now I have the asset I desperately needed to create my own rogue-like! Good job, Mark.


Benjamin A 28 March 2015

Really Solid

This maze generator has quite a bit of depth to it. The scripts are easy to use and there are great extras included in the asset that I wasn't expecting when I bought it (Room and area population scripts).

You will need to invest some time into reading through the comments to make sure you understand how and when the different scripts should be called but after that, using those scripts is straightforward.

I would highly recommend this to anyone wanting random dungeons/mazes in their game. Why write your own bsp scripts when Nocturne has so kindly taken the time to do it for us? In my opinion, $6, or whatever this costs, is a bargain for such a solid asset.


David W 30 November 2014


Works perfectly and is fun to tinker with!


Jayson P 27 November 2014

very powerful, yet very simple

If you have a basic understanding of code, this generator is soooo easy to manipulate and edit. It is so advanced and has some awesome features, yet at the same time its simplicity is astounding. Within minutes i have managed to manipulate it to exactly what i want, incorporate it into my game, and start with the other things in my game.
I was a bit negative with this whole market place thing in game maker, i do admit, and i was a bit...meh... at buying something. But the fact that its Nocturne who is a trusted source in my opinion, I am definitely satisfied with this and recommend it to everyone wanting this kind of feature

code: 5/5
comments: 5/5
difficulty: medium (some understanding of code is required)
ease of merging: 4/5


Forest B 21 October 2014

Essential asset for dungeon generation


Alex A 02 September 2014

Great Scripts

The generation is very good and nice however the debug script results in a cannot create vertex buffer error on my laptop with a tilesize of 16, due to drawing too many rectangles.


Nocturne Games (Publisher) 03 September 2014

The error with the debug script is related to chipset drivers and is not something I can control, unfortunately. If I remember rightly it happens with integrated graphics chips... However you can simply comment out the "draw_rectangle_colour" at line 39 and the debug scripts will work as they should, although individual split area will not be coloured. Sorry that this happens to you, but it's NOT a bug with my scripts and I can't do anything about it.

Thanks for commenting!


Jonathan C 27 August 2014

Nice starting point for your dungeon

Very cool, generates some convincing dungeon layouts.

The corridors are the only real sore point as they sometimes create rather roundabout routes between rooms and only ever have a thickness of 1 tile.

Edit: the biological feel to the dungeon and the corridors is actually the great thing about this, I think its really just the length of some of the corridors that gets a bit much.


Nocturne Games (Publisher) 26 August 2014

Thanks very much for the purchase and the kind review! I'm not sure what I can do about the round-about route as the way I have structured the connections was designed to give a slightly more "biological" feel to the dungeons. However, I will look into an option to change this behaviour, as well as an option to have corridors of 1,2, or 3 grid cells in width (which should be doable). I'll update the project if I can get these features added.

Thanks for the feedback!


Oliver H 07 August 2014

Great script, nice support!

This script works like a charme! You should have some medium to advance knowledge of GML to use it.

A feature wish for the demo: fog of war. :)

Btw: I had some problems, as the script crashed on my notebook. I contacted Mark of Nocturne Games and he answered real fast and tried to help. In the end I found out, that the debugging script has a problem with too many drawn rectangles on Intel chipsets. So, if the script fails for you, replace the draw_rectangle_color function in scr_BSP_Draw_Debug with a draw_set_color(c);. So you get at least colored debug text.

Nontheless everything works fine without the debugging function. :)


Nocturne Games (Publisher) 26 August 2014

Fog of war was not really something that I had in mind, although I can think of several ways that it could be implemented... I'll look into it and see if it "fits" with the engine as it is currently. Thanks for the feedback and I'm glad that the support you received was adequate.

Thanks a lot!


Danny U 02 August 2014

Works great! Though not for new users!

I will start off by saying that this is a great generator and lots of work was put into it but it does require a lot of set up and it took me about an hour to set up perfectly the way I want it. If your looking for something to just import into your game and be on your way this is not it. However if you know at least how to read code you can figure it out. This comes with a "Demo" which is a great feature and definitely shows you how to set it up properly.

For Advanced Users: Yes
For Intermediate Users: Yes (If you have patience)
For Beginner Users: No

This is great, good job Nocturne!

This review was left for a previous version of this asset.


Nocturne Games (Publisher) 02 August 2014

Thanks for the kind words! I worked hard at making the scripts as accessible as possible, but with something so complex, there is a minimum level needed to use them. I'll add some skill requirements to the description so that future users can get a better idea of what is expected. Thanks again and if you finish a game using this, then please send me a link or post it here in the comments. Good luck!

Package contents

Loading, please wait

What is the issue?

Back to Top