News for hackers. Stuff that matters.
Re:How Designers Engineer Luck into Video Games by ooqr on Saturday January 14, 2017 @09:53AM (#13398609)
Is there in general a formula for fudging statistics in the direction of bias? I.e., 90% becomes 99% as 10% becomes 1%? Was there a general algorithm you used. I'd be interested in hearing the technical details.
Re:How Designers Engineer Luck into Video Games by emptybits on Sunday January 15, 2017 @12:33PM (#13405119)
What you describe (non-linear) would probably have been superior but in my youth and inexperience over 15 years ago (and pressed with time and code-size constraints) I am sure I did nothing more than a scalar, maybe clamped with a C macro MAX() or MIN(). Sorry to disappoint; sometimes game AI and sim work just needs to be "good enough" and ... most importantly, needs to ship on time (on shelves, yes shelves, X weeks before opening day of baseball season) with zero bugs (no online patches in those days). So there is a certain satisfaction in that. :-)
Re:How Designers Engineer Luck into Video Games by ooqr on Sunday January 15, 2017 @01:31PM (#13405495)
Thanks for the reply.

I came up with:

f(x) = (sin((pi * x) - (pi / 2)) + 1) / 2 where x is between 0 and 1

I'm a collector of randomness functions for games. Weighted, gaussian, linear, etc. This sinusoidal randomness will be handy! Thanks for the inspiration.