[Request] A way to create random dungeons using pre-made maps [AKA NOt JUST another Random Dungeon R

The Request:


I'm interested in a script that, as the title suggests, uses a handful of rules to make a random dungeon out of separate rooms made in maps. The best example of what I'm interested in doing is the Binding of Isaac.


[Not Played/Don't know about the Binding of Isaac? Have a Video that shows you some Game play, and a link to the Creators Blog where he mentions about the Room Randomization. Warning, Long Video and Potentially NSFW Content]







In an ideal world, it would have the following features:


* Randomly generated dungeons using maps as rooms, with the ability to go back on yourself to explore the dungeon. 
* Several types of rooms that must be present on the map (Entrance, Exit and Boss Room)


* A way to set the dungeon length via variable


The Problems:


I can, in theory, do this request purely with variables, and make it so a new room is generated every time you leave the previous one. The problem with this approach however is there's no going backwards, or exploring. It's a linear run with no dead ends or anything from start to finish, which can be fine but could get boring quickly


So I started to look at doing more complex eventing, and it got for too complex far too quickly, especially as you'd have to have room that MUST show up (Objectives, Start Room, End Room etc.) and you could pretty quickly end up with dungeons that can't be completed due to dead ends etc.


Thanks for taking the time to read this, I know randomisation scripts like this are a pain in the proverbial, but any help/advice would be very much appreciated.
not watching a long video.


Hasn't someone already requested something like this?


If your maps are already predefined, just put all the map ids into an array (you can use a variable for this), and as a once-only action (either at the start of the game or the first time you enter the dungeon), choose how many rooms you want it to be, and randomly select that number of elements from the array into another, making sure none are repeated.  That gives you the order of rooms.


Use another variable as a counter to keep track of what room you're in, along with a 'go forward' and 'go backward' common event that adjusts the counter up or down, grabs the appropriate map number, and sets the x and y positions for the transfer.

Original thread: https://forums.rpgmakerweb.com/threads/request-a-way-to-create-random-dungeons-using-pre-made-maps-aka-not-just-another-random-dungeon-r.68792/