Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Monday, October 8, 2012

Monster HP Tracking

At the table I've been using d6's to track monster hit points (roll bunch, group them into "creatures" 1 die per HD, then remove or "rotate" dice as damage is inflicted).  I'm not satisfied.  I want to use d6+2 per HD. Needs space, and prone to accidents (jostling dice, using them for some other roll).  A bit too fiddly / time consuming.

I remember seeing a pdf of d6 rolls (I think from ChogWiz).  I decided to create a little hitdice program to create similar ReStructedText chart. The use one of my favorite tools, rst2pdf, to create the following PDF which I'll print out and test in next Sunday's Gold and Glory game.



Friday, September 7, 2012

For my upcoming Gold and Glory campaign I was considering using d24 and d30 for some attack rolls.  For some weapons like black powder pistols, rayguns, and hvy crossbows. And I've been using roll two d20's and take the lower / higher roll in place of various +4 bonuses (like vs invisible or vs unawares).

I was curious what comparative odds where.  So, I wrote a litte test program using my Die Python dice library.

      2d20(worst)    2d20(best)     d20+2          d20+4          d24            d30
 1 -> 9.75%   9.75%  0.24%   0.24%  0.00%   0.00%  0.00%   0.00%  4.19%   4.19%  3.36%   3.36%
 2 -> 9.28%  19.03%  0.76%   1.00%  0.00%   0.00%  0.00%   0.00%  4.20%   8.38%  3.34%   6.69%
 3 -> 8.69%  27.72%  1.25%   2.26%  4.98%   4.98%  0.00%   0.00%  4.16%  12.54%  3.38%  10.07%
 4 -> 8.25%  35.97%  1.75%   4.01%  4.97%   9.96%  0.00%   0.00%  4.17%  16.71%  3.33%  13.40%
 5 -> 7.77%  43.74%  2.25%   6.25%  5.03%  14.98%  5.02%   5.02%  4.15%  20.86%  3.29%  16.69%
 6 -> 7.22%  50.95%  2.76%   9.02%  5.00%  19.99%  5.01%  10.03%  4.14%  25.00%  3.32%  20.01%
 7 -> 6.76%  57.71%a 3.25%  12.27%  5.01%  25.00%  5.00%  15.03%  4.17%  29.17%  3.34%  23.35%
 8 -> 6.27%  63.98%  3.77%  16.03%  5.03%  30.03%  4.98%  20.01%  4.19%  33.36%  3.34%  26.70%
 9 -> 5.74%  69.72%  4.25%  20.28%  5.02%  35.05%  4.97%  24.97%  4.18%  37.54%  3.35%  30.04%
10 -> 5.25%  74.97%  4.73%  25.01%  4.98%  40.03%  4.99%  29.96%  4.18%  41.71%  3.34%  33.39%
11 -> 4.74%  79.71%  5.26%  30.27%  4.96%  44.99%  5.00%  34.96%  4.14%  45.85%  3.33%  36.71%
12 -> 4.26%  83.97%  5.74%  36.00%  4.99%  49.99%a 4.97%  39.93%  4.15%  50.00%a 3.33%  40.04%
13 -> 3.76%  87.73%  6.23%  42.23%a 4.96%  54.95%  4.98%  44.91%  4.17%  54.18%  3.34%  43.39%
14 -> 3.27%  91.00%  6.76%  48.99%  5.03%  59.99%  5.05%  49.96%a 4.16%  58.34%  3.34%  46.73%
15 -> 2.75%  93.76%  7.31%  56.30%  4.97%  64.96%  4.99%  54.94%  4.17%  62.51%  3.30%  50.03%a
16 -> 2.25%  96.00%  7.71%  64.01%  5.00%  69.95%  5.02%  59.96%  4.18%  66.70%  3.34%  53.37%
17 -> 1.77%  97.77%  8.27%  72.27%  5.03%  74.98%  5.02%  64.98%  4.18%  70.88%  3.36%  56.74%
18 -> 1.24%  99.01%  8.72%  80.99%  5.04%  80.02%  5.02%  70.00%  4.16%  75.04%  3.34%  60.07%
19 -> 0.74%  99.75%  9.21%  90.20%  5.00%  85.02%  5.00%  75.00%  4.15%  79.19%  3.34%  63.41%
20 -> 0.25% 100.00%  9.80% 100.00% 14.98% 100.00% 25.00% 100.00% 20.81% 100.00% 36.59% 100.00%

Percentages are off a few 100ths cause results were rolled (1,000,000 times each) rather than calculated.  It ends at 20 cause any natural roll >= 20 is a critical. The d20+2 and d20+4 only crit on 20, 5%, but was interesting to compare the 20 or above's.  If not obvious d20 has 5% chance for any roll. Assuming GameScience ;)

I'm no longer so sure I like 2d20(best/worst) as general mechanic. Kind of extreme, less than 7 (or more than 14) 50% of the time.  All the other rolls are strictly linear and 50% is in the middle of range.  Linear curve (except stats) is one of the things that make D&D, D&D.

Tuesday, September 4, 2012

Dungeon Plane

Long ago, in my 3.5 campaign, the party found itself on the "Dungeon Plane".  All I knew about that plane at the time was; it was "old school" (so only spells and powers/feats from base (DMG, PHB) books worked) and it needed to be randomly generated endless "mega dungeon".  Wanting to avoid distraction of rolling up during game but wanting the dungeon to be unknown even to me I wrote this little DMG Appx A Dungeon Generator program to automate things.

Here's what it looks like running.  It's text mode prompting "Adventure awaits:" which I either respond with to generate another "roll" on charts or respond with various commands that roll on specific sub-tables.
Random Dungeon Delve.
Based off of 1st edition AD&D Dungeon Master's Guide. A tool for DM's to use while generating random dungeons.

? for help.
 to explore!

Adventure awaits: 
Pit 10' deep with crushing sides. Check again after 30'.

Adventure awaits: onward
Straight ahead. Check again after 60'.

Adventure awaits: onward
Straight ahead. Check again after 60'.

Adventure awaits: onward
20'x20' chamber with a chance of (1-5 secret door, 6-10 one-way door, 11-20 nothing) per 10' abutting previously explored areas. 
  It contains: Oh no a monster! 250 gold/level in bags secret compartment. 750 electrum/level in sacks with gas strength +1d6 str. 
Check again after leaving for 30'.

Adventure awaits: opendoor
5' wide passage straight ahead.

Adventure awaits: trick_or_trap
20'x20' elevator room descends 2-5 levels plus 1 level per unsuccessful door opening attempt and will not ascend for 60 turns.

Adventure awaits: 
Dead end. Chance of a (1-5 secret door, 6-10 one-way door, 11-20 nothing) per 10' abutting previously explored areas.

Adventure awaits: 
Passage turns left 90 deg. Check again after 30'.

