The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => XP Event Systems => Topic started by: Forty on June 10, 2007, 05:10:55 PM

Title: [XP] (Somewhat) Random Dungeon Generator
Post by: Forty on June 10, 2007, 05:10:55 PM
For a (somewhat) random dungeon generator, you will need
at least 2 varaibles and patience to make extra maps

Lets say you want a dungeon where you go through three random rooms and then a boss room at the end

Make six rooms where the exit is on the same side of each room (if you don't do this, the layout will seem illogical)
Why six rooms for a three room dungeon? So that the player as a more random trip through. Try to include some puzzles or minibosses and maybe even a treasure room of sorts.
Also make a boss's lair

At the entrance of the dungeon, have an event where the player walks in like this
Code: [Select]
Control Variables: Room Count+= 1
Control Variables: Room Number= Random No. (1...6)
Conditional Branch: Variable [Room Number] == 1
Transfer Player: (room name)
Branch End
Conditional Branch: Variable [Room Number] == 2
Transfer Player: (room name)
Branch End
Conditional Branch: Variable [Room Number] == 3
Transfer Player: (room name)
Branch End
Conditional Branch: Variable [Room Number] == 4
Transfer Player: (room name)
Branch End
Conditional Branch: Variable [Room Number] == 5
Transfer Player: (room name)
Branch End
Conditional Branch: Variable [Room Number] == 6
Transfer Player: (room name)
Branch End

Then at the exit of each room put this code (note, If you want your players to be able to loop back to the same room, add another branch)
Code: [Select]
Conditional Branch: Variable [Room Count] == 3
Transfer Player: (boss lair)
Control Variables: Room Count+= 1
Control Variables: Room Number= Random No. (1...6)
Conditional Branch: Variable [Room Number] == 1
Transfer Player: (room name)
Branch End
Conditional Branch: Variable [Room Number] == 2
Transfer Player: (room name)
Branch End
Conditional Branch: Variable [Room Number] == 3
Transfer Player: (room name)
Branch End
Conditional Branch: Variable [Room Number] == 4
Transfer Player: (room name)
Branch End
Conditional Branch: Variable [Room Number] == 5
Transfer Player: (room name)
Branch End
Branch End

If you want multiple dungeons like this in one game, rather than making multiple variables, at the boss, multiply the room count variable by zero and since the players will not back track through, transport them out
To see an example of this, download the attached file
If you have questions or comments say them here.
Title: Re: (Somewhat) Random Dungeon Generator
Post by: Revo on June 10, 2007, 07:11:06 PM
Great job! This is great. I can use this.

Really helpful. +Rep! :blizj:
Title: Re: (Somewhat) Random Dungeon Generator
Post by: Kokowam on June 10, 2007, 07:49:03 PM
Nice. Now I see why you put (Somewhat) in the title.
Title: Re: (Somewhat) Random Dungeon Generator
Post by: Forty on June 11, 2007, 03:15:57 PM
Updated it incase you want multiple random dungeons