You have been taken by the Mists

Author Topic: "Random" Number Generation  (Read 10473 times)

Knas

  • Developers
  • Head DMs
  • Dark Power
  • ******
  • Posts: 8733
  • Worthless phony
Re: "Random" Number Generation
« Reply #25 on: February 13, 2014, 06:59:37 PM »
worse is how 50% of the time improved invisibility potions do not make anything.
(The effects that are tied to the potion do not work...I think i died more cuz of this bug than the roll 9 times twenty out of 10 rolls, which did happen to me...)


 :awesomeface:  Suuure

Bad_Bud

  • Developers
  • Dark Power
  • *
  • Posts: 4576
Re: "Random" Number Generation
« Reply #26 on: February 13, 2014, 07:02:13 PM »
worse is how 50% of the time improved invisibility potions do not make anything.
(The effects that are tied to the potion do not work...I think i died more cuz of this bug than the roll 9 times twenty out of 10 rolls, which did happen to me...)


 :awesomeface:  Suuure

Nah, it's true.  It's not random though.  You have to stand still after consuming a potion of Improved Invisibility.  If you move or take an action immediately after consuming one, the invisibility never applies.

Anonymoose

  • Guest
Re: "Random" Number Generation
« Reply #27 on: February 13, 2014, 07:27:46 PM »
worse is how 50% of the time improved invisibility potions do not make anything.
(The effects that are tied to the potion do not work...I think i died more cuz of this bug than the roll 9 times twenty out of 10 rolls, which did happen to me...)


 :awesomeface:  Suuure

Nah, it's true.  It's not random though.  You have to stand still after consuming a potion of Improved Invisibility.  If you move or take an action immediately after consuming one, the invisibility never applies.

"Hey Teemo, please stand still so I can use my Noxian Guillotine" - Darius

Nah but seriously, I've noticed this TERRIBLÉ bug

Ercvadasz

  • Dark Power
  • ******
  • Posts: 1109
Re: "Random" Number Generation
« Reply #28 on: February 14, 2014, 12:04:33 AM »
worse is how 50% of the time improved invisibility potions do not make anything.
(The effects that are tied to the potion do not work...I think i died more cuz of this bug than the roll 9 times twenty out of 10 rolls, which did happen to me...)


 :awesomeface:  Suuure

Nah, it's true.  It's not random though.  You have to stand still after consuming a potion of Improved Invisibility.  If you move or take an action immediately after consuming one, the invisibility never applies.

"Hey Teemo, please stand still so I can use my Noxian Guillotine" - Darius

Nah but seriously, I've noticed this TERRIBLÉ bug

Or if you are being hit.
Sometimes that does not make the potion work neither.
Currently playing:
Rudrig von Rachenthall - the travelling merchant

Ercvadasz

  • Dark Power
  • ******
  • Posts: 1109
Re: "Random" Number Generation
« Reply #29 on: June 30, 2015, 12:14:43 AM »
worse is how 50% of the time improved invisibility potions do not make anything.
(The effects that are tied to the potion do not work...I think i died more cuz of this bug than the roll 9 times twenty out of 10 rolls, which did happen to me...)


 :awesomeface:  Suuure

Nah, it's true.  It's not random though.  You have to stand still after consuming a potion of Improved Invisibility.  If you move or take an action immediately after consuming one, the invisibility never applies.

"Hey Teemo, please stand still so I can use my Noxian Guillotine" - Darius

Nah but seriously, I've noticed this TERRIBLÉ bug

Or if you are being hit.
Sometimes that does not make the potion work neither.

Died of it again...[sigh]
Currently playing:
Rudrig von Rachenthall - the travelling merchant

McNastea

  • Dark Power
  • ******
  • Posts: 1615
  • "We want to make all the rules" -Misakato
