YTread Logo
YTread Logo

Ruining FNaF by Dissecting the Animatronics' AI | Tech Rules

Ruining FNaF by Dissecting the Animatronics' AI | Tech Rules
this video has been sponsored and approved by Skillshare beware the scenes that you'll find in this educational video might be disturbing to some viewers it contains scenes of graphic education and okay this is a dumb bit it's not necessary anyway because this video is gonna be the opposite of scary you know how when you have to explain a joke it's not funny anymore I think the same could be easily applied to horror this is not an excuse for missing a Halloween upload by three months and you cannot prove otherwise a lot of the fear that these kind of things instill in you is through making you ask questions what exactly is out there what does it want from me is it going to kill me these kind of questions are what five nights at Freddy's capitalizes on you're thrown in a room that isn't safe and you can't escape from it you can observe these

animatronics

approaching you but you can't stop them all you can do is wonder well wonder no longer because I think it's safe to say that five nights at Freddy's is by most definitions pretty dead I'm not saying the finessed series itself is dead or anything by the way like it wasn't even a little while ago they released that mobile game where you have to spin around in circles looking really scared I'm talking about the original standalone title the very first five nights at Freddy's and what do you do in fascinating creatures die you dissect them at this point it's not really a...
ruining fnaf by dissecting the animatronics ai tech rules
secret that you can decompile older clickteam fusion games returning them to their original project file format the nice thing about this is that clickteam fusion itself is a block based coding software which essentially means coding in it is very fast and simple while in a normal situation I would have to spend a monumental amount of time reverse engineering everything and figuring out what each line of code and variable does I managed to completely document everything I wanted to know about both this game and how every character behaves in less than a couple hours it notates itself really to be honest it was so easy that it made me kind of uncomfortable I certainly wouldn't want someone else decompiling my software to scrutinize every line of code and coding decision I've made but I suppose the least I can do is refrain from showing the original code for things and just focus on what the code does action not words right speaking of which I'm trying something a little different for this video as far as background visuals I did record some gameplay of five nights at freddys for the video but as it turns out watching somebody flick through cameras the whole time without error looks really boring that's why we're using let's players for this videos background footage considering that's kind of what the game is known for anyway I imagine none of these faces need any introduction but just in case you can find their channels in the description in order...
ruining fnaf by dissecting the animatronics ai tech rules
of appearance but putting that aside welcome to

tech

rules

but before that a huge thanks to Skillshare for sponsoring today's video when it comes to learning unique skills like putting together an educational video designing your own smash hit horror game or just picking up important skills that will help you all throughout life there's no better way to learn than from the experts themselves that's where skill share comes in skill share is a community of passionate teachers and creators who want to share that passion with you you can learn a countless amount of new skills here whether you're trying to get into a new career or just want to take that hobby you love to the next level if you're wondering where you should start might I recommend this class real productivity how to build habits that last a class hosted by a fellow youtuber that goes over vital skills for making results if you're anything like me you'll definitely want to give this one a try and if you click the convenient link in the description you can start the year off right by getting two months of Skillshare premium absolutely free and if you want to keep that learning streak going you can continue the subscription afterward for only around ten dollars a month so give Skillshare a shot and start expanding your abilities today I suppose if I'm going to explain all of the

animatronics

AI I should at least start with the basics it has been a while since the game came out after all...
ruining fnaf by dissecting the animatronics ai tech rules
so it's probably easy to forget some of the smaller details five nights at Freddy's features four main

animatronics

Freddy Bonnie chica and foxy for the sake of unnecessary categorization let's put Freddy Bonnie and chica in a category named bullies because they're constantly harassing you and let's put the remaining

animatronics

in a group called foxy because that's his name the bullies constantly move around during the night and approach your office forcing you to keep track of them and closed doors when necessary foxie on the other hand acts a little more chilled / aggressive he spends most of his time in Pirates Cove only leaving to slam into your office door at max speed the trigger for this is poor camera usage the less you use the camera to keep them in place the more he inches off the stage and if he escapes you only have a short amount of time to close the door and force him to run back when one of the bullies gets to their final destination which can either be in or outside your office depending on the animatronic they won't attack you immediately instead they'll just get comfortable and wait for you to open the camera foxy is the counter to the strategy because he does not care what you're looking at he just wants to eat you you could just let him charge you and then block them with your door but that takes away from your precious power that you need to preserve throughout the night the first time he charges he takes away 1% and...
that penalty increases by 6 percent every time he does it that means if you don't keep him locked down your power is going to plummet evading Bonnie and chica is simple though if they show up at your door close it they'll eventually go somewhere else Freddy however never backtracks you can use the camera to impede his progress but he'll eventually get to the corner of the hallway right next to the office from here he'll wait until you're busy looking at a camera other than his and attack assuming you left the door open for him to get in that's about the extent of this game's common knowledge so you might be wondering if people have already figured out that much how much could there be left to know a lot actually in fact I would go as far as to say that information is bare-bones when it comes to how this AI works that probably seems like an absurd claim considering how popular the game became and how much the AI was closely studied in order to beat the notorious 2020 2020 mode where all the

