public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

VXACERandom Dungeon Generator (with demo)

BMM Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: Random Dungeon Generator (with demo)
  • Original author: Neon Black
  • Original date: October 13, 2012
  • Source thread: https://forums.rpgmakerweb.com/threads/random-dungeon-generator-with-demo.5478/
  • Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSS3 Scripts (RMVX Ace)

Summary

Dungeon Generator Script v1.0​Created by Neon Black​ What is it? This script is one I have wanted to do since I started working with VX. It allows a random dungeon to be created from a number of rooms of any size and shape. This allows for more controllable dungeon design. How can I use it?

Archived First Post

Dungeon Generator Script v1.0
Created by Neon Black

What is it?
This script is one I have wanted to do since I started working with VX. It allows a random dungeon to be created from a number of rooms of any size and shape. This allows for more controllable dungeon design.

How can I use it?
To use this script, place it under “Materials” but above “Main”. To use a random dungeon, simply use the following script call:

  • create_dungeon(length, alts, width, height)
After using this call, just transfer to a map tagged with “<random>” and the random dungeon will be created. The 4 arguments of the script call are meant to be numeric and are as follows.

  • length – The total length of the main path of the dungeon. Using a higher number will create a larger dungeon.
  • alts – The max number of treasure paths to create. These paths can be any length between 1 and “length” rooms and will start from any existing room EXCEPT the start and end rooms.
  • width – The total allowed width of the dungeon in rooms. By default a buffer of one room is placed on each edge of the dungeon and includes empty rooms.
  • height – Same as width only vertical.
Maps must be created with a total of 40 “rooms” that the dungeon selects to draw from. This creates a set of rooms that is 8 wide and 5 tall. Every room must be the same size, but the size of the rooms and the size of the set is pretty much infinite. The first 16 rooms are the standard rooms that will show up based on the random value you set in the config section.

The next 16 tiles follow the same pattern. These are the “uncommon” tiles that only appear with a certain chance based on the random value set in config.

The final 8 tiles are the start and end points. The first 4, your start points follow the pattern up, right, down, left. The last 4 are the end points and follow the same pattern.

The end result map should be something like this:

WyHRi.png
There are 2 types of special events that can be placed on a map. These are as follows:
  • <super> - Any events with this in their name will get placed in the very upper left hand corner of the map. This is useful for parallel processes and other such events.
  • <treasure> - The event with the lowest id and this in it's name will get placed on all tiles in treasure rooms that have an ID of 3.
Regions are very important for telling the map where certain things should happen. The region tags that are reserved by the generator are 1, 2, 3, 4, 6, and 8.

Region 3 is used by the generator to determine where to put treasures. When a room is designated as a treasure room (the end of an alt path) it will search the room for a region 3 and place treasure chests on ANY found (see above for how to mark these).

Regions 1, 2, 4, 6, and 8 are used for the start points. As it is creating the dungeon, it will take the last of these regions that it copies and set it as the start point. As a general rule, only put one of any of these in each of the 4 start rooms. When using region 1, the player's facing direction is determined by the transfer event. If you want the direction to change based on which room the player ends up in, user 2, 4, 6, or 8. These will set the player to face the same direction as the same number on the numpad, for example, region 8 will place the player facing up.

All other events work normally. When a room is copied over to the newly created map, all events are taken with it and placed in exactly the same spot. The only exceptions are events marked as treasures and events marked as super.

What does it work with?
This script may not work with scripts that modify how maps, tilesets, or events work.
This script adds an additional command to my Basic Console script that allows you to see a map of the dungeon generated. To do this, type “map” in the console screen.

How can I get the code?
Version 1.0 (base script, 9.8.2012) is available from my pastebin account here or the demo on my mediafire account here.

I would like to use this code.

This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
Permissions beyond the scope of this license may be available at http://cphouseset.wordpress.com/liscense-and-terms-of-use/.

Author’s Disclaimer:
I had created a similar dungeon generator to this with events in rpg maker 2k3 and it actually worked really well! Of course with scripts it’s a lot more controllable. The main focus of this dungeon generator is to allow large dungeons with multiple “rooms” to be created which allows more control to the shape of dungeons. The result is random dungeons similar to Persona 4. Rather than being small, ugly paths, you can create large, robust rooms, and due to standard and special rooms, you can even have some simple little challenges in some of those rooms. This may be a bit tricky to use, so I included a demo which shows how several aspects of the script work. If you’re having trouble, be sure to check that out. As always, enjoy!

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download

License / Terms Note

This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License. Permissions beyond the scope of this license may be available at http://cphouseset.wordpress.com/liscense-and-terms-of-use/. Author’s Disclaimer: I had created a similar dungeon generator to this with events in rpg maker 2k3 and it actually worked really well! Of course with scripts it’s a lot more controllable. The main focus of this dungeon generator is to allow large dungeons with multiple “rooms” to be created which allows more control to the...

Referenced Images / Attachments

80x15.png
80x15.png
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#rgss3#script-archive

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar