A bit of bad random gen rage

For discussing Torment's story as it slowly gets unveiled, as well as discussing the game's setting. Ninth World discussions encouraged. Spoilers allowed.

Moderator: Memovira Goons

Post Reply
User avatar
monocle
Acolyte
Posts: 59
Joined: March 12th, 2012, 9:30 am

A bit of bad random gen rage

Post by monocle » January 30th, 2016, 9:28 am

7 easy task failures in a row during combat.

sid mayer's thoughts on randomness, very useful:
https://www.youtube.com/watch?v=bY7aRJE-oOY
Javascript, Java, C#, numerous frameworks and design patterns, my spellbook is quite heavy.

User avatar
Nexus
Acolyte
Posts: 88
Joined: January 13th, 2013, 11:40 am

Re: A bit of bad random gen rage

Post by Nexus » February 1st, 2016, 4:12 pm

You know what they say when I play roulette at the casino about the odds of hitting the same number again as the last number?
Technically, the same damn odds as it was to come up last spin! :P

mt1green
Initiate
Posts: 9
Joined: February 14th, 2016, 10:03 pm

Re: A bit of bad random gen rage

Post by mt1green » February 26th, 2016, 5:40 pm

Nexus wrote:You know what they say when I play roulette at the casino about the odds of hitting the same number again as the last number?
Technically, the same damn odds as it was to come up last spin! :P
Your mixing your statistics. He's saying I have an easy task and failed it 7 times in a row. Not sure what the actual odds are for an easy task. Lets assume its 90% chance success. For those 7 attempts, he should get around 6.3 success. Mind you he can still fail all 7 times, but the probability of that should be pretty low.

What you said if you bet on the same number your chances are still the same, which is correct. 1 in X number on the wheel. With combat/ skill check its a range of number you need like a roll of 10+ on a d20. That percentage is significantly higher.

The issue come with the random number generator. These programs consist of seed # and algorithm used to manipulate the seed. If you know the seed and the algorithm you can determine every number it will generate till a new seed is selected. With poor seed generation or crappy algorithm these programs can really get stuck in number generation. In games like this developers will probably use the generator provided by the engine they use. For us players it can be painful or joyful depending on how the generator sticks. Is it rolling tons of 1s or tons of 20s.

kilobug
Adventurer
Posts: 900
Joined: September 21st, 2014, 1:07 am
Location: Paris, France

Re: A bit of bad random gen rage

Post by kilobug » February 26th, 2016, 11:53 pm

Hrm, nowadays you've to really want to screw up to get a broken PRNG. Just use the system's random() function on any POSIX system (or rand() which is slightly less good, but C89), seeded on timestamp at startup and it'll work fine for all non-cryptographic purpose. It won't "get stuck".

The issue can come from two sides :

- how the number is used; rand/random give you an int between 0 and MAXINT, then it's up to the game engine to convert that to a dice roll, apply modifiers, ... and sometimes there is a bug there ;

- the _feeling_ of randomness for humans is very different from maths; in a game you'll roll thousands of dices, so having 7 failure on a row can happen - but it'll feel as a bug, and there are many other similar pyschological effects. Some games actually make their PRNG _less_ random to try to compensate for those issues of the human mind.

User avatar
sear
Developer
Posts: 2533
Joined: March 21st, 2012, 8:30 am

Re: A bit of bad random gen rage

Post by sear » February 27th, 2016, 6:23 am

mt1green wrote:The issue come with the random number generator. These programs consist of seed # and algorithm used to manipulate the seed. If you know the seed and the algorithm you can determine every number it will generate till a new seed is selected. With poor seed generation or crappy algorithm these programs can really get stuck in number generation. In games like this developers will probably use the generator provided by the engine they use. For us players it can be painful or joyful depending on how the generator sticks. Is it rolling tons of 1s or tons of 20s.
I'm not so sure that's what the issue is. I think what is at issue is that humans expect previous random results to bias future ones (even if they logically know this is false): https://en.wikipedia.org/wiki/Gambler%27s_fallacy

I didn't watch the full video, but I believe what Monocle is proposing (and what Sid and Firaxis have done for years) is fudging the math so that players don't feel cheated when repeated or improbable random numbers lead to their failure (i.e. losing on a 1% failure rate, or failing 3 90% success checks in a row). Though correct me if I'm wrong there.

In general, people are very bad about estimating relative values of random odds. For example, if I tell you "you have a 60% chance to succeed" then you'll probably feel mad or even cheated when you fail, because you assumed that "better than half" odds were near-guaranteed success. Some game developers have been faking (or hiding) numbers from players for years for this very reason.

