I am approaching the final session of the longest D&D campaign I’ve ever run.
The players have made their way through all the challenges I constructed for them. The only thing left to do is confront the final villain and defeat him.
I’m reminded of something I wrote in high school, that people are attracted to stories that excite them regardless of how real those stories are. The world, characters, and stories I’ve built through Dungeons and Dragons aren’t real, but the outcome is as important to me as the outcome of other things in my life.
So if you play Hackmaster using Roll20 and have a Roll20 Pro subscription then these should be pretty valuable to you. If not… you might be able to modify it for use outside of Roll20’s API and still get some fun out of it.
The other announcement of the week is that I will be on vacation the next two weeks.
I’ll do my best to stay constant with updates over that time, but I believe it is inevitable that I’ll be distracted by something in the city in visiting, Nashville.
And when I get back I’ll have a lot to say about the capitol of country music!
Continuing from my previous post about Roll20, I wanted to talk about how script writing for Roll20 works and the particulars of the script I’m writing.
Roll20 has something called an API (Application Programming Interface) a term that the programmers reading this are already aware of, but one which I had to look up while writing this.
Behind all the fancy jargon I read, an API is a way to write and test programming code.
The simplest “API” is something like Notepad. You can design a program in it, but Notepad won’t run your program or tell you where you messed up.
There are more complicated APIs track syntax errors in your code, color the different key words, point out where you messed up, and even let you test run your code.
Roll20’s API tracks syntax and color codes. It tells you IF you messed up, but not WHERE. So when there is inevitably a problem you get to play hide and seek until you find it.
I’m familiar with the basics of programming. I’ve taught myself a little bit of Python, I took a course on C in college, and I know a little about Perl and HTML* from various places.
*Not exactly a programming language but I’ll bet that nobody really cares.
The CodeAcademy course is pretty cool! Nice assisting prompts. A little poor on alternative ways of solving the problems, but that’s actually a good thing for programming courses.
And what program is that? Something to automatically spit out the results of a critical hit in Hackmaster!
Hackmaster is a game like D&D that I play with my friends sometimes. Hackmaster has a ton of cool rules that make the game quite a bit more fun and shocking than D&D.
One of those rules is what happens when you hit your opponent real good. Depending on your height advantage over your opponent, the weapon you used, and how hard you hit, a special event occurs.
Why do I want a program for that? Well… Take a look.
There are about twenty pages like this that just go on and on.
It’s a bit much to flip through all those pages, cross reference with the different numbers you need, and then trail your finger down the chart to see what happens.
Instead, why not have a program do the work for you?
The program is started when a player uses the Critical Hit macro. Remember how macros can ask for values? That’s all the Critical Hit macro does. No dice are rolled.
The Critical Hit macro asks for seven different values: your size, your opponent’s size, your attack roll, your opponent’s defense roll, your damage roll, your opponent’s armor strength, and the type of weapon you’re using (Crushing, Hacking, or Piercing).
Next comes the script. The script is triggered when the Critical Hit macro is entered.
I looked around on Roll20’s forums and found the skeletons of some other scripts to use for the script to take information out of the Critical Hit macro and use it in the program.
From there, the script rolls a several thousand sided die that represents the location hit by the critical with different sized dice depending on the difference between the attacker’s and the defender’s sizes.
After getting that roll, the script enters a gigantic ~3,000 line long if/else tree that serves in place of the twenty page table. This comes up with a different results based on the location of the blow, how hard the target was hit, and what type of weapon was used.
Finally, the program spits out the result into Roll20’s chat along with some background information to make sure that it worked correctly.
Does the code work? Well, I don’t know yet. I’ve been typing away at it for about a week now and have transferred roughly one fifth of that giant table in the book to the programming script.
Due to how I structured the code, I can’t tell if it works correctly until I finish the whole thing.
Unfortunate, but what can I do at this point?
So here’s hoping that when I’m done in a few weeks and I press that Critical Hit macro button, it runs as smooth as melted chocolate.
If not, then I’ll probably have a blog post to make about code debugging…
P.S. If you play Hackmaster and are interested in this code I will be posting the completed version of it on the Roll20 forums and the Hackmaster forums once I’ve finished. I’m also planning on doing a similar thing for the Fumble charts for Hackmaster so stay tuned for those as well.
I mentioned that my group uses Roll20 to play D&D.
Roll20 started as a Kickstarter. They got successfully funded and released the beta to the backers before releasing the official version to everyone a bit later.
The folks who make Roll20 have a payment system common to most internet businesses.
The program is free to use if you’d like, but you can also pay a monthly or yearly fee to get access to new features sooner, more dataspace, and fewer ads. Pretty similar to WordPress’s system if you think about it.
Roll20 has an additional feature on their payment system though.
The website doesn’t have the vast following that WordPress has. They don’t make enough from ad revenue to keep the site going like WordPress does.
Roll20 relies almost entirely on people paying for the extra features. Thus is the site has a little tracker saying how many subscribers it needs to “keep the lights on.”
The tracker has other levels it can go up to though. There are a total of five different levels of support on the tracker.
The first level is keeping the servers on to support all the traffic that Roll20 gets.
The second level is having occasional updates done by the developers. This isn’t enough money for Roll20 to be their fulltime job, but its enough to convince them to work on weekends.
The third level is full time work by the developers. The tracker is currently a little ways into this level.
The fourth level pays for a publicist and additional developers to come up with system specific features for Roll20.
The fifth level allows for even more developers to be hired for projects beyond just Roll20.
With the third level not yet complete, the developers are coming out with occasional updates. The new one for May is a bit ridiculous. You can check it out on their blog post here: Quantum Roll
Random number generators on computers aren’t exactly random. It’s complicated to explain, but you can trust the programmers on this one. They wouldn’t lie about a deficiency that they have.
This is frustrating for some people that use Roll20. Real dice are random, shouldn’t virtual ones be random too?
The Roll20 development team has solved that problem by hooking its dice rolling program up to data from a light beam splitter in Australia.
The light splits randomly giving random data details. Roll20 uses those numbers to decide the outcome of a die rolled on the website.
It’s so ridiculous that most of Roll20’s fans have been calling it an April Fools joke or overkill for the problem.
My opinion? It’s a pretty damn cool way to solve the problem using freely available methods. I won’t notice while playing, but I like that the developers care.
I played Dungeons and Dragons (D&D) with my friends last night. We’ve been playing for over ten years together. We started when we were all homeschooled by our parents during what would’ve been elementary school. After we all split apart for college we ended up playing through Skype for a little bit and later through a cool web application called Roll20. I love playing D&D with my friends because the game is capable of almost anything in the fantasy genre. We can slay dragons, run away from orcs, obtain powerful magic weapons, destroy those weapons if they turn out to be evil, sail the sea as pirates, etc. It’s a whole lot of fun.
Although D&D is great for me, it has a history of being misunderstood. I’d like to clear up a few of those misconceptions with this blog post. I’ll talk more about my own experiences with D&D in forthcoming posts.
D&D started off as a spinoff from board game simulations of wars or war games. Risk is the most popular one that many people have heard of, but there are hundreds of others. A few of the other big ones include Axis and Allies, Diplomacy, and Small World. War games are pretty simple at their heart. You get a set of pieces and you use them to simulate a battle. The rules might tell you how to simulate the D-Day Battle for Omaha Beach, but nothing’s stopping you from using those same pieces to simulate the Battle of the Bulge. My friends and I did the same thing with green army men when we were kids. We’d separate them out into teams and have little skirmishes on the living room floor. Occasionally an air strike would be called in and we’d drop a red foam ball on the troops. Whichever army men got knocked over were casualties.
At some point two war gamers, Gary Gygax and Dave Arneson, decided they were tired of only doing simulations of real battles. They wanted to simulate the same battles that happened in the high fantasy books they read. Battles with swords, dragons, and magic instead of guns, artillery, and aerial bombardments. Gygax and Arneson worked on a set of rules for several years until D&D was released on January 26th 1974 (I know the exact date because I’m on an email list that informed me of the 40th anniversary a couple weeks ago). The game featured heavy influences from the Lord of the Rings books which were popular at the time. My dad was one of the first people to start playing D&D. There were 1,000 games made in the first printing run in 1974 and my dad snagged one of them. He played throughout college and passed the habit on to me and my friends.
D&D gained a poor reputation in the 70’s and early 80’s. This was largely due to Christian groups viewing it as a form of devil worship just as similar groups burn Harry Potter books today. D&D reached its peek negative reputation with the suicide attempts of James Egbert in 1979 and 1980. Egbert played D&D and newspapers all over the nation sensationalized his death. The media claimed that he had killed himself because his character had died in the game. Everyone overlooked that Egbert was severely depressed. His story was “adapted” into a book and later a movie staring Tom Hanks called Mazes and Monsters. These negative stories of devil worship and suicide piled on with more accurate stereotypes of pimply nerds without social skills playing the game in basements. D&D was, and still is to some extent, something that people are embarrassed to admit they play. I didn’t tell my wife until a month or two after we’d started dating because I was afraid she’d judge me for it. As an inside observer, I’m unsure how much of this reputation has gone away or not.
So that’s the history of D&D, but what exactly is it? Well, it’s a roleplaying game similar to video games like World of Warcraft, Diablo, and Fable.
D&D has many key differences from video games though. In video games the player is often restricted to only one character and may never change who that character is (there are exceptions in video games, but as a general rule this stands). In D&D the player can be whoever they want.
Video games decide actions based on programmed random number generators. D&D uses dice, a low-tech version of the same thing.
Video games have amazing graphics. D&D relies heavily on imagination to visualize the events taking place. If you’re lucky, you get fancy miniatures to play with like this one that I painted.
Video games have one plot. If you play the video game again you will be taking essentially the same actions once again. D&D has as many plots as you can imagine. And if you use the same plot, you don’t have to resolve it the same way. If the plot was a bank robbery you could do it with a shotgun the first time or with a hacking program the second time.
Video games have restrictions that seem illogical. The ones that annoy me the most are when my character can’t jump or walk up small slopes. The game does this to keep you on the set path/plot that the designers created. In D&D you can go anywhere. A gorge isn’t necessarily an impassable obstacle to your character in D&D if s/he can jump really or fly over it.
And most importantly, D&D is always played with your friends. You and your friends can go on great adventures and explore new lands just like Bilbo, Conan, Harry Potter, or any other fantasy character you can name. It’s a great way for adults to use their imagination just like when they were kids pretending to be heroes.