Because I'll be touching on a wide range of topics, I'll split them up into multiple posts, and that should keep me from neglecting this blog for a little while. So, partly to tell you what's coming and partly just so I can keep track for myself, here's a road map of the topics I plan to hit with this discussion.
- General geekery about using programming to automate complex tasks.
- Building a project from the ground up, starting by visualizing the data structures instead of just diving in blindly.
- How separating interface from implementation makes it easier to translate your program to multiple platforms.
- Good riddance to the bad old days: How the web has made program content delivery easier.
- A primer for noobs on what web servers do, and why I bought another one.
First let me explain the problem. My fiancee, Lynnea, has gotten into paper-and-pencil roleplaying games. She has been running a light Dungeons & Dragons campaign occasionally for me and my son Ben over the last few months. She also plays with a group of friends one night a week. For my part, I've played RPGs a few times before but never been a strong part of that scene, so I just listen to the stories of her sessions. Currently they're playing with a rules system called "HackMaster."
As I understand it from skimming a few chapters of the rulebook, HackMaster was written by someone who hates doing things the easy way. When D&D was first published in 1974, it was at first an ever-expanding set of complicated rules involving tons of die-rolling for all kinds of special situations. Or as a German exchange student my family hosted in high school put it, "D&D isn't a role-playing game, it's a roll-playing game." Har. Har. Very droll, those gamers. (Oh hey, how are things going, Max? ;)
Still, as the years went by, D&D started to reverse the trend and become more streamlined, or so I've heard. The latest release, fourth edition rules, was clearly heavily influenced by World of Warcraft, and reduces a lot of the unnecessary choices in favor of more interesting combinations of focused options.
The HackMaster author just hates that. Not that I would recognize the difference, but I have the impression that if anything, he's aggressively chosen to make every little action even more complicated than it would have been under old-school D&D, to the point where a party can spend thirty minutes meticulously checking a single room for traps before seeing any combat. And the critical hit tables are an utter monstrosity.
Critical hits (or "crits") for you non-gamers, means that for every attack there is a chance (1 in 20 under D&D rules) that it will be a super-strong attack which does extra damage. In WoW, this is handled automatically by the game; you can build up gear that will increase your crit chance, but usually there's a flat formula that says "If you crit, your strike does twice as much damage." Rules in 4th edition D&D are pretty close to the same.
In HackMaster, you roll a number between 1 and 10,000 for the body part where your blow lands, and there are all kinds of "realistic" outcomes that result if you land a powerful blow on that body part. Furthermore, rolling a 20 is just your cue to pull out a ginormous, six page tables full of teeny little numbers and two accompanying rules pages. You then roll another number that might range from 1-24 to see just how badly your crit hurt the monster (or the monster's crit hurt you).
For instance, if you get hit on the top of the head, the crit damage can range from "8 extra damage" to "twice normal damage AND you lose some hit accuracy AND you lose some dexterity AND you fall down and drop everything you're carrying"... to "brain goo." Do not pass go.
Each one of those individual clauses, by the way, is represented in the table by a little symbol like "dX" which you have to look up on a smaller table of effects. I think you have to look at a sample to see what I'm talking about.
|(Click for a larger image.)|
Not to put too fine a point on it, this sounds like a game that I would personally hate playing. But no accounting for taste, you know? Even so, problems of managing huge sets of data are piles of fun to solve with a computer. NO, that's NOT sarcasm, you non-programmers, that's fun. Shut up.
So when the DM tentatively asked if it would be possible to write a program that could handle the die rolls and just spit out some nice, clean output, I said "Piece of cake!" I wouldn't even accept his offer to pay for it. Just like when I wrote a Sudoku solver, sometimes figuring out how to automate gameplay is more fun than actually playing. (Disclaimer: I used to claim that Sudoku is a fun math problem and a crappy game. Now I like playing it. It's my Android Evo's fault, damn it... it's the perfect game for a handheld, and it has built in strategy advice. Once I started improving at harder puzzles, there was no escape.)
And so it began.
To be continued...