A bot that plays the first four Five Nights at Freddy's games on a real Android phone, working toward clearing every night of every game, and the reverse-engineered model of each game that tells it what to do.
Try the trainer in your browser · Scoreboard · What's different · Start here · How it works · Credits
The panel enlarged under each clip is the bot's own overlay: where it is in its route, and what it has read off the screen.
The goal is every night of all four games on an unmodified retail install, 28 nights in all. 12 are cleared on the phone so far, including the hardest mode of FNaF 1 and of FNaF 2.
| Game | Nights | Cleared on the phone | In the model |
|---|---|---|---|
| FNaF 1 | 7 | Night 7 at 4/20, the hardest mode, on the first attempt; 2 of the 4 attempts in the record reached 6 AM (record) | the winning 4/20 route survives all 65,536 seeds in the typical lane, 94.7% in the worst (census) |
| FNaF 2 | 7 | All 7, including Custom Night at 10/20. 47 clears promoted; 8 of 10 in a predeclared 10/20 test (record) | the committed routes win all 65,536 seeds on every night in the exact lane, which leaves out press lateness (census) |
| FNaF 3 | 6 | Night 1, a night with no threats, played with no input (record) | at the phone's pace, the phone's loop wins Night 2 on 2,732 of 3,000 seeds and Night 6 (Nightmare) on about 69%, in both seed blocks (census) |
| FNaF 4 | 8 | Nights 1–3; the best Night 4 attempt in that record died 0.24 s before 6 AM (record) | the published loop wins Nights 1–4 on all 3,000 seeds of two blocks, and no seed of Nights 7–8 (census) |
"Cleared on the phone" means the retail game reached 6 AM on a real phone (DEVICE_MEASURED). "In the model"
means the reverse-engineered simulator, over all 65,536 seeds or over two 3,000-seed blocks (MODEL_ONLY). The
two labels never promote each other. A clear is one night, not a reliability rate.
Also: all four games have been rebuilt from the compiled logic of their Android releases, with patched mmfparser and Chowdren. Each rebuild converts, boots on the computer and packages as an APK, and the FNaF 2 rebuild boots on the phone. A rebuild is a second, independent reading of its game; so far FNaF 2's simulator is the one checked against it (build record).
Not claimed:
- That the models predict the phone move for move. On a traced FNaF 2 night that reached 6 AM, the model matched only 2 of the phone's 11 occupied mask windows (record). Closing that gap is the current work.
- Any phone but one. Every device result comes from one Moto g56. No second handset has been qualified.
- That any game is "solved". What solving FNaF 2 would mean lays out the rungs, and where this project stands on each.
The bot is one part of a small lab:
- One method across four games. Each game goes through the same chain: decompile it, model it, test the model over its seeds, play it on the phone, keep the evidence, and promote only what survives review. So far FNaF 2 is the only game through the whole chain.
- The game's own logic is the reference. Each game is decompiled into a rule-by-rule model and, separately, recompiled into a runnable game. When those two readings and the retail game disagree, the work is to find the decoding, translation or timing error behind it, and the retained experiments say which explanations were ruled out (research frontier).
- Unmodified games, a real phone, measured limits. Presses go through a virtual touchscreen that Android itself provides, and the routes are built on the phone's measured latencies and timing floors.
- Every claim carries its evidence level, and the mistakes made here that a machine can catch became automated checks.
- Games small enough to reason about exactly. FNaF 2's random numbers come from a 16-bit generator, so each night draws from one of 65,536 seeds. With an exact model, the ceiling on how often any player can win is computable (what solving FNaF 2 would mean).
Not claimed: that these methods are new on their own. Black-box model learning, differential testing and automated science all have precedent. What is being tested is their combination, on real hardware, across four games of one series.
No install. The trainer drills Niko Frost's Minus 7, the first zero-RNG FNaF 2 10/20 route, as touch exercises in a phone browser held sideways, graded against the model. The trainer teaches Minus 7, while the bot wins 10/20 with Minus Toys: its first screen says why, with each number's evidence label, and the lineage covers both.
With a checkout. These commands need only Node 20+, plus Python 3 for the trainer:
npm run probe # which routes below this machine is ready for, and what it still needs
npm ci
npm run evidence -- promotions # re-check every committed run pack against the promotion gate
npm run build:trainer && npm run serve:trainer # the trainer on http://localhost:8731The full test suite, npm test plus npm run test:unit:slow, needs what CI
installs: Java 17, Python 3.12 with Pillow, NumPy and SciPy, ffmpeg, and a clone with full history. CI runs it
on Node 22. No phone is involved.
| I want to… | You need | Go to |
|---|---|---|
| Judge whether this is new research | nothing | What's different here · Research frontier |
| Watch the bot play | nothing | the two clips above |
| See how the four games compare | nothing | Four games' nights |
| Practise FNaF 2's 10/20 myself | a phone browser | Trainer |
| Know where the strategies came from | nothing | Strategy history |
| Look up how a mechanic really works | nothing (your own APK to re-derive it) | Engine fact index |
| Check a claim myself | a checkout, Node 20+ | Evidence policy, then npm run evidence -- list |
| Find or tune a strategy | a checkout, Node 20+ | Strategies, policies and experiments |
| Ask it from my AI agent | a checkout, an MCP client | not built yet: Plan 28 |
| Understand how the rebuild works | nothing to read; your own APK and Docker to run it | Recompile toolchain |
| Run the bot on my own phone | research only: a Moto g56 and the game | Device safety, then the device command line |
| Give a fix back upstream | nothing | Upstream ledger |
| Work on this repository | a checkout | Contributing, then CLAUDE.md; npm run lab -- status (lab) |
Everything else is in the documentation index, routed by question.
- Source: read each game's own logic. Starting from a copy of the APK you own, CTFAK decodes the Clickteam event sheets. FNaF 2's office screen alone has 1,332 event groups, about 20,500 lines of dump. Each value in the FNaF 2 model is labelled: sourced (from an event group or an Android experiment), calibrated, inferred, or community behaviour the Android game has not confirmed. The same logic is also recompiled with mmfparser and Chowdren into a runnable game, a second reading that checks the first.
- Venues: play where it can be measured. A route is a schedule of presses, or a small program that reacts
to what it sees and hears. Routes for FNaF 1, 2 and 3 are scored in the simulator over the game's seeds;
FNaF 4's phone loop has no model lane yet. FNaF 2's Minus Toys schedules can also be replayed in the rebuild
on the computer. On the phone, a companion app reads small regions of the screen, and for FNaF 4, which is
played by ear, the phone's audio streams to the computer over Bluetooth. The computer presses through
Android's built-in
hidtool over adb, a virtual touchscreen, with no root and no change to the game. - Review: grade before believing. Every night becomes a record of presses, readings and the reported
outcome. Review tools then grade it again from the retained evidence. Each result is labelled
MODEL_ONLY,FIXTUREorDEVICE_MEASURED, and no label upgrades to another. Refuted routes and retractions stay in the record (evidence policy).
This is one person's project, built largely by directing AI coding agents. Most commits carry a
Co-Authored-By: Claude trailer. The repository is designed so that agent work gets checked, not trusted:
- One operating contract. Every agent reads CLAUDE.md. It includes a numbered register of mistakes agents made here, and a gate enforces the entries a machine can check.
- No documentation-only commits without evidence. A commit hook refuses them unless they stage or cite evidence, and its override is reserved for the maintainer.
- Agents attest wins only through a command.
npm run evidence -- attestre-derives every check from the retained evidence and records who attested and what was verified. All 47 current promotions were attested this way, under a delegation recorded in CLAUDE.md. - The phone is guarded. Every live night takes an exclusive lease on the phone, so only one program drives
it at a time, and the FNaF 2 campaign runner stays a dry run without
--live --confirm-live(device safety). - CI on every push to
master. It runs the typecheck, the unit, contract and model lanes, the census gates, a dry campaign over a committed winning route, and a link check over every Markdown file.
Strategies come from the FNaF community; this project measures and executes them:
- Minus 7, the FNaF 2 route the trainer teaches, by Niko Frost (2023).
- Minus Toys, the FNaF 2 route the bot wins 10/20 with, by Zach_Scream (2025).
- Minus 3, by insstaa and Yunivers (2023).
- brayden's timer strategy, with Shooter25 (2024).
- Right Vent Camp, by the "Tactical Crew" and systematised by DJ Sterf (2021).
Shooter25's FNaF 2 practice mod is the strongest documented precedent for a bot inside the game (bot census). Mechanics are cross-checked against the Technical FNaF wiki. The full lineage is in STRATEGY-HISTORY.md.
Tools. CTFAK decodes the game data. Chowdren and mmfparser (matpow2's Anaconda, through the fnmwolf fork) rebuild it. Every patch and finding owed back is tracked in the upstream ledger.
- Not affiliated. This is independent research. It is not affiliated with, endorsed by, or sponsored by Scott Cawthon, Scott Games, or Clickteam. Five Nights at Freddy's is © Scott Cawthon; the names are used only to identify the games studied.
- No game content here. The repository holds no APKs, game assets, decompiled event sheets, generated source or rebuilt binaries. Dumps and rebuilds are written outside the checkout, and the APK and library build scripts refuse an output path inside it. The only screen captures are the two short clips above.
- Bring your own copy. Everything that reads or rebuilds a game needs a copy you own. Rebuilt games are research builds for your own device. The project never distributes them, and neither should you.
- The retail games are not modified. The bot plays the unmodified apps through Android's standard touch input. It does not patch them or bypass their anti-tamper protection.
- License. This project's own code and documentation are under the MIT license (LICENSE).
Patches to third-party tools keep those tools' licenses: the Anaconda patches under
tools/recompileare GPL, as their upstream is (NOTICE). The trainer's fonts are under the SIL Open Font License 1.1 (apps/trainer/assets/fonts). None of these licenses covers the games.
| Nights cleared on the phone | 12 of 28 across the four games |
| Promoted 6 AM clears (FNaF 2) | 47: Nights 1–4 two each, Night 5 seven, Night 6 eight, Night 7 twenty-four (record) |
| Newest record | FNaF 2 rebuild boots on the phone (2026-09-28) |
| Working on | encounter-level fidelity for FNaF 2, and the remaining nights of FNaF 1, 3 and 4 (roadmap) |