Re: "Random" Number Generation
« Reply #30 on: June 30, 2015, 12:58:34 AM »
I'd have to agree with approgressivist on this one. Humans look for meaning and patterns in things and create them even when they aren't there, so when you're crafting and get a string of numbers that are all near to each other or even the same you figure that there must be something wrong when in fact each roll has nothing at all to do with the one before or after or three rolls before or three rolls after and so on. Each is a new roll and is an entirely separate event from any of the others. Statistically, if you rolled d20 and got say a 16, the odds of rolling another 16 are in no way increased or diminished because of that first roll. They are the same, always. There is no pattern-you create the illusion because that's what your brain is programmed to do, find meaning in things.
Eilithar Cael'aera | Eowaril | Rowan Tallstag | Tobias Loarca | Kiiren Josivir

Merry Munchkin

  • Dark Lord
  • *****
  • Posts: 934
Re: "Random" Number Generation
« Reply #31 on: June 30, 2015, 01:17:30 AM »
Also, we tend to not pay as much attention to successful rolls than unsuccessful rolls.  Most of the time in combat or crafting, we enjoy the "hits" without reflecting on the number, and freak out over the "misses" and pay close attention to those numbers.  Thus, we tend to notice the bad streaks more than the good streaks.


Burleigh Burrowell - RIP

Jeebs

  • Dark Lord
  • *****
  • Posts: 952
Re: "Random" Number Generation
« Reply #32 on: June 30, 2015, 02:50:37 AM »
I remember rolling a character for a PnP game some years ago, where my DM was laughing and saying you're generally lucky to roll even a 14... all my ability rolls were 16s, except for one 14 and an 18... so yes, streaks can and do happen even with true randomness. The look on his face though....  :lol:

Thoraion

  • Undead Master
  • ****
  • Posts: 398
Re: "Random" Number Generation
« Reply #33 on: July 12, 2015, 03:53:52 PM »
From my experience i can confirm the "clustered" random Numbers. Time definitely plays a role there. Bad in fights, exploitable in crafting just by Waiting a few Minutes When Results focus in the lower Range of possible Results.
Prohibited? Don't be ridiculous.
Currently playing:
no characters, will eventually be back

Characters in stock:
- Darian Eisenhand        - Ansgar "Frettchen" Ostvent
- Thorben Eibenfinder    - Einar Falkensang

de_reguer

  • Undead Slayer
  • ***
  • Posts: 109
Re: "Random" Number Generation
« Reply #34 on: July 13, 2015, 12:43:32 AM »
From my experience i can confirm the "clustered" random Numbers. Time definitely plays a role there. Bad in fights, exploitable in crafting just by Waiting a few Minutes When Results focus in the lower Range of possible Results.
Prohibited? Don't be ridiculous.

I don't really understand the specifics of it, but the string of clustered numbers definitely exists, and is a known "bug" of the NWN system. A DM who knew something about coding explained to me a long time ago on another server. it has something to do with each cell having a preset number sequence embedded in it as you enter it. So NWNs random number generator isn't random at all. It follows a genuine formula that just has the appearance of randomness, and I think each number generated is somehow tied to the one immediately before it. That's where the weird strings of clusters can come from. The upside is it can also work in the players favor. I have seen numerous times over the years strings of 4 and 5 crits with a weapon that has a 10% or 20% chance to score one.

DrXavierTColtrane

  • Dark Lord
  • *****
  • Posts: 737
Re: "Random" Number Generation
« Reply #35 on: July 13, 2015, 04:44:48 AM »
I don't know whether the NWN random number generator is flawed as you describe, but getting 5 criticals in a row with a 10 percent chance is not dispositive that it's wonky if you've seen it "over the years." The chance of getting a second critical right after a first is 10 percent. A third is then 1 percent and so on. So five in a row should happen once every 10,000 criticals. That's low, but how many critical hits have you had "over the years"? If you've had 60,000 initial criticals, than you would have *expected* (mathematically) to have followed 6 of those with 4 more consecutive criticals--even though your chance each time was low.

I kind of wonder about NWN myself, but pseudorandomness that approaches actual randomness is so easy to program I would have to presume it intentional if a decent game programmer had made a game that the randomness was so bad end users could prove it.
For everything that's lovely is
But a brief, dreamy, kind delight.

