Live procedural generation in Rpgmaker

Canini

Veteran
Veteran
Joined
Mar 29, 2016
Messages
990
Reaction score
662
First Language
Swedish
Primarily Uses
RMVXA
When creating maps in the rpgmaker engine you have the option to let the engine itself create one for you. I know that it would take an enourmous amount of scripting and tweaking of the engine, but would it be possible to have the game engine generate a map during actual gameplay and place a series of premade events in it? I know there has been some experiments with adding things like client-server functionality to rpgmaker games or making things that the engine isn´t really meant to do, such as platforming games and strategy games. If this is not possible, would it be possible to have a "pool" of premade maps that the game randomly chooses from when the player touches a certain event? I kind of want to create a series of small bonus dungeons with 3-4 small floors (designed by me) and a randomized room with random treasures as a reward for the player. I think this may give greater variation to the game and also make it seem more alive. Since the last room is supposed to be some sort of treasure chamber it would not matter if the design was much simpler, in fact it would make perfect sense for the treasure room to look simple but still "organised" like what you end up with if you let the engine generate a map.

As an additional question, has anyone here been able to use the "generate dungeon" tool in rpgmaker to good effect?
 

Nightblade50

Developer of "Delta Origins"
Veteran
Joined
Nov 10, 2016
Messages
2,079
Reaction score
4,208
First Language
English, French
Primarily Uses
RMVXA
If this is not possible, would it be possible to have a "pool" of premade maps that the game randomly chooses from when the player touches a certain event?
Sure. Just make a bunch of maps as you please, then when the player touches the event, set a chosen variable to a random number. Then do a conditional branch: If it's 1, go to this map, if it's two, go to that map, etc. using transfer events.
As an additional question, has anyone here been able to use the "generate dungeon" tool in rpgmaker to good effect?
Ah no. The generate dungeon tool forms terrible maps. If you are making a cave from it, well, caves aren't square in the rooms. So perhaps you could fix that by just manually painting over to form more realistic walls, then adding rocks and moss and such. But even then, I still prefer maps I make without the generator at all.
 

ImaginaryVillain

Obviously the "Hero" of Light!
Veteran
Joined
Jun 22, 2019
Messages
227
Reaction score
556
First Language
Event Gibberish
Primarily Uses
RMMV

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
4,645
Reaction score
5,292
First Language
Indonesian
Primarily Uses
RMVXA
would it be possible to have the game engine generate a map during actual gameplay and place a series of premade events in it?
It is possible. What you need to know is to know how tilemap works. And a good logic to produce a generated map.
And I will tell you, it isn't easy.

If this is not possible, would it be possible to have a "pool" of premade maps that the game randomly chooses from when the player touches a certain event?
There're several attempts that did this, at least the map "pooling". I found one or two when I tried to google it. I forgot which thread though. Nevermind, it's the one above my post.
 

MushroomCake28

KAMO Studio
Moderator
Joined
Nov 18, 2015
Messages
2,012
Reaction score
3,442
First Language
English
Primarily Uses
RMMV
For choosing a random map in-game, totally doable with events with conditionals.

As for a dungeon generator in-game, it is possible but you need a plugin. It will not use the default dungeon generation algorithm since that the code of the editor, not the game's. So you need a plugin that has an algorithm to generate dungeon.
 

l8rose

Neeeeerd
Veteran
Joined
Jun 1, 2014
Messages
371
Reaction score
1,213
First Language
English
Primarily Uses
RMMV
It's possible to do the first quite easily but be sure that if you want them to be able to track their way out that you're using more then one variable (one for each map transfer) so that everything is interconnected. Just reset them when the player exits (or after so long)

And I've used the MV generate dungeon tool a few times. Mostly when I'm too lazy to draw out initial layout of the dungeon but I always go over it with other tiles to make it look more natural and usually end up completely shifting half of it around.
 

Dreyliam

Villager
Member
Joined
Feb 7, 2019
Messages
17
Reaction score
5
First Language
portuguese
Primarily Uses
RMMV
Ah no. The generate dungeon tool forms terrible maps. If you are making a cave from it, well, caves aren't square in the rooms. So perhaps you could fix that by just manually painting over to form more realistic walls, then adding rocks and moss and such. But even then, I still prefer maps I make without the generator at all.
ts.png
i have used the generate dungeon, and after generating a terrible map...
i just edited all, just take the shape as reference and use creativity
 

V_Aero

Veteran
Veteran
Joined
Apr 23, 2019
Messages
90
Reaction score
61
First Language
german
Primarily Uses
RMMV
The generate dungeon tool might be the only tool I'd ever request be removed from a product. :LZSwink:

There's a plugin that builds randomly generated maps from map blocks https://forums.rpgmakerweb.com/index.php?threads/procedural-random-dungeon-generator-october-update.109537/ Of course when I tested it, it still has the same awful feeling pointless mazes. But that could just be the default map blocks that were made for it.
Many thanks for linking my Plugin, I immediately clicked on this thread when I saw its headline :p
Well at the moment it supports only maze generation and random walk, using blocks as you already said. I thinks thats a fair compromise to generate maps while still being easy and flexible to use.
As alternative to my plugin, you can google for Biter Maps (cant link it on my mobile phone sorry) which provides a set of some map generators
 

ImaginaryVillain

Obviously the "Hero" of Light!
Veteran
Joined
Jun 22, 2019
Messages
227
Reaction score
556
First Language
Event Gibberish
Primarily Uses
RMMV
https://forums.rpgmakerweb.com/index.php?threads/procedural-maps-generator.83242/ Biter Maps for people's convenience.

I do remember looking into that one when I was researching a potential blank map creation from within a game (a new container, not a featureless map). Yours is far and away the best random generator I've seen, plus as a benefit it's not discontinued like Biter's is. Honestly if someone wanted to put in the work to make all of the tiles I think it could do a fairly impressive job. I only tested the demo, and have been keeping an eye on the plugin ever since. :LZSwink:
 

Canini

Veteran
Veteran
Joined
Mar 29, 2016
Messages
990
Reaction score
662
First Language
Swedish
Primarily Uses
RMVXA
Sure. Just make a bunch of maps as you please, then when the player touches the event, set a chosen variable to a random number. Then do a conditional branch: If it's 1, go to this map, if it's two, go to that map, etc. using transfer events.
Doh, I didn´t think of such a simple solution. I was totally overthinking it.

There's a plugin that builds randomly generated maps from map blocks https://forums.rpgmakerweb.com/index.php?threads/procedural-random-dungeon-generator-october-update.109537/ Of course when I tested it, it still has the same awful feeling pointless mazes. But that could just be the default map blocks that were made for it.
Nice! I also found this for VX Ace. https://forums.rpgmakerweb.com/index.php?threads/kai-monkeys-random-dungeons-now-with-version-two.40197/
Edit: You link to it in your OP but I'd thought I'd post it in this thread for reference. Probably really old like all VX Ace scripts but possibly something that may be of use to somebody.

It is possible. What you need to know is to know how tilemap works. And a good logic to produce a generated map.
And I will tell you, it isn't easy.
I have some limited in tilemapping for Unity, but I imagine the majority of the work would go into creating the logic for the map generation, if the internal one built into the engine can´t be used.

View attachment 128036
i have used the generate dungeon, and after generating a terrible map...
i just edited all, just take the shape as reference and use creativity
I have maybe 3-4 throw-away dungeon floors in my game that was created with dungeon generation but all of them have been changed a lot to make them a bit better designed. The only time I used a generated dungeon wholesale was because I needed a floor that worked as a sort of breakroom for a bunch of rogues and I felt the "designed by comitte" look was appropriate.

Additional question:
If I go with the map pool option, could I also randomly generate 1-3 treasure chests (random content, random amounts of treasure chests) inside of each map or would I have to make additional pools for every map variation?
 
Last edited:

V_Aero

Veteran
Veteran
Joined
Apr 23, 2019
Messages
90
Reaction score
61
First Language
german
Primarily Uses
RMMV
Additional question:
If I go with the map pool option, could I also randomly generate 1-3 treasure chests (random content, random amounts of treasure chests) inside of each map or would I have to make additional pools for every map variation?
You don't have to create additional Maps for every combination of loot chests, that would be too much. A simple Approach to have random loot chests is this: Set a variable eg "random loot chest" once you enter the Floor as random value. Inside every loot chest's Event you can define that this Event only exists if this variable matches a specific value. So you put some chests wich value "1", some with value "2".. and so on.

EDIT:
Ah I just saw that in MV the variable condition only checks for ">=" but we need "==" here. In this case you need multiple tabs. Lets say the chests exists when variable = 5, then you define the tabs this way:
1 tab: variable >= 5, chest exists
2 tab: variable >= 6, chest does not exist

My Explanation may sound complicated, but it's very simple.
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,466
Reaction score
10,865
First Language
English
Primarily Uses
RMVXA
'Game Mechanics Design' is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions belong in the Support forum for the engine you are using.