animatronics

are said to max aggression in this scenario how could people have possibly missed the rest well that would be because the game is intentionally designed to have an extremely confusing and inconsistent AI almost every action or decision the

animatronics

can take have some sort of luck factor to them and I do mean almost every single one of them that makes it hard to understand how the AI truly works because patterns people may pick up on might just be...
a result of lucky quints it's part of the game's horror aspect actually the more unpredictable your potential robotic killers are the more naturally terrifying they are after all your ability to keep tabs on what they're doing is literally the only thing that's keeping you from a jump-scare and subsequent death some of the things I'm about to talk about we're already discovered by creative people who tried things based on a hunch but the only reason I'm able to tell you most of this is because I'm looking at the game's code otherwise I would only know a fraction of it which brings me to my next point the hold seeing patterns where there actually aren't anything yeah it happened a lot actually in fact let's do a little true or false game with some of the most common theories gameplay theories I should mention not lore I'm not opening up that can of worms anyway feel free to follow along see how many of these you actually get right theory you have to look at foxy to keep him in Pirates Cove but looking at him too much will cause him to be aggressive answer false this one isn't even hard to test but it seems so common just set Fox's AI 220 and start flipping the camera up and down you'll see that he can't move an inch more on how foxy works later theory you don't actually have to look at foxy to keep him away camera usage is the only thing that matters answer true actually this is something that's genuinely...
helpful to know too because it lets you keep the camera on something more important usually Freddy I feel like more people should know this though because the game literally tells you something along those lines Siri when you run out of power don't move this will give you a little time before Freddy attacks answered false I'm pretty sure this theory comes from the game to people understandably interpreted this as a hint but surprisingly there's nothing in here that checks whether or not you're moving during the blackout phase the duration of each blackout phase is extremely variable so I can see how easy it would be to believe this just because of sheer confirmation by okay last one theory there's a hole behind the freddy fazbear poster in the office that Freddie can use to bypass the door answered what I know it sounds like I'm making this up but I used to hear this all the time back in 2014 my best guess is the theory came from this old markiplier video where he closed both doors and still got attacked shortly after I'll explain why that can happen in a second but that's definitely not why I can't find evidence of anyone saying this now but I swear I'm telling the truth so when in the comments back me up on this please prove to everyone that I'm not crazy including myself I guess anyway the point I'm trying to make here is a lot of these incorrect theories we're just as highly regarded as the correct ones which I guess is...
a testament to how well the game kept its secrets hidden it almost makes me want to refrain from revealing everything about the AI unfortunately almost isn't enough let's begin I'm gonna guess the thing people are most interested in learning about is probably the AI aggression system essentially this game has a custom night mode where you can set each individual animatronic to an AI level ranging from zero to twenty with zero being completely deactivated and twenty being obviously maximum aggression also if you select one 987 the game does this this mode was really popular not only because it resulted in an extremely difficult challenge that returned in almost every game but also because well it was just really cool that the developer went out of his way to develop a custom mode like this well I suppose I should mention one thing it probably didn't take much effort to implement this at all because the zero to 20 AI system is actually used throughout the entire game in fact I have the numbers right here to share with you night 1 uses AI levels zero zero zero zero night 2 uses zero three one one night three uses one zero five two night four has a random chance of either being one two four six or 2:246 night five uses three five seven five and night six uses four 10 12 16 being the only night to actually hit double digits this list is probably raising some red flags right after all I did say the AI level 0 means the animatronic is disabled despite the fact that...
night 1 has zeros all across the board that shouldn't make sense because night 1 still has plenty of movement from the three

animatronics

that's because the game does something really sneaky as it turns out animatronic AI levels actually increase as the night goes on at 2:00 a.m. Bonnie goes up 1 AI level at 3:00 a.m. everyone but Freddy goes up 1 AI level and at 4:00 a.m. everyone but Freddy goes up yet another AI level that means that night ones AI levels are 0-3 to 2 by 4 a.m. and night 6 goes as high as 4 13 14 18 with foxy being only two levels away from his max AI this also means that Freddy is the only animatronic that does not get a level increase throughout the night and as such is the only one that will remain disabled the entire night so if you plug those numbers into the custom night mode you'll get an experience that's similar to playing on that night however there will be one major difference and that difference is power drainage when you get to night 2 and onward extra penalties are added to your power consumption the penalty in question is dropping your power by 1% every few seconds how many seconds it takes depends on the night night 2 takes one every 6 seconds night 3 every 5 seconds night for every 4 seconds and night 5 and onward every 3 seconds that being said the custom night mode also shares the 3 second penalty so using the AI levels of night 5 and 6 will also give you an almost identical experience with no noteworthy differences...
it's also important to mention that these levels can never go higher than 20 well they can but it doesn't make the