Adventure awaits: onward
Trap door down 1 level to a Door right leading to a 10' wide passage straight ahead. Check again after 30'. 
Passage continues check again after 30'.

Adventure awaits: chamber
40'x40' chamber with 1 exit: 
  In opposite wall a door. 
  It contains a Oh no a monster!

Adventure awaits: flee
Till next time...

Tuesday, August 28, 2012

Deathguards of K'jore

Long ago I ran a 3.5 campaign and needed "chaos paladins" for the bad guys, K'jore. Without any more explanation than that here's example output of the deathguard generator program I wrote:

Level 7 K'jore Deathguard Fighter (medium abberation) CR8
  Hits: 62 / 17
  Move: 30'
  Str 16 (+3)
  Dex 10 (+0)
  Con 17 (+3)
  Int  8 (-1)
  Wis 10 (+0)
  Cha 14 (+2)
  Fort +7, Ref +4, Will +7
  AC: +18, Touch +10, Flat +18
  SD: immune fear, disease, polymorph
  Attacks: Bab +7, Grap +10
    +11 (19-20) Polearm 1d10+5 +1 wound(vampire) [reach]
     +6 (19-20) Polearm 1d10+5 +1 wound(vampire) [reach]
  Powers:
    10' Darkness Despair(-1 actions) DC15 Will
    Wall of K'Jore(Chaos)
  Feats:
    Specialization Series +1/+2
  Equipment:
    Black Plate [Repulsion 10' (can't approach) / DC19 Will negate]

Level 8 K'jore Deathguard Fighter (medium abberation) CR9
  Hits: 69 / 18
  Move: 30'
  Str 16 (+3)
  Dex 10 (+0)
  Con 18 (+4)
  Int  8 (-1)
  Wis 10 (+0)
  Cha 14 (+2)
  Fort +8, Ref +4, Will +8
  AC: +20, Touch +10, Flat +20
  SD: immune fear, disease, polymorph
  Attacks: Bab +8, Grap +11
    +14 (19-20) Demon Axe 1d12+6 +1d6 Purple melt (acid/taint diseased / DC10+dam Fort negate) [opt reach]
     +9 (19-20) Demon Axe 1d12+6 +1d6 Purple melt (acid/taint diseased / DC10+dam Fort negate) [opt reach]
  Powers:
    10' Darkness Despair(-1 actions) DC16 Will
    Summon K'jore beasts
  Feats:
    Specialization Series +2/+2
  Equipment:
    +1 Black Plate [Repulsion 10' (can't approach) / DC19 Will negate]
    +1 weapon