Unfortunately your profile page does not specify which engine you are using. Please post with that info and then this can be moved.

Thanks
 

Canini

Veteran
Veteran
Joined
Mar 29, 2016
Messages
990
Reaction score
662
First Language
Swedish
Primarily Uses
RMVXA
My Explanation may sound complicated, but it's very simple.
I should be able to figure it out. My problem with designing things like this is more overthinking things instead of realizing the simple solution. Would it also be possible to randomize where on the map the treasure chest itself appear? I guess you could use regionIDs to show which tiles on a map the player can access, or is there an even simpler solution that I am overlooking.

Unfortunately your profile page does not specify which engine you are using.
I use VX Ace although I would prefer if the topic stayed here since I intended the topic to be about procedural generation and the use of the dungeon generation tool in general (although I am aware it really didn´t turn out that way).
 

V_Aero

Veteran
Veteran
Joined
Apr 23, 2019
Messages
90
Reaction score
61
First Language
german
Primarily Uses
RMMV
I should be able to figure it out. My problem with designing things like this is more overthinking things instead of realizing the simple solution. Would it also be possible to randomize where on the map the treasure chest itself appear? I guess you could use regionIDs to show which tiles on a map the player can access, or is there an even simpler solution that I am overlooking.
You are again overthinking :D
We already solved this. Let's say, your map has some possible spawn Locations, then create a chest on any of this Location. But, chest 1, 2 and 3 are only there when the random variable = 1, chest 4, 5, 6 are there when the variable = 2 and so on. Just keep it simple ;)
 

Countyoungblood

Sleeping Dragon
Veteran
Joined
Dec 9, 2017
Messages
552
Reaction score
343
First Language
English
Primarily Uses
RMVXA
Would it be simpler to create a set of template rooms with lots of connection points and just randomly connect them? Id think it'd solve several problems and make the scripting easier.
 

V_Aero

Veteran
Veteran
Joined
Apr 23, 2019
Messages
90
Reaction score
61
First Language
german
Primarily Uses
RMMV
Would it be simpler to create a set of template rooms with lots of connection points and just randomly connect them? Id think it'd solve several problems and make the scripting easier.
Well, you still would have to define mechanics how the move Events work. That means, when the Player goes to the next map, then travels back and then re-enters again, he must be teleported to the same map. I think this Problem is solvable, although not easier than the simple method we discussed before. And in the end, I personally doubt that this solution will look immersive.

I once play-tested a game which used this method, but it did not handle a persistend world. That means, everytime the Player is about to be transferred, we is spawn on any randomly picked map on any Position; without any further logic. Simple to implement, but the Gameplay lacks. There was no point in trying out or explore different paths, but maybe this is just my opinion as I like crawl through mazes.
 

Canini

Veteran
Veteran
Joined
Mar 29, 2016
Messages
990
Reaction score
662
First Language
Swedish
Primarily Uses
RMVXA
Speaking more generally about procedural generation I would love some sort of community challenge (like the one map-ten events challenge) where you have to use use the dungeon generation tool exclusively for mapmaking. It would have to be pretty short since the map would not be very advanced or fun to explore but I think it would be a great exercise in focusing on an idea. Of course it would have to be a short challenge since the maps would still not be that fun to explore, at least for an extended amount of time.

Alternatively a larger empty proceduraly generated dungeon could be created, posted in a game.rpgproject file and then everybody could have a go at improving it.
 

CrowStorm

Storm crow descending, Winter unending.
Veteran
Joined
Sep 7, 2018
Messages
224
Reaction score
199
First Language
English
Primarily Uses
RMMV
Sure. Just make a bunch of maps as you please, then when the player touches the event, set a chosen variable to a random number. Then do a conditional branch: If it's 1, go to this map, if it's two, go to that map, etc. using transfer events.
This is so elegant and simple I wish it had occurred to me when I had been banging my head against attempting a roguelike. I'm making a few presumptions here, and one of them is that the priority is duplicating the roguelike experience where "no two delves/no two dungeon levels are alike". We're not ACTUALLY procedurally generating these maps in real time, we're just doing an end run around that by generating a ton of these maps before hand and sending you to a random one. (FWIW I think some actual for realz roguelikes do the same thing.)

If I were personally taking on this challenge? I would just accept the fact that my maps are going to be fugly. You're going to be creating dozens of maps so editing each of them to the point where they're not fugly is a trap option where you basically might as well make all the maps yourself because it doesn't take much less effort to "paint over" a generator map than it does to make a map from scratch.

