[SB] StormBeard - Random Dungeon Generator

Stormbeard

Berserker
Member
Joined
May 25, 2017
Messages
2
Reaction score
10
First Language
English
Primarily Uses
RMMV
Stormbeard's Random Dungeon Generator v0.01

Intro:
-----------------------------


This is a plugin that will randomly generate a dungeon map and provide ways to
control things like how many levels, bosses, treasure, and troops.

The flow of the map will be the player is ported into a random location and
then must defeat a boss monster in order to open a portal that will spawn
elsewhere in the dungeon where the player will either progress deeper into the
dungeon or be ported to a user specified map.








Dependencies:
-----------------------------


This plugin also has dependencies on Yanfly's Event Chase Player plugin and it
must be included in the project.

http://yanfly.moe/2015/10/21/yep-20-event-chase-player/



Default Settings:
-----------------------------


The default settings will control how the dungeon is built and populated


Current Depth - Starting level of the dungeon to port to [usually 1]

Max Depth - How many total levels is the dungeon before porting to specified map

Switch Gate - A dedicated global switch # the plugin needs for gate management

Switch Boss - A dedicated global switch # the plugin needs for boss management

Dungeon Width - Tile width of the dungeon

Dungeon Height - Tile height of the dungeon

Dungeon Fullness - Ratio to control amount of walkable space

Room Size - Ratio to control the size of rooms

Random Encounters - Controls on map or random encounter for monsters

Monster Density - For random this is number of steps, for on map it roughly how many square tiles per monster

Chest Density - How many square tiles per chest

Tileset ID - The ID of what tileset you've configure for the plugin

BGM - Background music name



Calling a Dungeon
-----------------------------


Using the Plugin Command event you can enter a string like below to call a dungeon::

procgen mapgen dungeonname:dungeon1 outx:4 outy:6 outid:4

Breaking down the pieces of the command it looks like:

procgen - Name of the plugin, required [this never changes]

mapgen - Type of dungeon generation [currently only mapgen supported, more coming soon], required

dungeonname:XXX - Name of the dungeon, this allows you to have multiple different dungeons, required

outX:X outY:X outid:X - The output coordinates and mapID to send the player at the completion of the dungeon, required


This is a list of optional parameter mappings you can use to override the global defaults from the plugin manager to help customize every dungeon the way you want it:


Plugin Command - Default Setting

start:X - Current Depth

max:X - Max Depth

gateswitch:X - Switch Gate

bossswitch:X - Switch Boss

w:X - Dungeon Width

h:X - Dungeon Height

fullness:X - Dungeon Fullness

roomsize:X - Room Size

userandom:X - Random Encounters

encounterrate:X - Monster Density

chestrate:X - Chest Density

tilseset:X - Tileset ID

bgm:X - BGM



So other examples:

A dungeon 100 tiles in height with more chests and defaults:
procgen mapgen dungeonname:dungeon1 outx:4 outy:6 outid:4 h:100 chestrate:500

A dungeon with less walkable space and defaults:
procgen mapgen dungeonname:dungeon1 outx:4 outy:6 outid:4 fullness:.4


A dungeon 3 levels deep using tileset 8 and defaults:
procgen mapgen dungeonname:dungeon1 outx:4 outy:6 outid:4 max:3 tileset:8



Adding Bosses and Monsters:
------------------------------------


To control what encounters a player will receive on a level you must pick a troop and give it a custom name like the following:

procgen:dungeon1:troop:1:3:Monster:2:1:0:Bat*2

The command is broken down as follows:

procgen - never changes and should always be there

dungeon1 - You would replace this with your dungeonname param from the Plugin Command

troop - there are 2 values here, "troop" or "boss", troops are roaming monsters while boss will be a level boss for a floor

1:3 - this is the start level and end level of the dungeon a troop/boss is eligible for, ex if this was a 5 floor dungeon this troop would not appear on floors 4 or 5, if the value was 1:1 it would not appear on floors 2, 3, 4, or 5

Monster - This is the name of the character's sheet for the on map sprite

2:1:0 - direction, pattern, and character index of an on map monster - this controls which sprite of the sheet to use, I will explain this below [Coming Soon]

Bat*2 - A name you choose to identify the troop, nothing to do with the plugin



Some examples you can use to get started:

procgen:dungeon1:troop:1:2:Monster:2:1:0:troop1 [Will show a bat on map]

procgen:dungeon1:troop:1:3:Monster:2:1:1:troop2 [Will show a slime on map]

procgen:dungeon1:boss:1:2:$BigMonster1:6:1:0:boss1 [Will use a big monster at the boss]

procgen:dungeon1:boss:3:3:$BigMonster1:2:1:0:boss2 [Will use a different big monster as the boss]

The above assumes you have the default resources in your game, if you apply this to 4 troops the experience would be in a 3 floor dungeon you would fight a mix of bat and slimes on floors 1 and 2 and fight boss 1 on both floors 1 and 2 on floor 3 you would only fight slime on the map and fight boss 2 at the end.

One important note is that if you do not use on map monster's these value for troops are irrelevant and you can set anything you would like there, but for bosses is still important as they always appear on map.






Adding Treasure:
-----------------------------


In the notes section of any item, armor, or weapon you can add a tag like the following to add it to the dungeon:

<procgen 1:3:dungeon1 >

A breakdown of the tag is:

<procgen - always needed

1:3:dungeon1 - the start floor and end floor where the item can appear, and the dungeonname from the Plugin Command the item is tied to

> - always needed


So ex putting the above on a potion in a 5 floor dungeon the potion would have a chance to appear on floors 1, 2, 3 but not on floors 4 or 5.