Merry Munchkin

  • Dark Lord
  • *****
  • Posts: 934
Re: "Random" Number Generation
« Reply #36 on: July 13, 2015, 08:38:41 PM »
I don't really understand the specifics of it, but the string of clustered numbers definitely exists, and is a known "bug" of the NWN system. A DM who knew something about coding explained to me a long time ago on another server. it has something to do with each cell having a preset number sequence embedded in it as you enter it. So NWNs random number generator isn't random at all. It follows a genuine formula that just has the appearance of randomness, and I think each number generated is somehow tied to the one immediately before it. That's where the weird strings of clusters can come from. The upside is it can also work in the players favor. I have seen numerous times over the years strings of 4 and 5 crits with a weapon that has a 10% or 20% chance to score one.

Interesting.  If this is highlighted quote is accurate (and I don't know how NWN is programmed), then the game engine uses something similar to what is called the "middle-squares" method of generating a key number.  By way of background, a mathematical "random" number generator, as people have noted, does not actually generate "random" numbers.  Think of it as the equivalent of a cypher machine (for making and breaking secret codes, like ENIGMA or PURPLE in WWII).  It uses a numeric seed value as its starting "key", and from this key it uses a mathematical algorithm to generate a sequence of numbers that appear to be random, but in fact follow a predictable mathematical pattern if you know the key.  Any sequence that is generated from the same key value will be identical.  Thus, if you know the key value, you can predict the pattern if you have the algorithm.  This is how code breakers break down enemy cyphers.


This type of "random" number generator in a computer game like NWN has its algorithm fixed, but the key (seed value) can be changed, resulting in different strings of numbers.  Thus, the critical element in making a string of numbers appear to be as random is being able to generate a wide variety of starting seed values/keys. 

John Von Neumann developed a simple way to quickly generate random-ish numbers for creating keys (at least simple for a computer) called the "middle squares" method -- to generate a sequence of 4-digit numbers (for example), you start with a 4-digit number which is then squared, producing an 8-digit number. The middle 4 digits of the result would be the next number in the sequence. This process is then repeated, squaring this new 4-digit number to generate a new number and so on.  Thus, each value is predicated on the values before it.  This process creates the "random" 4-digit seed value for the computer to plug into its algorithm.  For simple game purposes, this process would generate a sufficiently large number of keys that people would not necessarily notice if the same key was used later on.

It is not the most sophisticated way to create a cypher, but it works for something as simple as a game like NWN.  However, these types of generators do produce odd quirks if the length of the numbers used is too short, or has zeros at the beginning of the number, or other wonky things.  The trick is to develop a way to generate these random-ish numbers quickly, so that the computer doesn't slow down to a crawl -- the more sophisticated the method used, the more computing power it takes.

This doesn't explain why you see repeats in sequences in any given series, but it is an interesting insight into the game engine.  At least I thought it was interesting.  But then again, I am weird about puzzles and numbers.



Burleigh Burrowell - RIP

Syied

  • Undead Slayer
  • ***
  • Posts: 127
  • Back from the Mists.
Re: "Random" Number Generation
« Reply #37 on: July 29, 2015, 02:34:47 AM »
What McNastea said. When you get a run of bad rolls and wait it out before resuming your rolling, and then feel better about your new results, the reason you feel better is because that recess allowed your mind to defocus on the negativity and psychosis of the previous results, essentially forgetting their (ir)relevance.

Don't go chasing order in NWN's randomness; it's all in your head. But don't worry, because we all belong in a loony bin anyway  ;). Instead of trying to unravel why you occasionally get three 1s in a row, try having your character be bewildered at such results and develop insane superstitions about it IC!   :lol:

APorg

  • Dark Power
  • ******
  • Posts: 5336
  • Fanatic Xenophile
Re: "Random" Number Generation
« Reply #38 on: July 29, 2015, 04:54:37 AM »
“Moral wounds have this peculiarity - they may be hidden, but they never close; always painful, always ready to bleed when touched, they remain fresh and open in the heart.”
― Alexandre Dumas, The Count of Monte Cristo