be me
everyone apparently working on porting GTA 6 to PC
decide to contribute by playing Baldur’s Gate again
make a human Cavalier
just need some decent stats before leaving Candlekeep
94, not enough
vibecode autoroller
improve it so it reaches over 10k rolls/s
number goes up
eventually the counter passes 300 MILLION rerolls
best result still 103, exceptional Strength 18/86
surely I am just incredibly unlucky
this reasonable thought somehow becomes an investigation of the executable
recreate the ability generation function
check it against the actual machine instructions
enumerate every RNG state
find that 104 exists
and 105
and 106
discover my reroll trajectory loops forever without visiting any of them
congratulations, I have optimized not playing Baldur’s Gate
still on character creation screen
Gorion died of old age
The 300 million attempts were the reason to investigate. The proof came later.
For a human Paladin or Cavalier, the isolated sequence of ordinary rerolls starting from RNG state 1 enters a cycle with:
- 16,519,282 rerolls per full 32-bit state cycle;
- twelve results totalling 102;
- two results totalling 103;
- zero results totalling 104, 105 or 106.
Once you are in that cycle, another billion identical rerolls will not help.
But 103 is not a hardcoded cap. Searching the entire RNG state space gives a global maximum of 106 for that character. The higher results exist outside that particular trajectory.
We also got 104, 105 and 106 in the running game, using the original ability generation function. The experiment consumed precisely calculated numbers of extra RNG outputs through Lua before asking the engine to reroll. No stat editing, injected RNG state, changed dice or changed ability requirements.
That was a targeted demonstration, though. One extra random call is not a magic “give me 106” button.
Naturally, this was the point where the sensible thing to do was analyse every race, class and kit combination.
The completed analysis covers 434 table-derived configurations:
- 430 have feasible ability requirements;
- 4 have contradictory requirements;
- 201 pass the game tables’ availability filters;
- 146 of those 201 have a seed-1 reroll cycle whose maximum is below their global maximum.
Some examples:
| Character | Maximum across all RNG states | Maximum in the seed-1 cycle |
|---|
| Human Fighter | 101 | 100 |
| Human Mage | 102 | 102 |
| Human Paladin / Cavalier | 106 | 103 |
| Elf Ranger / Archer | 105 | 104 |
Other configurations reach 104 or 105 inside their cycles. There is no universal “the game caps at 103” rule.
The highest global maximum anywhere in this analysed set is 106. 107 and 108 never occur under the investigated generator and ability rules, even when considering every starting RNG state. Exceptional Strength is separate from the six-stat total.
And before anyone gives me discovery credit: people had already identified this problem years ago. Credit to Faydark for the autoroller, ekobalal and drake127 for the earlier investigation, and drake127 for Random Rolls. The old Beamdog discussion already contains the repeating-roll observations and RNG diagnosis.
What this project adds is an exhaustive, reproducible analysis of the investigated Windows BGEE 2.7.3 executable, exact cycle lengths and histograms, and results across all the resolved configurations.
Important distinction: the cycles above are isolated reroll sequences starting from state 1. Other RNG consumers in a real game can change the trajectory. We did not prove that every session follows the same cycle.
I wanted a character with decent stats.
I now have checkpoint files, an RNG model and a reproducibility package.
Candlekeep remains undefeated.