Saturday, September 16, 2017

Saturday Software: Monster Metrics v.103

Previously, we've looked at the output of my "Monster Metrics" program (a branch off the "Arena" codebase), which simulates thousands of fighters in combat against specified monsters, so as to gauge their physical power level in terms of Equivalent Hit Dice (EHD). Last Monday, I presented the OED Monster Database, including pretty much every monster in OD&D and the first few supplements, which served as a platform to comprehensively assess every monster's EHD. Of course, the program needs to get updated every time a monster with a new special ability is added, so here is the current codebase with a few comments.

First, I added a couple command-line options which you see below if you want to play around with them.


Usage: MonsterMetrics [monster] [options]
By default, measures all monsters in MonsterDatabase file.
Skips any monsters marked as having undefinable EHD (*)
If monster is named, measures that monster at increased fidelity.
Options include:
-a armor worn by opposing fighters: =l, c, or p (default Chain)
-b chance for magic weapon bonus per level (default =15)
-f number of fights per point in search space (default =100)
-r display only monsters with revised EHD from database
-u display any unknown special abilities in database




For each monster, the program runs through fighters of level 1 to 12 and does a binary search at each level for the number of such fighters which provide the closest to a fair fight (i.e., 50/50 chance of either side winning). Each step in the search runs 100 fights by default to determine the winning percentage (which you can adjust with the -f switch above for greater fidelity and slower running time, if you wish). Then a total EHD is assessed across all levels by computing the weighted total \(EHD = (\sum_{n = 1}^N n \cdot f(n))/N\), where \(f(n)\) is the fair number of fighters at level \(n\) in the table above, and \(N\) is the maximum level considered (in this case, \(N = 12\)). Note that this is likely different from "best fighter level to provide a fair fight", in that special abilities that can wipe out an army of of 1st-level fighters, but are impotent against high-level fighters, do get accounted here.

Every fighter in the simulated combat gets a sword, shield, and chain mail. One might ask, "Why chain mail by default, when most fighters after 1st level will be wearing plate?". But the thing is, I wanted the EHD ratings to actually be scaled to units of monster hit dice, e.g., the number of orcs that a monster is really worth, and those low-monster like humanoids all have chain-like armor (goblins/orcs AC 6, gnolls/ogres AC 5, trolls/giants AC 4), so we want to keep the simulation in that scale without adjusting other factors. Doing it this way, the EHD for those low-level types (lacking any special abilities) does in fact match their normal HD (orcs 1, gnolls 2, bugbears 3, ogres 4, etc.). If we switched the default fighter armor to plate, then that would devalue the monster risk, and even the simple monsters would see their EHD fail to synch up with their HD (in that case: gnolls 1, bugbears 2, ogres 3, etc.).

The next important consideration is: what level of magic weapon to give each fighter? Previously, I just assumed a +1 magic sword for every fighter, so as to not make creatures hit by magic totally invulnerable. But we will really don't want fixed bonuses like that (or fixed bonuses by level), because it creates singularity dropoffs between level or steps of bonus (e.g., makes the protection of lycanthropes and gargoyles totally useless, even to 1st-level fighters). So in this version I switched that to a probabilistic factor of 15% per level to get an extra magic boost, and also a silver dagger as a backup weapon. Having tried several levels between 5% (as seen in Vol-2) and 25% (as suggested by some comments online), I found that 15% overall gave the best match to the prior version, while giving a reasonable boost to lycanthropes, etc. And that's also what I do in my OED house rules, giving a 1-in-6 chance per level for a magic boost to characters created at higher levels.

Now, that leaves another problem, namely that any monster hit only by +2 magic or better weapons (e.g., golems or elementals in Sup-I) is totally invulnerable to 1st-level fighters, who can theoretically only have at best a +1 bonus. This means that the number of 1st-level fighters, and thus our EHD clculation, becomes technically infinite. That is: in these cases our model simply fails.

It's for reasons like this that the OED Monster Database shows an asterisk (*) under EHD for some very exotic monsters, to note that the EHD is effectively undefined in our current model. More generally, this is done for any creatures with wizard-like spell capability that isn't implemented in the program (triton, titan, lich, lammasu, gold dragon, beholder), creatures hit only by +2 or better magic weapons (golems, elementals), and creatures totally immune to blows from weapons (various oozes).

So that's the skinny on what the program is now doing under the hood, and why the Monster Database appears the way it does. Note that the included data file MonsterDatabase.csv is an exact duplicate of the Monster Database from Monday (just in CSV format so it can be read in by the software). Hopefully this makes it easy to investigate or add other monster in the future when we need them.



6 comments:

  1. Time to call the cavalry!

    Seriously, the most important tactical option missing for the 1st level fighters is the ability to call for help. Maybe you should implement a morale check for anyone who loses more than half their starting hp. If they lose morale, some fraction will call for help. Who answers? I suggest a uniform probability so that low level fighters can call in higher level types but the higher level types are more likely to end up with minions who die alongside them.

    Anyway, I think this kind of thing will solve your problem of 1st level fighters needing +2 weapons sometimes, and you can possibly apply it to some monsters too, since it's an important power too.

    ReplyDelete
    Replies
    1. Hmm, I'll have to think about that. I'm not sure that it simulates the case of lunatic PCs in the dungeon greedy to keep all the gold for themselves.

      Delete
  2. One simple solution you could use for weapon-immune monsters like oozes is to randomize the fighter's type of weapon. I'm not sure if this was the case in AD&D and before, but since 3.0 there has always been a set of one handed weapons dealing 1d8 damage in various combinations of piercing, slashing, and/or bludgeoning for fighters to choose from, all costing about the same and with minor variations in secondary statistics. The end result is that the type of damage dealt by the fighter is down to player preference, which is essentially random. Perhaps you'd want to weight things towards swords at higher levels, since the books tend to, but a random draw at "character creation" seems sensible and would let you rate a few more monsters.

    (On second thought, multiplying things out so that the proportions are fixed is probably a better idea, otherwise you might accidentally have a squad of 14 swordsman and one mace-wielder going up against a skeleton!)

    ReplyDelete
    Replies
    1. I know what you're thinking, but in OD&D that wouldn't make any difference; there isn't any clear distinction in melee damage types in the rules. E.g., green slime is totally immune to all "striking by weapons"; skeletons are not specially vulnerable to blunt weapons (or vice-versa).

      Delete