Skip to content

Commit a8aadbc

Browse files
authored
Update README.md
1 parent 5167795 commit a8aadbc

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,29 @@ __int64 __fastcall rand()
2828
}
2929
```
3030

31-
The original implementation of random for the Infinity Engine uses the specific variant of a [linear congruential generator](https://en.wikipedia.org/wiki/Linear_congruential_generator)
32-
shown above.
31+
The original implementation of random number generation in the Infinity Engine relies on a specific variant of a linear congruential generator, as shown above. However, versions of the game
32+
running on platforms other than Windows, such as Linux, utilize different approaches by making system-level calls to the rand() function. As a result, they may not encounter the same issues
33+
inherent in the original implementation.
3334

34-
Versions of the games on platforms outside of Windows (E.g. Linux) don't utilize this implementation, but instead perform library calls to a system level rand() function; thus, they
35-
don't necessarily suffer from the same defects.
35+
One notable consequence of this difference is that platforms with superior pseudo-random number generators may exhibit a higher likelihood of consecutive high rolls, such as consistently
36+
rolling the maximum value (e.g., rolling all 6's during an ability roll).
3637

37-
One consequence of the difference is that other platforms with better pseudo random number generators may have a higher probability of high consecutive rolls (e.g. rolling all 6's
38-
during an ability roll).
38+
This distinction becomes particularly evident when observing ability autorollers. With the original algorithm, the occurrence of ability roll totals surpassing 104 seems highly improbable, if
39+
not impossible. However, when running an autoroller for an extended period on a Linux system with a different algorithm, roll totals of 105 and 106 do occur.
3940

40-
This can be best seen with ability autorollers. With the original algorithm, it appears to be extremely unlikely (or perhaps even impossible) for roll totals that are higher than 104.
41-
In Linux, on the other hand, 105 and 106 can readibly be seen after allowing an autoroller to run for a significant amount of time.
41+
The provided table presents the probabilities of obtaining specific roll totals, along with their corresponding normalized and rounded relative probabilities. These relative probabilities serve
42+
to highlight the relative disparity between the likelihood of rolling one specific total compared to another. For example, if you roll 104, you can anticipate rolling 103 approximately 4.399 times
43+
on average. Of particular note is that the likelihood of rolling 105 should be only about 5.25 times less likely than 104.
44+
45+
46+
| **Roll Total** | **Probability of Occurrence** | **Normalized to 103** | **Normalized to 104** | **Normalized to 105** | **Normalized to 106** | **Normalized to 107** | **Normalized to 108** |
47+
|---------------:|------------------------------:|----------------------:|----------------------:|----------------------:|----------------------:|----------------------:|----------------------:|
48+
| 103 | 1 in 3856609580 | 1 in 1 | | | | | |
49+
| 104 | 1 in 16969082150 | 1 in 4.399 | 1 in 1 | | | | |
50+
| 105 | 1 in 89087681288 | 1 in 23.099 | 1 in 5.250 | 1 in 1 | | | |
51+
| 106 | 1 in 593917875254 | 1 in 153.999 | 1 in 35.000 | 1 in 6.666 | 1 in 1 | | |
52+
| 107 | 1 in 5642219814912 | 1 in 1462.999 | 1 in 332.500 | 1 in 63.333 | 1 in 9.499 | 1 in 1 | |
53+
| 108 | 1 in 101559956668416 | 1 in 26333.999 | 1 in 5985.000 | 1 in 1140.000 | 1 in 170.999 | 1 in 18 | 1 in 1 |
4254

4355
## Prerequisites
4456

0 commit comments

Comments
 (0)