Level 9 K'jore Deathguard Fighter (medium abberation) CR10
  Hits: 75 / 18
  Move: 30'
  Str 16 (+3)
  Dex 10 (+0)
  Con 18 (+4)
  Int  8 (-1)
  Wis 10 (+0)
  Cha 14 (+2)
  Fort +9, Ref +5, Will +8
  AC: +20, Touch +10, Flat +20
  SD: immune fear, disease, polymorph
  Attacks: Bab +9, Grap +12
    +15 Tenticle 1d8+6 [auto grapple]
    +10 Tenticle 1d8+6 [auto grapple]
  Powers:
    10' Darkness Despair(-1 actions) DC16 Will
    Stop Teleport/etc
  Feats:
    Specialization Series +2/+2
  Equipment:
    +1 Black Plate [Corona of Hate (10/heal, 10'r Attack random + Rage(+4 str/con, -2 AC) / DC15 Will negate]
    +1 weapon

Level 10 K'jore Deathguard Fighter (medium abberation) CR11
  Hits: 87 / 18
  Move: 30'
  Str 16 (+3)
  Dex 10 (+0)
  Con 18 (+4)
  Int  8 (-1)
  Wis 10 (+0)
  Cha 14 (+2)
  Fort +9, Ref +5, Will +9
  AC: +21, Touch +10, Flat +21
  SD: immune fear, disease, polymorph
  Attacks: Bab +10, Grap +13
    +16 (18-20) Pick 1d6+6 or (20) Flail 1d8+6 [+2 disarm, trip]
    +11 (18-20) Pick 1d6+6 or (20) Flail 1d8+6 [+2 disarm, trip]
  Powers:
    10' Darkness Despair(-1 actions) DC17 Will
    Contagion Taint disease d4 taint + same damage to random stat/day DC15 Fort
    Storm of Vengence
  Feats:
    Specialization Series +2/+2
    +3 wound points
  Equipment:
    +2 Demon Plate [Corona of Black (10/elec, 10'r 1d12 + shocked(-2 dex/str, 1/2 move) / DC15 Fort negate]
    +1 weapon

Level 11 K'jore Deathguard Fighter (medium abberation) CR12
  Hits: 109 / 18
  Move: 30'
  Str 16 (+3)
  Dex 10 (+0)
  Con 18 (+4)
  Int  8 (-1)
  Wis 10 (+0)
  Cha 14 (+2)
  Fort +10, Ref +6, Will +10
  AC: +22, Touch +11, Flat +22
  SD: immune fear, disease, polymorph
  Attacks: Bab +11, Grap +14
    +17 Three-piece-mace 1d8+6 clinging [trip, opt reach]
    +12 Three-piece-mace 1d8+6 clinging [trip, opt reach]
     +7 Three-piece-mace 1d8+6 clinging [trip, opt reach]
  Powers:
    10' Darkness Despair(-1 actions) DC17 Will
    Prismatic Spray DC19 varies
    Alter structure of world (move/create walls, + gravity + slow + animate etc.)
  Feats:
    Specialization Series +2/+2
    +3 wound points
  Equipment:
    +2 Demon Plate [Corona of Purple (10/-, 10'r 1d12 taint + Nauseated / DC15 Fort Sickened]
    +1 weapon
    +1 ring of protection

Level 12 K'jore Deathguard Fighter (medium abberation) CR14
  Hits: 121 / 18
  Move: 30'
  Str 16 (+3)
  Dex 10 (+0)
  Con 18 (+4)
  Int  8 (-1)
  Wis 10 (+0)
  Cha 15 (+2)
  Fort +11, Ref +7, Will +11
  AC: +24, Touch +11, Flat +24
  SD: immune fear, disease, polymorph
  Attacks: Bab +12, Grap +15
    +19 (19-20) Demon Axe 1d12+9 +1d6 Purple melt (acid/taint diseased / DC10+dam Fort negate) [opt reach]
    +14 (19-20) Demon Axe 1d12+9 +1d6 Purple melt (acid/taint diseased / DC10+dam Fort negate) [opt reach]
     +9 (19-20) Demon Axe 1d12+9 +1d6 Purple melt (acid/taint diseased / DC10+dam Fort negate) [opt reach]
  Powers:
    10' Darkness Despair(-1 actions) DC18 Will
    Animate world to attack foes +12 tohit 2d6 damage
    Dictum DC19 Will see chart
  Feats:
    Specialization Series +2/+4
    Whirlwind, attack all in reach
  Equipment:
    +3 Demon Plate [Cloak of K'jore (+4 AC, +4 save, SR 25 vs Ian, Ian confused 1rnd if he hits)]
    +2 weapon
    +1 ring of protection

Level 13 K'jore Deathguard Fighter (medium abberation) CR15
  Hits: 112 / 18
  Move: 30'
  Str 16 (+3)
  Dex 10 (+0)
  Con 18 (+4)
  Int  8 (-1)
  Wis 10 (+0)
  Cha 15 (+2)
  Fort +11, Ref +7, Will +11
  AC: +24, Touch +11, Flat +24
  SD: immune fear, disease, polymorph
  Attacks: Bab +13, Grap +16
    +20 Razor Chain 3d4+9 clinging [+2 disarm, trip, opt reach]
    +15 Razor Chain 3d4+9 clinging [+2 disarm, trip, opt reach]
    +10 Razor Chain 3d4+9 clinging [+2 disarm, trip, opt reach]
  Powers:
    10' Darkness Despair(-1 actions) DC18 Will
    Summon K'jore beasts
    True Strike +20
  Feats:
    Specialization Series +2/+4
    +3 wound points
  Equipment:
    +3 Demon Plate [Cloak of K'jore (+4 AC, +4 save, SR 25 vs Ian, Ian confused 1rnd if he hits)]
    +2 weapon
    +1 ring of protection

Level 14 K'jore Deathguard Fighter (medium abberation) CR16
  Hits: 132 / 18
  Move: 30'
  Str 16 (+3)
  Dex 10 (+0)
  Con 18 (+4)
  Int  8 (-1)
  Wis 10 (+0)
  Cha 15 (+2)
  Fort +11, Ref +7, Will +12
  AC: +25, Touch +11, Flat +25
  SD: immune fear, disease, polymorph
  Attacks: Bab +14, Grap +17
    +21 Razor Chain 3d4+9 [+2 disarm, trip, opt reach]
    +16 Razor Chain 3d4+9 [+2 disarm, trip, opt reach]
    +11 Razor Chain 3d4+9 [+2 disarm, trip, opt reach]
  Powers:
    10' Darkness Despair(-1 actions) DC19 Will
    Contagion Taint disease d4 taint + same damage to random stat/day DC15 Fort
    Anti-magic 5' sphere DC19 Will
  Feats:
    Specialization Series +2/+4
    Deflect Arrows
    Deflect Arrows
  Equipment:
    +4 Demon Plate [Corona of Cold (10/fire, 10'r 1d12 + shivers(-2 dex/str, 1/2 move) / DC15 Fort negate]
    +2 weapon
    +1 ring of protection

Thursday, April 22, 2010

2d6 + mod >= value

Probable Probabilities Series


2d6 + mod >= value, 2 always fails


Rolled 10,000 times.

value +0  +1  +2  +3  +4  +5  +6  +7  +8  +9
  1  97% 97% 97% 97% 97% 97% 97% 97% 97% 97%
  2  97% 97% 97% 97% 97% 97% 97% 97% 97% 97%
  3  97% 97% 97% 97% 97% 97% 97% 97% 97% 97%
  4  92% 97% 97% 97% 97% 97% 97% 97% 97% 97%
  5  83% 92% 97% 97% 97% 97% 97% 97% 97% 97%
  6  72% 84% 92% 97% 97% 97% 97% 97% 97% 97%
  7  59% 72% 82% 92% 97% 97% 97% 97% 97% 97%
  8  42% 59% 73% 83% 92% 97% 97% 97% 97% 97%
  9  27% 40% 59% 72% 83% 92% 97% 97% 97% 97%
 10  17% 28% 42% 58% 72% 83% 92% 97% 97% 97%
 11   8% 17% 28% 41% 58% 72% 83% 92% 97% 97%
 12   3%  8% 16% 27% 42% 59% 73% 84% 92% 97%
 13   0%  3%  8% 16% 27% 43% 59% 72% 84% 92%
 14   0%  0%  3%  8% 17% 27% 42% 59% 73% 83%
 15   0%  0%  0%  3%  8% 17% 28% 43% 60% 72%
 16   0%  0%  0%  0%  3%  8% 17% 28% 42% 58%
 17   0%  0%  0%  0%  0%  3%  9% 17% 28% 42%
 18   0%  0%  0%  0%  0%  0%  3%  8% 16% 28%
 19   0%  0%  0%  0%  0%  0%  0%  3%  8% 17%
 20   0%  0%  0%  0%  0%  0%  0%  0%  3%  9%


2d6 + mod >= value

Rolled 10,000 times.

value +0  +1  +2  +3  +4  +5  +6  +7  +8  +9
  1  100% -->
  2  100% -->
  3  97% 100% -->
  4  92% 97% 100% -->
  5  83% 91% 97% 100% -->
  6  72% 83% 92% 97% 100% -->
  7  58% 72% 84% 91% 97% 100% -->
  8  41% 58% 72% 84% 91% 97% 100% -->
  9  28% 41% 58% 72% 84% 92% 97% 100% -->
 10  16% 28% 43% 58% 72% 83% 92% 97% 100%100%
 11   9% 17% 29% 42% 58% 71% 83% 91% 97% 100%
 12   3%  8% 17% 28% 41% 58% 72% 84% 92% 97%
 13   0%  3%  8% 17% 28% 42% 59% 72% 84% 92%
 14   0%  0%  3%  8% 16% 28% 42% 59% 72% 83%
 15   0%  0%  0%  3%  9% 17% 27% 42% 59% 72%
 16   0%  0%  0%  0%  3%  8% 17% 28% 41% 58%
 17   0%  0%  0%  0%  0%  3%  9% 17% 28% 42%
 18   0%  0%  0%  0%  0%  0%  2%  9% 16% 28%
 19   0%  0%  0%  0%  0%  0%  0%  3%  8% 17%
 20   0%  0%  0%  0%  0%  0%  0%  0%  3%  9%

Geomorph Cube Dungeon

[Follow up to my Dungeon Geomorph Cube and Slidy Puzzles post.]

I created a little proof of concept for a 2x2 Geomorph Cube Dungeon. Rubik's cubes are more complex than I originally thought.  It still lacks some tile rotations, [actually it's kind of screwed up].  I don't think I have enough SAN to code a 3x3 cube.  You can download the code and geomorphs to run it locally and/or mess with it.

It's sort of a pain to mentally translate the cross projection to a cube and I don't DM with computer.  So, I'm less inclined to finish/prettify the above proof of concept, I think... Would like to find large Rubik's cube and actually build one! Cause that would be rad and something I could actually use in game and totally flippin awesome to laugh maniacally as I rotated it.  But, the largest cube I've found has approx 1" faces, which is damn small for these geomorphs.  I have no idea how to build my own Rubik's or working facsimile.  Or rather, I know how, just not how to limited by my poor mechanical / shop skills.


Thanks to Risus Monkey for letting me use their geomorphs. And thanks to mthomas768 for remembering what movie, The Cube, I was thinking of.  And Huge Thanks to Grim and their blog Postapocapost for coming up with this awesome idea to begin with.

Wednesday, April 21, 2010

Probable Probabilities


I'm a sucker for dice and other mechanics. I see (in games, on blogs) many interesting mechanics and think up my own crazy schemes from time to time.  I often wonder about the probabilities behind these mechanics.  I've done some "analysis" in the past.  I'm doing more.  All will be indexed in this post.



["analysis" is in quotes cause 1) I'm no statistician 2) I'm gonna mostly use brute force programs (i.e roll 1,000,000 times, avg result) rather than math which is more exact but math is hard&work where as programming is easy&fun.]




Probable Probabilities
  • Ye old bell curve.
  • Exploding dice.
  • Hackmaster's correct exploding dice.
  • AC Bonus vs Save.
  • 2d6+mod > value.
  • 3d6+mod > value.
  • Roll X dice take highest.
  • Roll X dice take lowest.
  • Party rolls vs individual 2in6, etc. see Party Rolls.
  • 2d6 Thief'n from RPG Characters.
  • Forget where this came from Instead of using a percentile die for Thieves' Find Traps etc., you could give them more dice, depending on their level. Start them out with 2d6, and add a d6 every 3rd (?) level. For consistency, I'd do this with Elves and Dwarves as well, so rather than finding a trap on a 1-2, they'd get two dice to roll and find the trap if either of the dice showed a 1. Incredibly cunning traps might require 2 ones showing to be revealed, or even more for truly diabolically sneaky traps.
  • To be continued...  (requests welcomed)

Saturday, April 17, 2010

Barsoomian Name Generator

In Like Flynn created nifty tables for generating Barsoomian sounding names.  I was bored and wrote up a little javascript that used his data.  Results below;


Data and idea from In Like Flynn Blog.
The Button/Javascript probably won't work on blogger. [Edit: Nope it doesn't.]  Here's a working version and also the code (use the view source Luke!).

Wednesday, March 24, 2010

Ada Lovelace Day

It is Ada Lovelace Day an international day celebrating the achievements of women in technology and science.

Ada Lovelace

Wikipeadia's Ada Lovelace page will tell you all you need to know.  She is the world's first programmer and that makes her the earliest adopter of the Information Age and geek of the highest order.

On the off chance you imagine Ada Lovelace's contribution is an isolated instance of the fairer gender's impact on Computer Science and Programming below is list of some other ladies Rocking Out (source).

Out of the list, Grace Hopper is my personal hero. Go Navy!  She is responsible connections style for my software development career.  Dad went from WWII Airforce radio man to job with IBM, to programming missile tracking systems, to programming Marine payroll in COBOL (a language the use esp within Navy/Marines Rear Admiral Hopper pushed for).  Sometime in there I was born and dad got microcomputer to use for work at home / fun and let me "play" on it. 

By anonymous request Jeri Ellsworth -- She is best known for, in 2004, creating a Commodore 64 emulator within a joystick, called Commodore 30-in-1 Direct to TV. The "computer in a joystick" could run 30 video games from the early 1980s.  Just to prove not all are "stuffy" academic/researcher type. 


Allen, Fran

Antonelli, Kathleen (Kay) McNulty Mauchly

Bartik, Jean Jennings

Borg, Anita

Burks, Alice


Chen, Marina C.

Clarke, Edith


Davis, Ruth

Dayhoff, Ruth


ENIAC Women

Estrin, Thelma

Forsythe, Alexandra

Fox, Margaret R.

Goldberg, Adele

Goldstine, Adele

Goldwasser, Shafi

Granville, Evelyn Boyd

Griswold, Madge


Haibt, Lois

Hamilton, Margaret

Hayes-Roth, Barbara

Holberton, Frances Snyder (Betty)

Hoover, Erna Schneider

Hopper, Grace Murray

Jensen, Kathleen


Keller, Sister Mary Kenneth

Liskov, Barbara

Mahowald, Misha

Meltzer, Marlyn Wescoff

Noether, Emmy

Owicki, Susan

Pearl, Amy

Peter, Rosa

Polese, Kim
 
Ryder, Barbara G.

Sammet, Jean E.

Seneff, Stephanie

Spence, Frances Bilas

Srinivasan, Srinija

Teitelbaum, Ruth Lichterman

Winters, Joan Margaret

Wohl, Amy

Zimmerman, Joan

Thursday, March 11, 2010

AC Bonus vs Save, Death Match!

For various reasons I'm really wanting AC to be only armor and not a bunch of other stuff e.g. dex bonus, magic bonus, spell buff. I'm also trying to eliminate as many modifiers during game play as possible.

Using Target 20 with only positive AC (10-0). No Dex modifiers. I was also gonna ditch +x items until I read this magical +x bonus dice mechanic. Which is a great method for handling +x protective items. (well not so sure about picking two numbers and rolling multiple d20's rather than one number and d10's or picking one number per bonus and rolling single d10). Might even use it for shield bonus. Although, keeping "magic" as a separate/special mechanic has appeal.


It So Awesome

It makes +x magic less mundane. It also has the same effect of "Saving throws must be requested by players"(lost link). It puts more of players fate in to their hands. Like The Mule said it provides dramatic tension and excitement at the table over rolling dice.
"... take aspects of the game that normally get resolved off-screen beforehand and instead make them happen at the table as the spotlighted consequence of a dramatic event."

"... even if a PC’s magical protection will stop a blow most of the time, I want to make the players sweat in the interval between when I announce the hit and when their magic save comes through for them!"
And it speeds combat resolution.
"... dozens of men-at-arms in the combat it’s much easier if I can just roll a handful of dice and count all the 17s or above, knowing that such rolls always have a chance of hitting any target."

Lies, and Damn Lies

I was real curious about the statistical analysis. So, I broke out my Python dice code and ran (a lot) of tests. First, some results I'm not gonna bother showing you:
  • picking one number and rolling d10 was close enough to picking two numbers and rolling d20 that I'm only using former.
  • picking one number and rolling d20 caused even greater variation than d10s so ditched that idea.
So, pick one number, roll d10's equal to bonus, if number comes up then no hit (a save). Bonus from 1 to 3, to hit from 1 to 9, even ACs 10 to 2. Random results (rather than calculated) so 100,000 swings were made per row.

d20 + (AC-bonus) + tohit >= 20 is a hit
d20 + AC + tohit >= 20 and failed save(s) is a hit

100000 iterations of +1 tohit vs +1 to AC or 1d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 9 54.92% | AC 10 53.94% | 0.98% |
AC 7 45.07% | AC 8 44.94% | 0.13% |
AC 5 34.93% | AC 6 35.96% | -1.03% |
AC 3 24.85% | AC 4 26.88% | -2.03% |
AC 1 15.02% | AC 2 18.06% | -3.04% |

100000 iterations of +1 tohit vs +2 to AC or 2d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 8 50.27% | AC 10 48.79% | 1.48% |
AC 6 40.05% | AC 8 40.63% | -0.58% |
AC 4 30.09% | AC 6 32.64% | -2.55% |
AC 2 20.12% | AC 4 24.42% | -4.30% |
AC 0 9.97% | AC 2 16.18% | -6.22% |

100000 iterations of +1 tohit vs +3 to AC or 3d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 7 44.84% | AC 10 43.78% | 1.06% |
AC 5 35.04% | AC 8 36.30% | -1.26% |
AC 3 25.00% | AC 6 29.23% | -4.23% |
AC 1 15.03% | AC 4 21.96% | -6.93% |
AC -1 5.00% | AC 2 14.53% | -9.52% |


100000 iterations of +2 tohit vs +1 to AC or 1d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 9 60.14% | AC 10 58.63% | 1.51% |
AC 7 49.67% | AC 8 49.26% | 0.42% |
AC 5 40.20% | AC 6 40.66% | -0.46% |
AC 3 29.76% | AC 4 31.36% | -1.60% |
AC 1 19.88% | AC 2 22.25% | -2.37% |

100000 iterations of +2 tohit vs +2 to AC or 2d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 8 54.93% | AC 10 52.52% | 2.41% |
AC 6 45.04% | AC 8 44.53% | 0.51% |
AC 4 35.14% | AC 6 36.41% | -1.26% |
AC 2 24.88% | AC 4 28.32% | -3.44% |
AC 0 15.02% | AC 2 20.10% | -5.08% |

100000 iterations of +2 tohit vs +3 to AC or 3d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 7 49.80% | AC 10 47.04% | 2.76% |
AC 5 40.08% | AC 8 40.14% | -0.05% |
AC 3 29.80% | AC 6 32.88% | -3.07% |
AC 1 20.01% | AC 4 25.37% | -5.36% |
AC -1 9.88% | AC 2 17.97% | -8.09% |


100000 iterations of +3 tohit vs +1 to AC or 1d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 9 64.88% | AC 10 62.93% | 1.95% |
AC 7 54.92% | AC 8 53.98% | 0.94% |
AC 5 45.21% | AC 6 45.25% | -0.04% |
AC 3 34.89% | AC 4 35.91% | -1.02% |
AC 1 24.94% | AC 2 27.00% | -2.06% |

100000 iterations of +3 tohit vs +2 to AC or 2d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 8 60.03% | AC 10 56.57% | 3.46% |
AC 6 50.16% | AC 8 48.76% | 1.40% |
AC 4 40.01% | AC 6 40.51% | -0.50% |
AC 2 29.96% | AC 4 32.17% | -2.21% |
AC 0 19.80% | AC 2 24.21% | -4.41% |

100000 iterations of +3 tohit vs +3 to AC or 3d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 7 55.19% | AC 10 51.02% | 4.17% |
AC 5 44.88% | AC 8 43.71% | 1.17% |
AC 3 35.09% | AC 6 36.39% | -1.30% |
AC 1 25.08% | AC 4 29.24% | -4.16% |
AC -1 14.93% | AC 2 21.82% | -6.89% |


100000 iterations of +4 tohit vs +1 to AC or 1d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 9 69.88% | AC 10 67.56% | 2.32% |
AC 7 59.88% | AC 8 58.40% | 1.48% |
AC 5 49.88% | AC 6 49.41% | 0.46% |
AC 3 39.81% | AC 4 40.42% | -0.61% |
AC 1 29.93% | AC 2 31.30% | -1.36% |

100000 iterations of +4 tohit vs +2 to AC or 2d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 8 65.08% | AC 10 60.70% | 4.39% |
AC 6 55.06% | AC 8 52.74% | 2.33% |
AC 4 44.89% | AC 6 44.57% | 0.32% |
AC 2 34.79% | AC 4 36.24% | -1.44% |
AC 0 24.91% | AC 2 28.47% | -3.55% |

100000 iterations of +4 tohit vs +3 to AC or 3d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 7 59.88% | AC 10 54.75% | 5.12% |
AC 5 49.85% | AC 8 47.28% | 2.58% |
AC 3 39.95% | AC 6 39.99% | -0.04% |
AC 1 30.00% | AC 4 33.13% | -3.12% |
AC -1 20.10% | AC 2 25.47% | -5.37% |


100000 iterations of +5 tohit vs +1 to AC or 1d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 9 75.06% | AC 10 72.03% | 3.03% |
AC 7 65.09% | AC 8 63.13% | 1.96% |
AC 5 55.04% | AC 6 54.02% | 1.02% |
AC 3 45.02% | AC 4 45.05% | -0.03% |
AC 1 35.12% | AC 2 36.18% | -1.06% |

100000 iterations of +5 tohit vs +2 to AC or 2d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 8 70.03% | AC 10 64.62% | 5.41% |
AC 6 60.14% | AC 8 56.71% | 3.43% |
AC 4 50.14% | AC 6 48.62% | 1.52% |
AC 2 40.18% | AC 4 40.70% | -0.52% |
AC 0 29.88% | AC 2 32.31% | -2.43% |

100000 iterations of +5 tohit vs +3 to AC or 3d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 7 65.13% | AC 10 58.43% | 6.70% |
AC 5 54.95% | AC 8 51.22% | 3.74% |
AC 3 45.00% | AC 6 43.71% | 1.29% |
AC 1 34.64% | AC 4 36.24% | -1.60% |
AC -1 24.99% | AC 2 29.20% | -4.21% |


I think you get the idea. Here's the last one, +9 tohit.


100000 iterations of +9 tohit vs +1 to AC or 1d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 9 94.98% | AC 10 90.01% | 4.97% |
AC 7 84.99% | AC 8 81.21% | 3.79% |
AC 5 75.22% | AC 6 72.21% | 3.00% |
AC 3 65.39% | AC 4 63.32% | 2.07% |
AC 1 55.01% | AC 2 53.99% | 1.02% |

100000 iterations of +9 tohit vs +2 to AC or 2d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 8 90.07% | AC 10 80.90% | 9.18% |
AC 6 79.95% | AC 8 72.97% | 6.99% |
AC 4 69.93% | AC 6 65.15% | 4.78% |
AC 2 59.94% | AC 4 56.60% | 3.34% |
AC 0 50.31% | AC 2 48.89% | 1.41% |

100000 iterations of +9 tohit vs +3 to AC or 3d10 save rolls.
hit w/ bonus | hit w/ saves | diff |
AC 7 85.17% | AC 10 72.73% | 12.44% |
AC 5 74.89% | AC 8 65.72% | 9.17% |
AC 3 64.87% | AC 6 58.25% | 6.62% |
AC 1 54.97% | AC 4 51.16% | 3.81% |
AC -1 45.11% | AC 2 43.69% | 1.42% |

Conclusion
  • The difference between normal AC modification and save mechanic vary greatly depending on mix of AC, tohit, bonus.
  • The difference between normal AC modification and save mechanic regularly very large 5-10%
  • Save mechanic starts out mostly worse than AC modification. This gradually changes as tohit bonus increases. At +9 save is always better than AC modification.
  • Save mechanic compresses to hit percentage range i.e. AC10 is less likely and AC2 more likely to be hit.
  • The worse your AC is, the more beneficial saves are. Means bonus items are more valuable to low AC types.
  • The better tohit bonus opponent has, the more beneficial saves are. Means bonus items are less helpful vs weak opponents and very helpful against high lvl threats.
I don't think it bothers me much that this mechanic produces quite different results than modifying AC.

This save mechanic fits very well my ideal for shields. Providing large bonus to light armor and less and less as armor improves. Not mucking up AC, would blend nicely with shields shall be shattered, no changing ac if shield is / is not used. But then I thought of all the freakin dice rolls. Even if used just for +x protective magics I gotta think 1/2 the party is gonna have those and need to make extra dice rolls during combat.

I've become less sold. I really need to try it out in play.

BTW this mechanic is "reversable" for use with +x weapons. If miss with one use similar save mechanic to see if magic makes it a hit anyways. Very powerful for those who can't hit worth a damn. Less useful to martial masters. That sits well with my sensibilities.

Wednesday, March 3, 2010

The Most Awesome Talk on Future of Games Evar

"Real", not RPG games. Although, there's a great quote about teacher instead of grades giving out xp and leveling up students. This talk blows my mind and the end totally scares me.

Thursday, February 11, 2010

Update to MS Surface D&D Game Table

The very idea of this is sure to make the traditionalists rant, the edge bleeders rave and the rest to go, meh? Short vid, but looks like they've improved some stuff compared to original MS Surface D&D Table. Still, dice response is too slow. [They really need to keep physical dice and use camera to read values, or something.] See also, other electronic game tables.



CNET Story with claims of coming soon to a store near you.

Even if you rage against mixing electrogadgetry with your RPG you gotta give the Carnegie Mellon crew credit for doing interesting research that will spread well beyond games.

Friday, November 20, 2009

DM and SD Parrellels

My "make money to support gaming habit" activity is Software Development. Over the last decade or so I've migrated toward Agile "practices". My RPG preferences have also migrated towards simpler, looser, "lite". What is commonly called old-school. I, maybe erroneously, see striking similarities between Software Development (esp the Agile flavor) and Dungeon Mastering (esp the "old-school" flavor).

It's interesting. Both "disciplines" have various competing "methodologies" each with flame-thrower wielding religious adherents. Both indulge in a metric ass load of meta discussion over process/philosophy/origins/bike sheds. And both groups are over represented by what is generally known as "geeks" or "nerds".


YAGNI

You're Not Gonna Need It, agile definition. I and many other developers have wasted lots and lots of man-years designing and coding elaborate frameworks and libraries that we believe will (but never do) anticipate all needs and use cases. We had hoped these edifices of engineering would be reused over and over. But, each problem/customer/environment we wrote software for was slightly different and the reuse rarely paned out. Now, I try to solve exactly the problem at hand. No more, no less.

All the rules, YAGNI, DM adjudication/freedom from rule tyranny. Balance, YAGNI, in fact it gets in the way and it's never actually achieved. The hyper detailed Kingdom of Freedonia, YAGNI, the players will invariable never visit Freedonia unless they board a railroad. Four hour character creation complete with detailed background woven into the campaign history, YAGNI, character eaten by lions 30min into 1st session. A plot, YAGNI, this isn't story time, it's a game. Players are free to act as they wish. Perhaps creating plot through game play, perhaps just robbing some local merchants. Grognadia discusses DM minimalism a bit here and in other Dwimmermount posts.


Just In Time

Is the answer to the question "When should we write the code we thought we weren't gonna need but now realize that we do?" This idea is diffused throughout Agile Software. Just in time originated with general business, JIT compiliers are a concrete if tangential example. "Release early, release often", Test Driven Development, backlogs and iterations of Scrum, are all predicated on the JIT premise.

In RPGs it is called "winging it" or DMing by the "seat of your pants". Random encounter tables, random dungeon/monster/treasure/npc generator, old school terse one line descriptions of dungeon rooms/monsters/spells are all examples. So, is the oft repeated mega-dungeon / sandbox advice of fleshing out just the 1st few levels or just area around player's home base. Let the rest evolve during/from game play.


Iterative Development

I see each game session being akin to a scrum iteration. The ideas and activities of players during each session adds to the campaign backlog. They will be investigated (worked on) in future sessions (iterations), according to the the priorities set by players (customers). Sorry, if you don't know Scrum that might not make a lot of sense. It's about growing the game (campaign/houserules/style) incrementally over time through play. Growth driven by the players actions, rather than at the "speed of plot" and/or via simulation. Players decide what, DM decides outcome of that what.


Final Thoughts

Software Development, at a high level, is about managing complexity. A successful DM must also manage complexity. Running an entire imaginary world (or multiple worlds) in which you can't even rely on some basics such as the laws of physics is INSANELY complex. No one even comes close. Although, hard core simulationists foolishly try. SD/DMing have evolved similar tools for managing complexity. Some of which I discussed above. There are three primary schools of thought when it comes to managing RPG complexity;

1) ignore it. In the 80's this was roll up character, pick monster and duke it out. Repeat until you've killed all the gods in D&DG and have to write into Dragon Magazine to ask for new challange. Today, more of the same combat focused games only slightly obscured with light RP trappings. These are joined by the new breed of miniature/tactical focused games.

2) plot railroad. Choo choo! Complexity is limited because what will happen, when it's gonna happen, and how it's gonna happen are more or less known. Linear, perhaps with a few branches for alternatives. But, pretty much a simple directed graph (probably tree shaped) with a limited set of possible outcomes. (limited by amount of complexity DM can handle). This is design up front Waterfall SD.

3) old-school. Loose, agile, JIT. Dealing with where/what the players are doing now and largely ignoring the rest of the world (complexity) until/unless it becomes "what the players are doing now".

Like their software development counterparts they each are best in different situations. I hope to avoid situations where #2 is the right choice for either RPG or SD.

Wednesday, October 28, 2009

Hackmaster / Exploding Dice Analysis


Back when reviewing Hackmaster I wondered about the penetration (exploding) dice. I worried that a d4 would be better than d6 as the d4 was more likely to roll it's max value and explode than the d6. Being a programmer dude I wrote code and ran some tests.

The results of "throwing" each type of die 100,000 times.
die   avg    max
d4p 3.01 24
d6p 3.99 37
d8p 5.00 49
d12p 7.00 55
As you can see, exploding only increases the avg by about .5 and max values ramp up nicely. If you roll 100,000 times you can get some impressive max rolls. But, super high explosions are rare. Here are the details on d4, d6, and d12 (chosen cause of this) rolled "only" 12,000 times each. Results are value rolled, number of times it was rolled, % chance of rolling that value, % chance of rolling that value or higher.
d4p count chance cumulative
1 2954 24.62% 100.00%
2 3060 25.50% 75.38%
3 2991 24.93% 49.88%
4 756 6.30% 24.96%
5 796 6.63% 18.66%
6 740 6.17% 12.02%
7 177 1.47% 5.86%
8 184 1.53% 4.38%
9 181 1.51% 2.85%
10 43 0.36% 1.34%
11 43 0.36% 0.98%
12 42 0.35% 0.62%
13 11 0.09% 0.27%
14 3 0.03% 0.18%
15 10 0.08% 0.16%
16 5 0.04% 0.07%
17 not rolled
18 3 0.03% 0.03%
19 1 0.01% 0.01%
20 not rolled
21 1 0.01% -0.00%

d6p count chance cumulative
1 1951 16.26% 100.00%
2 2064 17.20% 83.74%
3 1922 16.02% 66.54%
4 1993 16.61% 50.53%
5 1992 16.60% 33.92%
6 334 2.78% 17.32%
7 347 2.89% 14.53%
8 331 2.76% 11.64%
9 370 3.08% 8.88%
10 322 2.68% 5.80%
11 60 0.50% 3.12%
12 68 0.57% 2.62%
13 43 0.36% 2.05%
14 75 0.62% 1.69%
15 64 0.53% 1.07%
16 7 0.06% 0.53%
17 11 0.09% 0.48%
18 9 0.07% 0.38%
19 12 0.10% 0.31%
20 16 0.13% 0.21%
21 not rolled
22 not rolled
23 4 0.03% 0.08%
24 2 0.02% 0.04%
25 1 0.01% 0.03%
26 not rolled
27 not rolled
28 2 0.02% 0.02%
29 1 0.01% 0.00%

d12p count chance cumulative
1 968 8.07% 100.00%
2 978 8.15% 91.93%
3 991 8.26% 83.78%
4 1004 8.37% 75.53%
5 987 8.22% 67.16%
6 996 8.30% 58.93%
7 980 8.17% 50.63%
8 982 8.18% 42.47%
9 1006 8.38% 34.28%
10 1025 8.54% 25.90%
11 1057 8.81% 17.36%
12 87 0.73% 8.55%
13 78 0.65% 7.83%
14 74 0.62% 7.18%
15 80 0.67% 6.56%
16 88 0.73% 5.89%
17 99 0.83% 5.16%
18 82 0.68% 4.33%
19 93 0.78% 3.65%
20 95 0.79% 2.87%
21 83 0.69% 2.08%
22 84 0.70% 1.39%
23 6 0.05% 0.69%
24 8 0.07% 0.64%
25 7 0.06% 0.57%
26 5 0.04% 0.52%
27 10 0.08% 0.47%
28 7 0.06% 0.39%
29 8 0.07% 0.33%
30 5 0.04% 0.27%
31 8 0.07% 0.22%
32 7 0.06% 0.16%
33 5 0.04% 0.10%
34 not rolled
35 3 0.03% 0.06%
36 not rolled
37 2 0.02% 0.03%
38 not rolled
39 not rolled
40 not rolled
41 not rolled
42 not rolled
43 not rolled
44 1 0.01% 0.02%
45 not rolled
46 not rolled
47 1 0.01% 0.01%
48 not rolled
49 1 0.01% -0.00%
5% chance for 17+ damage is a little high (2d12 avg=13). Seems not too out of whack for "critical hit" system. Still might change 2-hand damage to d10p.

In my Post on Weapon Damage a comment was made that exploding dice combined with my house rule, pure fighters get to roll damage twice and take the higher result, is too much of a damage escalation. An unmentioned tweak is fighters get to take the higher of the initial non-exploded roll, they don't roll exploded dice twice. Mostly cause I don't want to deal with insane amount of dice rolling / tracking.

So, modifying my program... Here are 2d10 and 2d12 rolled 12000 times, highest initial roll taken, and then exploded as appropriate.
d10p count chance cumulative
1 131 1.09% 100.00%
2 351 2.93% 98.91%
3 565 4.71% 95.98%
4 867 7.22% 91.28%
5 1082 9.02% 84.05%
6 1278 10.65% 75.03%
7 1600 13.33% 64.38%
8 1763 14.69% 51.05%
9 2072 17.27% 36.36%
10 232 1.93% 19.09%
11 241 2.01% 17.16%
12 233 1.94% 15.15%
13 218 1.82% 13.21%
14 213 1.77% 11.39%
15 243 2.02% 9.62%
16 226 1.88% 7.59%
17 207 1.73% 5.71%
18 234 1.95% 3.98%
19 26 0.22% 2.03%
20 23 0.19% 1.82%
21 24 0.20% 1.63%
22 13 0.11% 1.43%
23 28 0.23% 1.32%
24 27 0.22% 1.08%
25 33 0.27% 0.86%
26 19 0.16% 0.58%
27 23 0.19% 0.43%
28 5 0.04% 0.23%
29 2 0.02% 0.19%
30 1 0.01% 0.18%
31 6 0.05% 0.17%
32 2 0.02% 0.12%
33 3 0.03% 0.10%
34 2 0.02% 0.08%
35 1 0.01% 0.06%
36 7 0.06% 0.05%

d12p count chance cumulative
1 83 0.69% 100.00%
2 227 1.89% 99.31%
3 416 3.47% 97.42%
4 573 4.78% 93.95%
5 767 6.39% 89.17%
6 885 7.38% 82.78%
7 1067 8.89% 75.41%
8 1291 10.76% 66.52%
9 1366 11.38% 55.76%
10 1590 13.25% 44.38%
11 1813 15.11% 31.12%
12 148 1.23% 16.02%
13 149 1.24% 14.78%
14 182 1.52% 13.54%
15 163 1.36% 12.02%
16 141 1.18% 10.67%
17 159 1.32% 9.49%
18 153 1.27% 8.17%
19 181 1.51% 6.89%
20 154 1.28% 5.38%
21 148 1.23% 4.10%
22 182 1.52% 2.87%
23 13 0.11% 1.35%
24 13 0.11% 1.24%
25 20 0.17% 1.13%
26 14 0.12% 0.97%
27 11 0.09% 0.85%
28 19 0.16% 0.76%
29 7 0.06% 0.60%
30 10 0.08% 0.54%
31 10 0.08% 0.46%
32 18 0.15% 0.37%
33 19 0.16% 0.22%
34 1 0.01% 0.07%
35 1 0.01% 0.06%
36 1 0.01% 0.05%
37 not rolled
38 not rolled
39 not rolled
40 2 0.02% 0.04%
41 1 0.01% 0.02%
42 2 0.02% 0.02%
43 1 0.01% -0.00%
Chance of exploding is 2x normal what I'd expected. Did not realize "rolling twice taking best" would produce such high results. 55% chance of 9 or higher on d12.


For completeness here's d6p as rolled by fighter.
d6p  count chance cumulative
1 328 2.73% 100.00%
2 1016 8.47% 97.27%
3 1727 14.39% 88.80%
4 2322 19.35% 74.41%
5 2937 24.47% 55.06%
6 620 5.17% 30.58%
7 589 4.91% 25.42%
8 580 4.83% 20.51%
9 632 5.27% 15.68%
10 612 5.10% 10.41%
11 104 0.87% 5.31%
12 101 0.84% 4.44%
13 104 0.87% 3.60%
14 107 0.89% 2.73%
15 102 0.85% 1.84%
16 18 0.15% 0.99%
17 21 0.18% 0.84%
18 18 0.15% 0.67%
19 23 0.19% 0.52%
20 22 0.18% 0.33%
21 1 0.01% 0.14%
22 3 0.03% 0.13%
23 2 0.02% 0.11%
24 2 0.02% 0.09%
25 5 0.04% 0.08%
26 not rolled
27 not rolled
28 not rolled
29 1 0.01% 0.03%
30 1 0.01% 0.03%
31 1 0.01% 0.02%
32 not rolled
33 not rolled
34 not rolled
35 2 0.02% 0.01%

Wednesday, July 1, 2009

Future of Game Tables

Ever since seeing rear projection video table I've dreamed of using them for games. I'm less excited these days having become less excited about tactical miniatures game play in RPGs. They are still geekly awesome. The more rules a game has the more I desire to computerize those rules so I can ignore them and get to playing. So, I still dream...


This one is display only, no feedback of mini position, no touch (well there is the light pen so I guess it's halfway to feedback). On the other hand it's relatively simple to put together. They get mad props for using it for their actual RPG and having fun!


I'm kind of meh on this one. I don't think the UI is very good, the single state and requiring use of activation token looks PITA. Any successful electronic table has to be at least as fast and easy as just using miniatures.




The UI here is much more. I adore radial menus, learned about them long ago from some CS paper but actually used them in ToEE, a totally freakin awesome game. Those menus would be perfect for picking 4ed powers. Interesting use of minis, I thought they would be too small for fiduciary markers. This is comes very close to my vision of ultimate electronic table for tactical minis based RPGs like 3-4ed D&D, miniatures games such as warhammer, and numerous wargames. Too bad it needs darkness to work.



But these days this is probably closer to my ultimate game table!

Sunday, December 28, 2008

DMG Based Dungeon Generator

In my current 3.5 campaign the players will be shortly chasing after the Keys of Time, which are spread all over various alternate dimensions. Since I totally got bit with the old-school bug I've decided one of the keys will be found in an old-style Dungeon Crawl Dimension. The characters will start in a 10'x10' dark room(hope they have someway to make light). In the corner will be a 10' pole, a lantern, bundle of torches and a backpack filled with 3 flasks of oil, 10 spikes, a hammer, 50' rope, flint&steel, 1 wk iron rations, and a potion of healing. In each wall will be a wooden door, stuck of course. From there I planned to use the random dungeon generation tables from the DMG. But they turned out to be too unwieldy for use during game. So, I whipped up this simple program to do all the rolls and table lookups for me.

After doing a couple of test runs, I'm a little disappointed with appendix A. Not enough stuff (monsters/treatures/traps), too many freaking wide passages. Too many levels up/down (for my purposes).

For v2 I'll change passages widths to 50% 5', 30% 10', 20% other. Make Traps/Treasures/Monsters more common. Add in room types and dungeon dressings from the other appendixes. Maybe simplified tables to generate magic items, wandering monsters.

There's probably a million of these, this one is mine. Python source dmg_dungeon_generator.py

Python is keen, by far my favorite programming language. It's a bit like modern rules lite RPG's, there's very little syntax and "rules" to it and what there is has a consistency. Makes it easier to tinker with. For instance the ability to redefine how objects are converted to strings, __str__, lets me define random tables that "roll" themselves when printed. Like so
Door = table_d20(
  ( 6, "Door left leading to a", Beyond_Door, ),
  (12, "Door right leading to a", Beyond_Door, ),
  (20, "Door ahead leading to a", Beyond_Door, ),
  )
Beyond_Door = table_d20(
  ( 4, Passage_Width, "parallel passage extending 30' in both directions. Or 10'x10'.", ),
  ( 8, Passage_Width, "passage straight ahead.", ),
  ( 9, Passage_Width, "passage ahead/behind 45deg.", ),
  (10, Passage_Width, "passage behind/ahead 45deg.", ),
  (18, Room, Contents, ),
  (20, Chamber, Contents, ),
  )
The simple python statement print Door will randomly roll a d20, say 11, look up matching row in Door table print "Door right leading to a ". Then roll another d20 this time on Beyond_Door table, which leads to other tables and text and so on.

Those are interpreted (along with a few helper classes/functions) by this relatively short class. Not stupendous but I like how simple/clean/flexible the table definitions are.
class Table(object):
  """Object that when evaluated into string will return random result from table"""
  def __init__(self, dice, *table):
      """@param dice: callable that returns something comparable to x.
      @param *table: list of tuples (x,foo1,foo2,fooN) where x is comparable to return value of dice and foo? are evaluatable into strings.
      """
      self.dice = dice
      self.table = table
  def __str__(self):
      """@return: foo1,foo2,fooN stringified and space separated, from row in table where x >= return value of dice.
      """
      return " ".join(str(s) for s in self.get_result())
  def get_result(self):
      roll = self.dice()
      for row in self.table:
          if row[0] >= roll:
              return row[1:]
      return self.table[-1][1:]

def table_d20(*table):
  return Table(lambda: random.randint(1, 20), *table)
The table_d20 is a helper function to return a Table object preset to use d20 for its dice rolls. It takes a list of arguments, *table, which in our case are the rows of the table. It passes those along with a lambda function that returns a number between 1 and 20 (our d20 die). We need to wrap the random.randint in a lambda so it's callable, since we want a new random number every time we "roll" on the table.

The Table classes __init__ is nothing special. And the __str__ function just applies the str builtin to each item in the list that self.get_result() returns. It then compiles them all into one string, added a space between each one. If you did now know __str__ gets called whenever the object is converted to a string. e.g str(obj) is basically obj.__str__()

The get_result has all the action. It "rolls the dice" then iterates over the table rows looking at the first item until it finds a match. It then returns all but the first of that row's items. There's a fail safe, if no matching row is found it returns items from the last row.

All Time Most Popular Posts