Chests that yield random treasure are really, really easy to event. I've been using them extensively since '08: likewise, random enemies are easy to implement. Random placement is trickier--you'll need to check that where you're "spawning" the chests and monsters is open space, which will require some moderately complicated event code--but doable. Permadeath is the peanut butter to a roguelike's chocolate, but exceeds the scope of this thread.

Finally: the roguelike I have by far the most experience with is DCSS, where often floors (esp. entry floors) will be non-procedurally generated and just plain cool. So basically, you're going to want to brew up like 144 procedurally generated levels and then I'd include 12+ maps made the old fashioned way that actually look good, but also arrived at through the same RNG. Alternatively, use all of the "manually generated" maps for the first level. It's the one level every player is likely to see a lot.

* I'm talking about the default generator, not the plugin one, which I've had no experience
 

ImaginaryVillain

Obviously the "Hero" of Light!
Veteran
Joined
Jun 22, 2019
Messages
227
Reaction score
556
First Language
Event Gibberish
Primarily Uses
RMMV
I had forgotten about this topic. Up until quite recently I was running 400 blank maps for my project. Then using an unholy combination of 9 events, and 7 common events they were linked together. I then placed stuff after the map transfer, but before the fade in. The system worked very well, especially because I had each map number in an array, and whenever one would be used for a direction, it would be removed from potential results. The only flaw that I never bothered to fix was sometimes after 50+ maps it would loop in on itself.

Now I'm just running a single map, and generating it as the player is running around. I have a narrator who continuously sweeps the board to mess with the player. So it's not really necessary to maintain back maps. Plus as long as the map is set to scroll the player will likely never notice they've been running around just one map.

Anyway the biggest secret to how I pulled off linking random maps is that as long as an event is automatic, it will continue executing commands after a transfer. Though not very many, so you can actually flip a switch in the next room you end up at by listing it after the transfer command. Then I had exactly one event on every map (thanks Yanfly's Event Copier) that turned on the dungeon generator if it saw the switch was flipped. Then it turned the switch off. The other 8 events were just entrance and exit events placed by the dungeon generator. All of which recorded coordinates and the map the play was on when tripped (Yanfly's Self Variables really helped here). My Common Events were 5 that handled what type of room it was based on the available entrances, or if it was an intersection. An event to reset stuff if it broke. And the room builder that set the exits... After which it started the actual map generator stuff. But hey, that part's not really necessary to link maps together.

But I made all of that half a year ago, it's old and boring. Turns out you can just generate as you go and put events on blank pages when they're not close enough to the player. Before that I'd often cap out at around 200 events in a room, after doing that you could still get 50-60 fps with 800. Of course if you're just removing them then there is no cap. I suppose I could link the two concepts together... Hmm... If I don't erase a room, and instead cap it's generation at around 200-300 events and just link it to more maps... The sky is likely the limit. But I'll probably look into that for my next game. For this one it just plays out in a much cooler way as it now.
 

Canini

Veteran
Veteran
Joined
Mar 29, 2016
Messages
990
Reaction score
662
First Language
Swedish
Primarily Uses
RMVXA
If I were personally taking on this challenge? I would just accept the fact that my maps are going to be fugly. You're going to be creating dozens of maps so editing each of them to the point where they're not fugly is a trap option where you basically might as well make all the maps yourself because it doesn't take much less effort to "paint over" a generator map than it does to make a map from scratch.
I think you are right. I think it still would be worthwhile to explore the option of creating a short game with, say, ten randomly generated map. In fact, I am going to try it over the holidays. It will probably be terrible :D

Now I'm just running a single map, and generating it as the player is running around. I have a narrator who continuously sweeps the board to mess with the player. So it's not really necessary to maintain back maps. Plus as long as the map is set to scroll the player will likely never notice they've been running around just one map.
That sounds really advanced. Mind sharing how you managed to pull that off, or is it still a trade secret?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

In today's seminar:
Presenter: In the past, there was a saying, "One who has tuberculosis is doomed for life." But now-"
Everyone: *starts coughing in unision*
Gosh... Today seems too much like a good day to do nothing....

I need to keep myself focused...! :kaoback:
javascript'ing essentials.

So, what can I do solve this problem, guys? The plugin is MOG_Weather and I have several Yanfly plugins too.

Forum statistics

Threads
93,696
Messages
914,696
Members
123,292
Latest member
VinzBandicoot
Top