-Alternate Title: Everyone is stupid except me-
TL;DW: The max value in the function used for random numbers in the game engine, Clickteam Fusion, overflows after 65,535, meaning Golden Freddy is actually running Random(34464) and Shadow Bonnie is running Random(16960). Also, because Clickteam Fusion only generates 16-bit integers, the Random Number Generator can only represent probabilities out of 65,536, which can be pretty inaccurate. Taking this into account means that Golden Freddy is actually 1/32,768 and Shadow Bonnie is 1/16,384. There was also a glitch with the game engine on Android that caused the Random Number Generator to output incorrect numbers, which made Golden Freddy impossible to encounter normally (on Android only).
Huge thanks to Folmic, Yunivers, and others for helping make this video possible; I appreciate it a ton ❤️
*Become a Taken+ member for only $0.99 (at participating restaurants):*
_*Additional Notes and context:*_
*Note 1 (0:26):* _While I sort of imply that the issue with Golden Freddy's odds is a glitch, it seems to be an intentional (or at least known) limit of the game engine. It's an odd limit, and isn't immediately obvious, so I don't fault anyone for not knowing._
*Note 2 (2:55):* _You can calculate exactly what number it overflows to by doing modulo 65536._
*Note 3 (3:40):* _In order for Enemy Snowball attack damage to overflow, your health needs to exceed 65,535, which is only possible at level 13,087 or above. Because counters (including exp) are limited to 999,999,999, natural character levels are limited to below 10,000._
*Note 4 (4:32):* _We're only interested in errors with Random(x) being out of the normal range, and Jack-O-Chica is the only one that both directly uses Random(AI) and functions below 1 AI. There are other animatronics that function below 1 AI, but they aren't affected by this limitation._
*Note 5 (5:50):* _This bias is equivalent to modulo bias, but because the implementation actually uses a bitshift, the specific numbers that are affected are different/spread out, and the average is barely impacted._
*Note 6 (6:09):* _In this case, I obviously wouldn't actually consider implementing rejection sampling. Changing the RNG to use 32-bit (or just using the built-in rand functions) would alleviate any significant bias._
*Note 7 (6:40):* _My phrasing of "simulating the RNG" might be concerning, but I just mean calculating the number of RNG seeds that would cause Golden Freddy/Shadow Bonnie to spawn, not simulating the RNG millions of times, which would be inaccurate._
*Note 8 (6:57):* _This was actually found before the RNG bias, but it flows best when it's placed after it {:}_
*Note 9 (7:43):* _Woo, the actual implementation! This is an implementation of a Linear Congruential Generator (LCG) with the parameters a = 31415, c = 1, and mod 65536. I can generally consider all seeds to be equally likely because the chosen starting seed is based on your computer time in milliseconds, and there's nothing too wrong with these particular parameters._
_One thing to notice, though, is that the period for all seeds is m/4 or 16,384. This means that all seeds can be grouped into 4 long loops. For anything as/more common than 1/16,384, there will be at least 1 chance in every group, but Golden Freddy is 1/32,768 and groups 1 and 4 do not include him. This should not impact his odds much, as he only ever checks his RNG 535 times, and the starting seed is initialized every time you enter a new frame/new night._
_This is, however, actually an issue in the modern Clickteam Fusion Windows runtime, as some error is causing it to only generate starting seeds in groups 1 and 4, and Golden Freddy wouldn't be possible if the game was updated. This is not a problem in any other runtime, so the remasters are not affected by this, not even the Microsoft Store version, as that uses the UWP runtime._
Music Used (in order):
Mini-Golf Intro - Five Nights at Freddy's: Security Breach _(SiIvaGunner)_ ()
Super Mario 64 - File Select (fakeout)
Just Add Water - Freddy Fazbear's Pizzeria Simulator
Thank You For Your Patience - Freddy Fazbear's Pizzeria Simulator
Title Theme (Beta Mix) - Freddy Fazbear's Pizzeria Simulator _(SiIvaGunner)_ ()
Title Theme - FNaF 1 - 7
Last Breath - Ultimate Custom Night
Shop - Five Nights at Freddy's AR: Special Delivery
Credits - Freddy Fazbear's Pizzeria Simulator
In-use throughout the video, “VHS Gothic Condensed” () by Spottie Leonard is licensed under a Creative Commons Attribution-Share Alike license ().
Chapters:
0:00 Intro
0:24 FFPS Stat Glitch
2:31 What This Changes
5:11 Let's Be Precise
6:53 But Wait... There's More!
8:35 Outro