Currently to distribute treasure the plugin will look at how many possible chest for the map level, then look at what items are available on the current floor. Each notetag is only good for 1 occurrence of an item on any given floor, so ex if you put:

<procgen 1:3:dungeon1 >
<procgen 1:1:dungeon1 >
<procgen 1:1:dungeon1 >

All on the potion item, it would mean that in a dungeon you could possibly collect up to 3 potions on floor 1, and possibly collect one potion each on both floors 2 and 3.

if you just had:

<procgen 1:3:dungeon1 >

and the player collects a potion on floor 1, there is still a possibility that the player will collect another potion on both floor's 2 and 3, meaning that each notetag does not map to being just 1 item received.


One other item to note is that currently the plugin will also add 1 gold chest to the pool of available treasure for each map level. It calculates the average gold value of all possible items that could be received on that level to determine value. So ex if you have 3 items note tagged for a level the gold chest will function as a 4th available item, so if you want to ensure a player gets all available items on any given level make sure you change you chest density for 1 more chest than you notetags. The other part of this to note is that if you put something like only 1 very expensive item on a level that there will be a corresponding large chest of gold as the only item available to average off of is that very expensive item. The gold chest system is something that is actively being worked on and any recommendations are welcome.



Tilesets:
-----------------------------


In the script link below there are also 3 example tilesets based off the games default tilesets for reference on how to make your own.

Insert the tileset you want to try into your img/tilesets folder then in the DB setup add a new tileset and add one of the included tilesets as A1, A2, A4, and B (one tileset for all those options)

In the tileset passability options you will want to set all passability to "X" other than the pathway tiles and the 2 ground cover sprites in each set, here is an example from the winter set:


The positioning will be the same for each tileset if there is any confusion about what counts as ground cover and pathways.

If anyone makes any new tilesets they want to share back let me know and I will add them to the project. [Not a great tileset combo guy here, so apologies in advance]

*When I get the Demo up I recommend looking there for any help you need here


Script Link:
---------------------------


https://gitlab.com/sb-rpgmv-plugins/randomdungeon

Demo Link:
--------------------------


(Coming Soon)

Usage:
--------------------------

You have my permission to use this in any and all projects assuming you adhere to the following:

1 - Credit Stormbeard in your project
2 - Contact me to let me know that it was used and where the project is available


Coming Soon/Next:
-----------------------------


*Generating the map ina more cavelike way vs corridors and rooms
*Refining the gold chest system
*Code Cleanup
*Simplifying inputs for troops
*Refining the item placement/generation system
*Requests from comments
 
Last edited:

Allerka

Veteran
Veteran
Joined
Dec 31, 2012
Messages
289
Reaction score
71
First Language
English
Primarily Uses
Well, it looks awesome! I look forward to seeing further updates. I hope it'll be possible to use more extensive tilesets in future versions.
 

Nza3

Villager
Member
Joined
Jul 27, 2017
Messages
29
Reaction score
1
First Language
english
Primarily Uses
RMMV
This looks so great! Thanks for making a dungeon generation script! Been hoping for one of these for awile now!

Are there plans to maybe add randomized loot from the database? Ex. Using notetags in our loot to give them a percent chance to spawn as rewards in the dungeon.

This could also be done in tandem with Yanfly's conditional drops plugin, (ExtraEnemyDrops) if the plugin (which it looks like it does) just uses the same valid notetags already applied to the enemies.


Though I understand, procgen:dungeon1:troop:1:2:Monster:2:1:0:troop1 spawns a bat, but how do we control the amount of bats spawned in the dungeon?

What if we want a random dungeon generated using your procgen script, but we want to a random amount of Bat, Slime, and Minotaur enemies to spawn between 2-3 for the amount each enemy in the dungeon. Is this possible?

Thanks!
 

peq42_

Yeet
Veteran
Joined
Feb 5, 2016
Messages
480
Reaction score
285
First Language
Portuguese(BR)
Primarily Uses
RMMV
sorry for reviving the topic, but the plugin doesn't seem to be working anymore...
Sem título.png
i did everything correctly, and checked a few times...
 

SarcasticSloth

Villager
Member
Joined
Jul 11, 2018
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
I had the same problem as elpeleq42, not sure what I am doing wrong.
 

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
388
Reaction score
176
First Language
English
Primarily Uses
RMMV
As much as I would like to use this, there are some concerns about how this works.
1. Can you have a floor without a boss & an exit stairway already ready to be entered when found?
2. The game I'm making doesn't use the default battle system. I plan on using an ABS, either by plugin or through events. Would this be a problem for referencing troops?
3. I plan on letting the player backtrack up the dungeon & want those map layouts to remain the same. Does this generator allow that?
4. Some of the instructions aren't that clear. Do you at least plan on supporting this? Because you haven't posted in this topic in over a year which leads me to believe that you abandoned it the same way Sanshiro abandoned his Random Dungeon Generator.
 

Czlapman

Villager
Member
Joined
May 16, 2020
Messages
7
Reaction score
0
First Language
Polish
Primarily Uses
RMMV
Does it works with Chrono Engine abs mode? Last post post was 2 years ago and i hope for any reply. If not any one can recommend any random generator map that works with abs?
 

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

Latest Threads

Latest Profile Posts

Hi, there.
I'm Creta Park, as Software engineer and Indie game developer.

Profile : creft.me/cretapark
GitHub : github.com/creta5164
Blog : creta5164.tumblr.com


My stuff

Who shares/sells their scripts/plugins on itch.io? Can I pick your brain?
If you ever need fantasy names and you're bored, make a fictional alphabet. Switch around the letters and see what you get :p
I JUST GOT PROMOTED TO 9TH GRADE BOIS!

Forum statistics

Threads
98,168
Messages
949,915
Members
129,453
Latest member
tanzx
Top