(For what is worth, some of this is built into or is planned to be built into Torment, i.e. if you have an extremely small move to make to interact with an object or attack an enemy in combat, it won't consume movement for the 1 quarter-step you'd need to take. Other examples include when a DT becomes routine, at which point failure is simply impossible and no roll is even made, even if technically the odds aren't exactly 100%.)

mt1green
Initiate
Posts: 9
Joined: February 14th, 2016, 10:03 pm

Re: A bit of bad random gen rage

Post by mt1green » February 27th, 2016, 12:40 pm

sear wrote:
mt1green wrote:The issue come with the random number generator. These programs consist of seed # and algorithm used to manipulate the seed. If you know the seed and the algorithm you can determine every number it will generate till a new seed is selected. With poor seed generation or crappy algorithm these programs can really get stuck in number generation. In games like this developers will probably use the generator provided by the engine they use. For us players it can be painful or joyful depending on how the generator sticks. Is it rolling tons of 1s or tons of 20s.
I'm not so sure that's what the issue is. I think what is at issue is that humans expect previous random results to bias future ones (even if they logically know this is false): https://en.wikipedia.org/wiki/Gambler%27s_fallacy

I didn't watch the full video, but I believe what Monocle is proposing (and what Sid and Firaxis have done for years) is fudging the math so that players don't feel cheated when repeated or improbable random numbers lead to their failure (i.e. losing on a 1% failure rate, or failing 3 90% success checks in a row). Though correct me if I'm wrong there.

In general, people are very bad about estimating relative values of random odds. For example, if I tell you "you have a 60% chance to succeed" then you'll probably feel mad or even cheated when you fail, because you assumed that "better than half" odds were near-guaranteed success. Some game developers have been faking (or hiding) numbers from players for years for this very reason.

(For what is worth, some of this is built into or is planned to be built into Torment, i.e. if you have an extremely small move to make to interact with an object or attack an enemy in combat, it won't consume movement for the 1 quarter-step you'd need to take. Other examples include when a DT becomes routine, at which point failure is simply impossible and no roll is even made, even if technically the odds aren't exactly 100%.)
I understand. I have a degree in Business Information Systems. The degree required two upper class courses on statistics. Statistically I understand that odds are based on 1000s of permutations. What I pointed out, is that no matter how good a computer random number generator is, it's still a mathematical formula, broken down to computer steps. They are generally dependable but can seem very frustrating and depending upon seed/formula cause problems.

User avatar
Firkraag
Adventurer
Posts: 664
Joined: October 28th, 2014, 8:49 am
Location: Ukraine, Kharkiv
Contact:

Re: A bit of bad random gen rage

Post by Firkraag » February 27th, 2016, 1:28 pm

So, what you're saying is, that game mechanic rigs the odds and reinforses a bias for the sake of entertainment value? Interesting... :twisted:
Last edited by Firkraag on March 2nd, 2016, 12:07 pm, edited 2 times in total.
"I am a warhead of weaponized Truth." The Last Castoff (non-canon).

"Colin's period as Jesus was an interesting time." © Brother_None

tonurics
Explorer
Posts: 404
Joined: July 31st, 2014, 5:32 pm

Re: A bit of bad random gen rage

Post by tonurics » February 29th, 2016, 8:13 pm

mt1green wrote:With poor seed generation or crappy algorithm these programs can really get stuck in number generation. In games like this developers will probably use the generator provided by the engine they use.
I believe the PRNG in Torment is: xorshift128+ [which is what we used for WL2]; it passes all of the BigCrush tests from the TestU01 suite. V8 recently switched to it, so there's been a lot of people talking about it.
This account is dormant. I won't be responding to threads, quotes or private massages.

kilobug
Adventurer
Posts: 900
Joined: September 21st, 2014, 1:07 am
Location: Paris, France

Re: A bit of bad random gen rage

Post by kilobug » March 1st, 2016, 1:01 am

tonurics wrote:I believe the PRNG in Torment is: xorshift128+ [which is what we used for WL2]
If I may ask, why not use the system's (libc) random number generator and re-implement one in the game ? Is there any specific reason for that ? Is it such low quality on some systems or something like that ?

tonurics
Explorer
Posts: 404
Joined: July 31st, 2014, 5:32 pm

Re: A bit of bad random gen rage

Post by tonurics » March 1st, 2016, 11:44 am

:ugeek: Something like that: the libc RNG implementation on a player's system is unpredictable; it could be great or it could be awful, it's an unknown. But since the RNG is a very core component, the risk of it simply being "different" is too great. When we balance the gameplay: we want all users to experience the same amount of randomness [or difficulty] as everyone else, regardless of where they are playing. Having a PRNG with a known level of quality allows us to do that and not lose any sleep.
This account is dormant. I won't be responding to threads, quotes or private massages.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest