Dungeons¶
Random dungeon floors in DC2 are built at runtime from room layouts and 3D parts. Mods change them through five data tables and the floors' maps.
Quick steps¶
- Copy a dungeon data table into your mod folder:
This writes
mods/my-mod/data/floors.jsonand adds"floors": "data/floors.json"under"data"inmod.json. - Open
mods/my-mod/data/floors.jsonand keep only the floors you change. - Build the ISO with
dc2tk build.
Dungeon data tables¶
Dungeons are numbered from 0 (the Underground Channel) to 7.
| Table ID | Controls |
|---|---|
data:floors |
Each floor's monster spawns (monsters: up to 32 {"monster", "talk"} entries) |
data:medals |
Each floor's medal goals: fast_time (in 1/60 s), fishing_record, seal, spheda, spheda_prizes, and the practice medal |
data:chests |
Treasure chest contents: item groups (items by rank), and the groups each floor draws from |
data:layouts |
Room layouts: each layout's grid_size and rooms, written as rows of part names |
data:parts |
The 277 dungeon parts (name, kind, link) and each floor's minimap tiles |
See Game Data for how tables merge and what can be added.
Example: Floor monsters and time medal¶
Change the monsters and the time medal of the Underground Channel's first floor:
{
"floors": [
{
"dungeon": 0,
"floor": 1,
"monsters": [
{ "monster": 0, "talk": 0 },
{ "monster": 0, "talk": 1 },
{ "monster": 168, "talk": 2 }
]
}
]
}
The first goes in data/floors.json (data:floors), the second in data/medals.json (data:medals, a 2-minute goal). Monster 0 is the Sewer Rat and 168 the Golem; talk is the spawn's talk parameter (-1 for a monster you cannot talk to).
Example: Room layouts¶
In data:layouts, each room's cells is a list of rows of part names (. is an empty cell, and :N adds a cell attribute). Give a changed room's cells in full, or change only its rate:
A room numbered right after a layout's last room adds a new room (at most 64 per layout). Rooms cannot be deleted: set "rate": 0 to keep one out of random floors.
Edit 3D dungeon parts¶
A dungeon's parts are templates in its floor library map (d01f01 for the Underground Channel). Export it into your mod:
The scene lays out each part once, in rows. Edit their meshes, collision, and trigger points in Blender as on any map, and add "map:d01f01": "maps/d01f01/d01f01.gltf" under "replace". Keep each part inside its 320 × 320 cell (400 × 400 in d05, d06, and mstage4 to mstage6), with its open sides where its link says, because the floor generator joins parts edge to edge.
None of these dungeon edits has been tested in the game yet.
See DC2 Internals: Dungeon Floors for how the game builds a floor.