跳到主要内容

Dungeon Generator

Dungeon Generator

A recipe for a generated dungeon: which pools the rooms come from, how many there are, how far the boss is and how hard the search tries. A dungeon instance that names a generator is built from it at every run; the same seed gives the same dungeon as long as the generator and the templates are unchanged.

字段

字段类型默认值描述
startPoolRef<DungeonRoomPoolEntry>—The pool of the room the run begins in. It holds START templates.
bossPoolRef<DungeonRoomPoolEntry>—The pool of the final room. It holds BOSS templates.
corridorPoolRef<DungeonRoomPoolEntry>—The pool of the passages inserted between two rooms that cannot touch directly. Empty: rooms only ever touch directly.
normalPoolsList<WeightedRoomPool>emptyThe pools of the other rooms (NORMAL, TREASURE, SECRET), each with its own weight.
WeightedRoomPool(2)
字段类型默认值描述
poolRef<DungeonRoomPoolEntry>—The pool.
weightInt1Relative weight of the pool: the weight of a template there is its weight in the pool times this one.
minRoomsInt6At least this many rooms in total, the start and the boss included, corridors excluded.
maxRoomsInt10At most this many rooms in total, the start and the boss included, corridors excluded.
quotasList<RoomQuota>emptyBounds on the number of NORMAL, TREASURE and SECRET rooms. A category left out is unlimited.
RoomQuota(3)
字段类型默认值描述
categoryQuotaCategoryTREASUREThe category of rooms the bound applies to. A category without a bound is unlimited.可选值:NORMALTREASURESECRET
minInt0At least this many rooms of the category.
maxInt1At most this many rooms of the category.
minBossDepthInt3The boss is at least this many steps away from the start (corridors are not counted).
branchRatePercentIntDEFAULT_BRANCH_RATE_PERCENTChance, in percent, that a room beyond the main path opens a side branch instead of extending the path.
trialBudgetIntDEFAULT_TRIAL_BUDGETHow many placements the search tries for one layout before it plans the dungeon again. Trial budget times (replans + 1) must stay within the total the generator allows.
replansIntDEFAULT_REPLANSHow many times the dungeon is planned again from a derived seed before the generation fails.
affixesList<Ref<DungeonAffixEntry>>emptyThe affixes that may be drawn for a run, by their weight. An affix listed twice counts once.
affixCountInt0How many affixes are drawn for a run (without repeating one). 0 draws none; more than the affixes with a weight draws all of them. The draw follows the seed of the run but never changes the layout of the dungeon.
difficultyInt1The base difficulty level of the dungeon, handed to the triggers of the rooms through the run context.
pasterRoomPasterKindSTRUCTUREHow the rooms are put into the world. STRUCTURE uses the Paper structure API, with no other plugin needed.
messagesGeneratorMessages—The texts reported to the author when the pools and templates cannot make a dungeon.
GeneratorMessages(15)
字段类型默认值描述
missingEntryString{field} points to an entry that does not exist: {detail}A reference of the generator points to an entry that does not exist. {field} is the field, {detail} the id.
emptyReferenceString{field} is not setA field of the generator that must name an entry is empty. {field} is the field.
noCaptureStringRoom template {template} has no captured structure yetThe room template has no saved capture yet. {template} is the template.
unreadableCaptureStringThe capture of room template {template} cannot be read: {detail}The saved capture of the room template cannot be read. {template} is the template, {detail} the reason.
invalidTemplateStringRoom template {template} is not valid: {detail}The room template is not valid (a door off its wall, a marker outside the box...). {template} is the template, {detail} the reason.
badConnectorTypeStringRoom template {template}: door {detail} has no valid connector typeA door of a template has no connector type, or its type does not exist. {template} is the template, {detail} the door number.
invalidParametersStringThe generator settings are not valid: {detail}A number of the generator is out of its range. {detail} is the reason.
duplicateQuotaStringThe quotas bound {detail} more than onceThe same category is bounded twice in the quotas. {detail} is the category.
invalidEntryString{pool} is not valid: {detail}A weight or a size of an entry is out of its range. {pool} is the pool, the type or the affix, {detail} the reason.
emptySealBlockStringConnector type {type} has no seal blockA connector type has no seal block, so a door of that kind could not be closed. {type} is the connector type.
invalidSealBlockStringConnector type {type} has a seal block the server cannot read: {detail}The seal block of a connector type is not a block the server can read. {type} is the connector type, {detail} the text of the seal block.
noDungeonStringNo dungeon could be generated: {detail}The generator could not make a dungeon from the pools and templates it was given. {detail} is the reason the generator gives.
noStartSpawnStringStart room template {template} has no SPAWN markerThe start room has no SPAWN marker, so nobody could be placed when the run begins. {template} is the start template.
tooTallStringThe dungeon does not fit in the height of the world: {detail}The dungeon does not fit between the lowest and the highest block of the world. {detail} gives the heights.
replayRefusedStringThe dungeon cannot be rebuilt from its seed: {detail}A stored dungeon can no longer be rebuilt from its seed. {detail} is the reason the generator gives.
baseYIntDEFAULT_BASE_YThe height (y) of the floor of the start room in the world of the run. Every other room is placed relative to it; the whole dungeon must fit between the lowest and the highest block of the world.
roomsPerTickIntDEFAULT_ROOMS_PER_TICKHow many rooms are pasted per server tick while a run is being prepared. A lower number keeps the ticks short (the run takes longer to be ready), a higher one is faster but holds a tick longer.
naturalSpawningBooleanfalseWhether monsters and animals spawn by themselves in the world of the run. Off by default: the monsters of a generated dungeon come from its triggers, not from the dark.
verticalMarginDoubleVERTICAL_MARGINBlocks added above the ceiling and below the floor of every room: a player counts as inside a room from its floor - margin to its ceiling + margin. It keeps a jump, a vehicle or a flat room from entering and leaving at every step (the same idea as the vertical margin of a dungeon room). 0 = exactly the box of the room.
pasteTimeoutSecondsIntDEFAULT_TIMEOUT_SECONDSHow long, in seconds, a launch waits for the rooms to be pasted before it gives up: the run is cancelled, the players stay where they were, the entry cost is refunded and the world is thrown away. Raise it for a big dungeon pasted a few rooms per tick on a busy server.

How to use it​

See Generated dungeons for the steps. Defaults behind the names in the table: branchRatePercent 40, trialBudget 20000, replans 5, baseY 64, roomsPerTick 4, pasteTimeoutSeconds 120, verticalMargin 1.0. minRooms and maxRooms must stay between 2 and 256, and trialBudget times (replans + 1) within 5 000 000.