D&D 5E A (Partial) Computational Deconstruction of Original Tegel Manor - *** spoilers ***

CodeFlayer

Explorer
Respectful Greetings

Here is an example of a language and for roll-able tables I have devised, for the first level of the dungeon below the most estimable Tegel Manor. Over a series of posts, I hope to use this language to examine it's design and calibration using computation methods. The over-arching goal is a tool for encounter balance for game masters shared in some form of "open source". While the encounters here examined are from Tegel Manor, the algorithms from 5e will be used (hence the label) under the hypothesis that a monster equivalency exists between original and 5e.

** spoilers **

Code:
PropertyTable rat_type {
    :5: (giant, .cr. 1/8),
    :1: (giant, .cr. 1/4),
    :1: (giant, .cr. 1/2),
    :1: (giant, .cr. 1)
}

ItemTable lvl_1 {
    1#8  ! rat(room A, @rat_type),
    2#6  ! rat(room B, @rat_type),
    1#6  ! rat(room D, @rat_type),
    1#10 ! rat(room F, @rat_type),
    [ 3#6  ! rat(room G, @rat_type), magic_item(buried, room G) ]
    1#6  ! rat(room H, @rat_type),
    1#3  ! rat(room K, @rat_type),
    1#4  ! mongoose(room I, giant, .cr. 1),
    [ 60% 1 wererat(room J, .cr. 2), chest(invisible, contents unknown)]
}

ItemTable lvl_1_factions {
    [
        60% 1 lesser rat king(room C, giant, .cr. 2),
        1#3*10 ! rat(room C, @rat_type),
        gems_or_jewelry
    ],
    [
        70% 1 greater rat king(room E, giant, .cr. 3),
        6#6 ! rat(room E, @rat_type),
        gems_or_jewelry,
        magic sword(hidden, .cost. 4000)
    ]
}

I hope to expound further in subsequent posts on tools, methods, and results for this and other tables.

--CodeFlayer

edit - specified Original TM, updated room G
 
Last edited:

log in or register to remove this ad



Agreed - is this a wandering-monster generation program specific to Tegal Manor, or a complete random dungeon generator but based on TM, or something else?
 

Let us look at the output from a simple test table that always generates 4 mobs

Code:
ItemTable t1 { 4 rat(giant, .cr. 1/4) }

and whose output from "mt.py" is

Code:
$ python mt01.py TegelManor_dungeon.tables.txt roll t1 1
loading: TegelManor_dungeon.tables.txt
cmd: roll
--- t1 1
4 rat, giant, cr = 1/4
mob count: 4
base exp: 200
battle exp: 400.0
[4.0, 0.0, 0.0, 0.0, 0.0]

Now here is example t2

Code:
ItemTable t2 { 2#4 rat(giant, .cr. 1/4) }

which generates 2d4 giant rats that may be evaluated thusly

Code:
$ python mt01.py TegelManor_dungeon.tables.txt roll t2 10000 | grep 'battle exp' | awk -f stats.awk
...
497.835000 165.544746

which gives us the average battle exp over 10,000 rolls (which is base exp times force count multiplier from DMG 5e) and the standard deviation which may be considered against "XP Thresholds by Character Level" on pg 82 and wrt to a standard party of 4 1st levels would be deadly.

Next, a variant of the DMGs algorithm and Xanathar's most interesting ratio'ed approach.

edit: clarity, typo
 
Last edited:

Sorry, I'm still not quite sure what you're trying to accomplish with this code.

Now it sounds like you're trying to write a D&D combat simulator.
 

I appreciate the honest feedback Lanefan - I'll start a new thread with a cleaner and more concise example. I thought I would lead with TM because it is the first campaign I ran but I'm trying to explain too much at once. Thanks!
 

One last note on the narrow topic of TM giant rat CR equivalency(conversion) to 5e.

As written in the TM booklet, these vary from 1 to 4 HD, but the smaller (1 HD) are harder to hit than the larger ones in terms of AC. Thus, using the more nuanced approach to monster balance in the 5e DMG of defense and offensive CRs, all should have the same effective CR of around 1/8 - or even 0. By creating a trade off between HD and size the game designer has added a meaningful choice for the players to make for low level players.

Ultimately I'd curious to know what the design goal of this dungeon was (I suspect strongly convention play for 6+ players of 1st to 2nd lvl).

Thanks for reading. Perhaps a Meta-combat simulator is possible (<evil laughter> ; ).

--CodeFlayer
 

Sorry, I'm still not quite sure what you're trying to accomplish with this code.

Now it sounds like you're trying to write a D&D combat simulator.
I think it's an encounter generator for Tegal Manor.

That said, I'm unfamiliar with Python (I'm assuming this is Python) so I could be mistaken, but that's what it looks like to me.

@CodeFlayer you might want to break it down a bit more in layman's terms for those who either don't code or (like myself) aren't familiar with the language you're using.
 

Yes, thank you for the feedback. Here is the (recast) level one dungeon main encounter table with room origin annotations. The CRs have been adjusted and the confusing property table removed.

Code:
ItemTable lvl_1_moat {
    1#8  giant rat(room A, .cr. 1/8),
    2#6  giant rat(room B, .cr. 1/8),
    1#6  giant rat(room D, .cr. 1/8),
    1#10 giant rat(room F, .cr. 1/8),
    3#6  giant rat(room G, .cr. 1/8),
    1#6  giant rat(room H, .cr. 1/8),
    1#3  giant rat(room K, .cr. 1/8),
    1#4  giant mongoose(room I, giant, .cr. 1/2)
}

This table is input for the python program mt01.py (named for monsters and treasure), which in turn allows commands to be executed on the loaded tables.

python mt01.py TegelManor_dungeon.tables.txt list loading: TegelManor_dungeon.tables.txt cmd: list NamedItemTable: lvl_1_keep NamedItemTable: lvl_1_moat
Here "moat" and "keep" are used to describe the role the rooms perform, and are not literal.

The "moat" table are those encounters that are easiest to get to and one or more of these would need to be defeated for the party to move on to the "keep" table (not shown). The keep table are those encounters that comprise the core of the level's treasures and secrets.

Here is one roll on the lvl_1_moat table with the exp/difficulty calculations omitted for the time being.

python mt01.py TegelManor_dungeon.tables.txt roll lvl_1_moat 1 loading: TegelManor_dungeon.tables.txt cmd: roll --- lvl_1_moat 1 12 giant rat, room B, cr = 1/8 mob count: 12

Thanks for reading.

edit: typos
 
Last edited:

Remove ads

Top