This gadget was designed to simulate the special mechanics involved in rolling dice for Deadlands and Hell on Earth.
The dice roll simulator ran 1,000,000 rolls of each coordination/trait pair up to 10d12 to determin the average roll and the bust percentage.
| Die | Avg. | Bust % | Die | Avg. | Bust % | Die | Avg. | Bust % | Die | Avg. | Bust % | Die | Avg. | Bust % | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1d4 | 3 | 25.017% | 1d6 | 4 | 16.715% | 1d8 | 5 | 12.500% | 1d10 | 6 | 10.000% | 1d12 | 7 | 8.357% | ||||
| 2d4 | 4 | 9.400% | 2d6 | 5 | 3.710% | 2d8 | 7 | 1.950% | 2d10 | 8 | 1.198% | 2d12 | 9 | 0.811% | ||||
| 3d4 | 5 | 12.698% | 3d6 | 6 | 6.353% | 3d8 | 8 | 3.761% | 3d10 | 9 | 2.550% | 3d12 | 11 | 1.828% | ||||
| 4d4 | 6 | 7.399% | 4d6 | 7 | 2.222% | 4d8 | 9 | 0.910% | 4d10 | 10 | 0.449% | 4d12 | 12 | 0.257% | ||||
| 5d4 | 6 | 7.403% | 5d6 | 8 | 2.663% | 5d8 | 9 | 1.272% | 5d10 | 11 | 0.719% | 5d12 | 13 | 0.432% | ||||
| 6d4 | 7 | 5.174% | 6d6 | 8 | 1.197% | 6d8 | 10 | 0.389% | 6d10 | 12 | 0.164% | 6d12 | 13 | 0.079% | ||||
| 7d4 | 7 | 4.663% | 7d6 | 9 | 1.182% | 7d8 | 11 | 0.453% | 7d10 | 12 | 0.210% | 7d12 | 14 | 0.102% | ||||
| 8d4 | 8 | 3.504% | 8d6 | 9 | 0.618% | 8d8 | 11 | 0.163% | 8d10 | 13 | 0.057% | 8d12 | 15 | 0.021% | ||||
| 9d4 | 8 | 2.982% | 9d6 | 10 | 0.551% | 9d8 | 11 | 0.156% | 9d10 | 13 | 0.062% | 9d12 | 15 | 0.029% | ||||
| 10d4 | 8 | 2.375% | 10d6 | 10 | 0.315% | 10d8 | 12 | 0.064% | 10d10 | 14 | 0.018% | 10d12 | 16 | 0.007% |
The dice roller mechanic in Perl, this function will take the Coordination, Trait and Modifier as parameters and pass back an array(list) of the result and a 1 if a bust occured (or 0 if no bust).
sub dl_dice_roll {
my ($coord, $trait, $mod) = @_;
my $high_roll = 0;
my $roll_cnt = 0;
my $bust_cnt = 0;
for (my $roll = 1; $roll <= $coord; $roll++) {
my $roll_val = $mod;
&roller($trait, \$roll_val, \$roll_cnt, \$bust_cnt);
if ($roll_val > $high_roll) { $high_roll = $roll_val; }
}
return ($high_roll, ($bust_cnt > ($roll_cnt/2))?(1):(0));
sub roller {
my ($t, $_roll_val, $_roll_cnt, $_bust_cnt ) = @_;
my $die = (int(rand($t)))+1;
$$_roll_val += $die;
$$_roll_cnt++;
if ($die == $t) { &roller; }
elsif ($die == 1) { $$_bust_cnt++ }
1;
}
}