net.sourceforge.rpgee.dice
Interface RandomValue
- All Superinterfaces:
- Describable
- All Known Implementing Classes:
- AbstractRandomValue
public interface RandomValue
- extends Describable
As of my nearly 30 years of role-playing, I've seen exactly three kinds of random generation in a game
- Random numbers get generated and added. My first experience? D&D. 3d4+4 means roll 3 four-siders, add them together and add
4
- Random numbers get generated and values mapped to some other value. This is like cards. The random number for a single deck
of 52 cards is based on which cards have been drawn already. Basically, when you shuffle a deck, you randomize an ordered stack
of 52 numbers and pop them off of the stack one at a time. Each number maps to some suite and card so the card for the value 1
might be the Ace of Spades and for 3 might be the 3 of Spades and so on. Since the stack values were randomized at some point,
the values are only relevant to what they're mapped to.
Of course, you can also do math on these elements (arithmetic with
simple values, rounding, etc) but it's not as common. A more common example of this type of randomizer would be something that
mapped a draw of 5 cards to a poker hand. Complex but completely managable. Doing Texas Hold-'em for (n-players) would require
1+n draws from the deck, of course, which would overy complicate a poker-hand mapper.
But I've never seen an RPG that used
that sort of resolution system.
- Random numbers generated, mapped to some other value, and then the result tallied. The previous example is like drawing a
single card from a deck. This example is more complex. For instance, if a mapper was mapping Fudge dice, it would roll some
number of six-siders and map the results as follows : 1-2 = -1 , 3-4 = 0, 5-6 = +1. It would then add up the mapped values and
make a result. Likewise with systems like WoD where there's some target number each die must hit to be counted. In the current
(new) WoD rules, it's exactly like the Fudge example but maps as follows : 1-7 = 0, 8-10 = +1. The special case for WoD dice is
that 10s get re-rolled and re-mapped, but that's a mechanic associated with that implementation.
For instance, the Hero
System mechanic for dice is fairly odd with regard to mapping a half-die of normal damage to BODY, and would require a parser
that understands that a half-die is intrinsically different from a regular die. But the result is still the same effect (half-die
maps STUN at half the roll, round down, and BODY at 1-5=0 and 6=+1)
I'm interested in knowing if there are systems that are somehow different from this. I have yet to find an RPG which uses a
randomization system that can't be rendered down to something that fits into this formula.
Note that the randomizer
in a system is very different from a resolver, that takes specific game mechanics and generates success/failures against them.
For instance, the OpenRPG1 Hero dice roller has a function that takes a roll and a combat value, determining the defensive CV
that that particular roll will hit.
I think that's neat, but I don't think it's part of the randomizer. We may introduce a
Resolver that allows you to generate arbitrary results based on elements of the Game Tree, but the dice package just generates
(psuedo)random results.
- Author:
- Mykel
getValueAsString
java.lang.String getValueAsString()
- Shows the "rolled" values for random elements The mapped value is presented if this die has a value mapper
- Returns:
- String of the produced value (generally a number)
getValue
int getValue()
- List of values rolled. This is the "result" of the roll, and can be either an Integer or a List. Depending on the
type of randomizer something is, a List might be added together to produce the "valueAsString()" result before
mapping, or it might be the case that each value in the List gets mapped.
setValue
void setValue(int value)
throws InvalidParameterException
- Throws:
InvalidParameterException
getSides
int getSides()
getMapper
RandomValueResultMapper getMapper()
getOriginalValue
RandomValue getOriginalValue()
isOriginalValue
boolean isOriginalValue()
Copyright © 2006 An Infinite Number of Monkeys. All Rights Reserved.