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

Tuesday, March 20, 2012

Randomness

A long time ago, I had an Amiga 1000. Being both a gamer and a programmer, I spent some time playing around with various game-related programs. One of them was a text processor that read various table-like files and produced randomized results from them. Time moved on, and the Amiga went the way of the dinosaur and dodo, to be replaced by a PC running Windows and another running FreeBSD. Once again I did a bunch of messing about with table-driven randomizers and ported the old Amiga code over to new OSes and new languages.

The latest incarnation is written in PHP, and I just finished the beta version. The first test page is now up, a random treasure generator for D&D-like fantasy RPGs. If you have a few minutes, please stop by and give it a spin. Feedback welcome of course.

Link: http://www.pbegames.com/treasury/

Friday, January 27, 2012

Dice Roller Preview

This is just a quick preview of the main screen in the Android dice roller I'm messing about with, showing roll entry and the history of previously processed rolls. This shot was captured from an Android virtual device running on my development PC.
Dice Roller Preview
I still have some work to do, including implementing some additional error checking (allowing d10s to explode on a roll of 3 or higher is bad, m'kay), adding a clear button to reset the entry field, creating a real set of icons, and getting some translations done for the limited number of text messages in the app. Still, not bad for a couple days work in a programming language I don't actually know.

Wednesday, January 25, 2012

Dice Descriptions


I've been spending some time programming over the last few days, delving into Android development as a way to teach myself Java. As my first project I'm building a dice roller. Originally I was going to use the same text descriptions for rolls that I use on my web based dice roller, but after implementing them I decided I could do better. I'm trying to cover as many rolling mechanics as possible, so I thought I would throw out the roll definitions here and see what other folks thought.

Traditional dice: XdY
Roll X dice with Y sides, sum their values. Y can also be F, indicating Fudge dice, or %, shorthand for d100.

Dice pool: XpY
Roll X dice with Y sides, treating each die as an individual result. As with traditional dice, Y can be F or %.

Modifiers
These can be appended to the base descriptors above. N below is a numeric value.

  • +-N - A numeric modifier to the roll. The value is added to or subtracted from the final total for traditional dice, or applied to each die in a dice pool.
  • EN - Exploding dice. Any dice roll greater than or equal to N generates another die roll. In traditional rolls the result is added to the total. In a dice pool it is added to the original exploding die's result.
  • LN - Drop the lowest N rolls. The classic example is D&D character generation using the roll four six-sided and drop the lowest method, which would be written as: 4d6L1.
  • HN - Drop the highest N rolls. Not sure if any game would make use of this. I guess you could make some very lame D&D characters with 4d6H1.
  • SN - Count successes. For traditional dice, a total result greater than or equal to N is a success. For a dice pool each die greater than or equal to N is a success.
  • FN - Count failures.  For traditional dice, a total result less than or equal to N is a failure. For a dice pool each die less than or equal to N is a failure.

Some things I think I'm missing, but I'm not sure if they're useful.

  • Imploding dice - rolls below a certain value generate an additional roll that's subtracted from the first.
  • Savage Worlds - Wild Dice. I don't play Savage Worlds, can someone throw me a clue?
  • Exploding dice that don't continue to explode.

I'm sure there are a bunch of methods I've forgotten or ignored. Anyone know of a concise list of RPG dice mechanics published anywhere?