animatronics

any more aggressive the reason for that is simply because the AI levels are in a way percentage-based here's how five nights at Freddy's uses these numbers approximately every 4 or 5 seconds the

animatronics

are allowed to do what we're going to call a movement opportunity the game decides whether or not each animatronic is allowed to move during this opportunity by sheer luck the game will pick a random number between 1 and 20 that number is then compared to the

animatronics

current AI level if the level meets or exceeds the random number than the animatronic will move this makes the AI levels sort of like percentages AI level 1 gives the animatronic a 1 in 20 chance or a 5% chance to move at every movement opportunity AI level 5 will give them a 25% chance 10 will give them 50% and finally a maxed out AI level of 20 will give the animatronic a guaranteed 100% chance to move at every single movement opportunity this won't make each a no tronic move at the same time though they each take a slightly different amount of time to get their movement opportunity Freddie gets one every 3.0 two seconds bonnie every 4.9 seven seconds chika every 4.9 eight seconds and foxy every 5.0 one seconds so while the

animatronics

will be able to move at similar times at the beginning their movements will quickly D synchronize when one of the...

animatronics

exceeds their movement opportunity they'll you know move chico will randomly choose adjacent rooms on the right side and bonnie will straight up teleport to different rooms on the left just because it feels like it that's Lorne out that's Canada foxy on the other hand he uses his movement opportunities a bit differently every successful movement opportunity will advance him one face closer to attacking but as we mentioned his greatest weakness is the cameras themselves while the cameras are on foxy goes into a state that will simply call locked while a little lock state foxy will automatically fail all of his movement opportunities regardless of what random number he pulled or what his AI level is he'll remain locked the entire time the cameras are on however when you finally turn the cameras off he doesn't immediately spring back into action in fact he'll remain locked for a random amount of time that can range from around zero point eight three seconds to around sixteen point six seven seconds it gets very specific to the random amount of time the game decide song can literally be any frame between the two numbers so yeah quite a range once he hits phase four he'll attack either when you check the left hall or went around twenty-five seconds is best if blocked by the door he'll take whatever amount of power he's supposed to at the time and immediately return to Pirates Cove starting in either phase one or two you probably...
know what happens if the door isn't shut which reminds me actually I should probably explain how attacks work for the rest of the cast boney and chicas are super simple when they reach your door they'll try to get in on their next successful movement opportunity if the doors closed they'll reset to the dining area but if they get in that door will be disabled and they'll wait for the next time you lower the camera to attack if you stay in the camera for too long which in this case would be about thirty seconds your camera will be forced down and you'll be attacked anyway this may sound strange but there's a nice thing that happens when Bonnie and chica reach AI level 20 that makes your life a little easier when they're right outside your door they're still need to move at the next movement opportunity why is that good well unless our difficulties it's not uncommon for them to go on a streak of failing their movement opportunities repeatedly this keeps them in place and forces you to keep your door closed for much longer than you'd like the knowledge that they'll always attempt an attack within 5 seconds is a nice break in an otherwise very cool the challenge in fact if you happen to literally be the world's unluckiest person you could have the

animatronics

on night one move to you with speeds comparable to AI level 20 and then just stay there for the entire night kinda makes me wonder if 20 19 19 20 mode would theoretically be...
more difficult in 20 20 20 20 now you may have noticed that until now I've avoided talking about Freddy very much that's intentional because Freddy is a doozy similar to foxy using the cameras while Freddy takes a move for an opportunity will automatically cause him to fail it however when he does get a successful movement opportunity he doesn't immediately start moving well usually instead he starts a sort of countdown the simplest way to describe the countdown would probably be that it's 1,000 minus 100x frames X being Freddy's current AI level for example the countdown would be 900 frames at AI level 1 800 frames at level 2 and so on this game runs at 60 frames per second so those times would be about 15 seconds and 13.33 seconds respectively with each increase of AI level taking another 1.6 7 seconds once Freddy's AI level reaches 10 or higher you might notice that the countdown will start at 0 while the countdown may as well not exist on high Rai levels it's important to remember that Freddy only ever goes up to 4 outside of custom night it's pretty clear Freddy wasn't exactly designed to be a very fair fight higher than 9 let alone 20 that's why micromanaging him is such an important part of 20 20 20 20 runs just like foxy though Freddy's biggest weakness is basic camera usage like we just established looking at any of the cameras will lock Freddy in his place and fail as movement opportunities however the cameras don't...
affect his movement countdown and he'll reactivate the moment the camera goes down more specifically if his movement countdown ends while the camera is up he'll just wait ever so patiently for you to put the camera down in the moment you do he'll take his movement as essentially once Freddy is ready to move there's no way to stop it all you can do is slow them down his attacks are interesting too because they behave on a completely different set of

