Home Game Development random – Techniques for “fairer” cube rolls?

random – Techniques for “fairer” cube rolls?

0
random – Techniques for “fairer” cube rolls?

[ad_1]

Suppose I’ve a sport with 6 gamers, every of which will get a payout on a special facet of a D6 roll. The D6 is rolled many instances over the course of the sport.

This yields a fair payout in the long term, utilizing an unbiased D6. However, my sport will not be lengthy sufficient for the payouts to revert to the imply. Therefore, I wish to make a biased cube mechanism, the place rolls that haven’t come up not too long ago are extra doubtless.

One method I can consider is to simulate a deck of playing cards:

  1. Take a listing [ 1, 2, 3, 4, 5, 6 ]
  2. Repeat the checklist n instances (the place n is a few a number of of the everyday sport size)
  3. Shuffle the checklist
  4. To make a “roll”, pop a quantity off of the checklist

The downside with this method is selecting n… too low and we danger operating out of rolls; too excessive and the rolls usually are not biased sufficient.

What algorithms / strategies can be found right here?

It can be useful if the algorithm might be simply defined to the participant.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here