Saturday, October 29, 2011

Behind-the-scenes: Combat, and just about everything else

For the MLP RPG, I use my own homebrew d20 based roleplaying system. If you're not familiar with that term, Wikipedia to the rescue! - http://en.wikipedia.org/wiki/D20_System

Almost everything, from combat rolls to randomization rolls (used for randomizing the enemy encounters and the flavor text) is the result of either a pure d20 roll or a d20 roll added to some stat. For example, to determine whether an attack or block was successful, the game rolls 1d20 (1 20-sided die) and adds that to either the player or monster's Attack or Defense stat, respectively. (Attack and Defense are calculated by my own simple little formula using the player or monster's Might and Agility stats)

To determine the damage dealt once an attack is deemed successful, another roll is used. For instance, if the player is attacking with their Hooves, the game rolls 1d20, while for a Unicorn's Horn 1d12 is rolled.

The dice rolls use a randomization algorithm built into the C++ language, which is seeded with the current time. Seeding the algorithm with the current time allows for the random element of rolling a die, since all computers are basically just calculators at their core and can't produce truly random numbers without a little help.

Hopefully that sheds some light on the inner workings. Please feel free to ask questions, I'd be more than happy to answer!
The Code Pony

No comments:

Post a Comment