rules

once Freddy goes from his show stage to camphor B which is snuggly in the corner behind your office Freddy goes into his attack phase while in attack phase Freddy can no longer be frozen by using your cameras he does however reveal a couple new weaknesses while the cameras themselves no longer stop him in his place looking directly at camera four B will and unlike Bonnie and chica Freddy cannot into your office while the cameras down that means the only opportunity he'll get to attack is while you're looking at a camera that is a kiss and don't forget that movement opportunities are still a factor in this no matter what the circumstances are Freddy still can't attack until he's succeeded in a movement opportunity since he's reached him for beef granted that becomes less significant the more aggressive his AI is but it's still a notable factor once these two conditions are met however Freddy will immediately attempt his attack if blocked by the right door he won't return to the...
dining area like Bonnie and chica instead he'll just return to the hall and try to get into the corner for another attempt yeah once Freddy's there he's there for good and of course if you're unfortunate enough to be ignoring Freddy while the right door is open he'll enter the office now all that's left for him to do is perform his jump scare which as it turns out may not be guaranteed after all first of all the Joker will only occur when your camera is down and if you choose to hide in your camera Freddy won't ever flip it down himself and when you aren't in your camera there only seems to be a 25% chance for Freddy to do a jump scare every second that means the range of time it takes for Freddy to jump scare you can range from one second to never realistically speaking you're not going to dodge every 25% chance for the entire night unless your are really close to winning I guess but I just thought it was interesting okay I think that's a pretty detailed summary of the

animatronics

at least I don't think I missed anything I guess we can move on to the final phase of the night that you never want to see when you run out of power the game essentially stops normal gameplay there's nothing you can do during a blackout aside from look around and hope that the clock hits 6 a.m. before you die there's not really much to explain either all animatronic AI is essentially halted at this point even if foxy was on his way or Freddy was...
in your office already none of it matters all that matters is timers every 5 seconds you have a 20% chance for Freddy to show up and start playing his music box up to a maximum of 20 seconds if he doesn't show up within the allotted 20 seconds he'll show up automatically the music box duration has the same chance 20% every 5 seconds up to a maximum of 20 seconds after that the lights will flicker off and the final section will begin this one has a 20% chance every 2 seconds and when that chance succeeds well jump scare and then game over screen while I'm on the subject the game over screen actually has a special property that I never knew about well this screen is supposed to take you back to the title there's a 1 in 10,000 chance it'll take you to the golden freddy jumpscare that's a 0.0001 percent chance of occurring every time you get a game over I can safely say though I've never seen this before out of curiosity are there any lets players that genuinely got the jump scare like this as small of a chance as it is it would really surprise me if nobody encountered it while recording oh speaking of golden freddy I don't really have anything special to say about him he behaves the exact way it looks like he behaves I guess the only important information to note is that the golden freddy poster that summons him has a 0.00001% chance of appearing every time you look at that camera in particular you can spam the camera to increase your chances but...
keep in mind the random chance only updates every second yeah not much to talk about there but I figured somebody would bring it up aside from that though that's pretty much everything I found interesting enough to talk about with this game and whoa did I talk much longer than I thought I was going to this video was originally supposed to be about deconstructing horror games in general I already had like a whole list of notes made about Resident Evil 2 and how mr. X behaves but I'm gonna be lucky to fit what I already have within the 15 minute goal not that I ever managed to stay under that anyway I guess I can at least call it here and ask you all if you would want to a kind of series that goes in-depth into horror games like this I can't promise it'll be nearly as detailed as this one but I'm sure I can at least find a decent amount of interesting things for other horror games anyway I do want to give credit to Reddit user bucks figs for the existence of this video back in like 2016 or something someone shared a reddit post that this user made that made me realize you can do this sort of stuff with fusion games and while I didn't use any of their existing findings for this video not because it's bad or anything I just prefer doing my own research to make sure I have everything right I don't think I would have found out I could decompile this game if I never saw that post you can find the original post in the description if you want to check...
it out I'll also include a link for the subreddit they moderate our slash

tech

nical finesse which is all about deconstructing finesse just like this one again please think about letting me know if you want to see more horror game deconstruction as a sort of series and as always I hope you keep an eye out for more

tech

rules