[MUD-Dev] [DGN] The psychology of random numbers
Byron Ellacott
bje at apnic.net
Fri Jan 30 10:31:59 CET 2004
On Wed, 2004-01-28 at 21:18, Daniel.Harman at barclayscapital.com wrote:
> I think Ben Hawes has a valid point in his post where he suggests
> that people expect gaussian distributions, and not the typical
> flat distributions that rnd() should produce. So in the case of
> your puzzle game, perhaps intuitively they expected you to roll
> the interval until the next bonus using a gaussian distribution
> mean 7 with SD of 2 or so. This of course forces you to store
> state describing when the next event will occur, which most
> programmers will naturally avoid prefering to be stateless
> checking against a percentage periodically. With the stateful
> approach you won't get much streakiness and will imho better fit
> player expectations. Of course having a sliding bias does pretty
> much the same thing.
You shouldn't need to store state. Rolling 2d6 gives a gaussian
distribution, but 1d6 is a "flat" distribution. Yes, I'm aware that
modulo isn't desirable, but:
int gaussian = (random() % 6) + (random() % 6);
I sometimes use the combination of two random numbers to keep things
"in the middle" of the distribution more often than not.
--
bje, not speaking for my employer
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list