Lairs, graphs and music
More work on procedural-but-configurable lairs this week, it's looking better now. Some example lairs in the pictures below.
Lair work
For testing, I've added some simple prefabs for a few areas. These areas have fixed or procedural layout, plus some "dynamic entity instantiators" assigned to some tiles (based on rules), which is a fancy way of saying they can be configured at runtime. For all the areas below, I specify dynamic instantiators for a "boss group" and "treasure".
- Dragon's lair: it's a procedurally generated cavern, where the "boss group" is a single boss creature from dragon classification. Treasure is on ground (not chest), a few instances of it.
- Beast cave: it's a procedurally generated cavern, where the "boss group" is a single boss creature from a classification of "beast", "abberation" or a few others. Treasure is on ground (not chest).
- Lich's lair: it's a fixed room, where the "boss group" is an "undead" encounter group with a leader boss and maybe some other monsters, elite or not. Treasure is in chests, explicitly placed.
- Emperor's tomb: it's another fixed room, where the "boss group" is again an "undead" encounter group with a leader boss and maybe some other monsters, elite or not. Treasure is in chests, explicitly placed.
So it's possible to have fixed or procedural areas and fill them with semi-custom creatures. I'm at my wits end regarding configurability. And I've yet to deal with things like "add journal notes on that table" or "add a special quest item on the boss monster", that's going to be a fun challenge.
For the boss encounters, the rooms exclude other procedurally generated traps or creatures, although that's configurable too.
Also, the existing "monster role" system was a big help here, for forming boss encounters -- see image in next paragraph.
Graphviz twopi creatures and encounters
My creature list is a big json file, where each entry specified the encounter groups that it's in, etc. This sounds like a graph, and if it's a graph, it can be visualized with ... graphviz! I wrote a script to arrange the encounter groups in a graph, also listing standalone creatures (not belonging to any group). Below is an example using twopi.
Zone-based music changes
I've added a nice and simple audio thing: when, in a level, you walk into a new zone (e.g. from outside in the cavern, or from inside the cavern to a special lair zone), the music fades into a new music track, so that the ambience is updated to reflect where you are. This kicks in after a bit of delay, so that you can't go back and forth very fast and make an audio mess. Here's a video demonstrating this