I Gave an AI Zelda and One Rule: Don't Cheat.

Bears Gaming Den

Bears Gaming Den

97,634 views

I told an AI to beat the original Legend of Zelda on the NES without cheating, and then I stayed out of it. No controller, no memory editing, no glitches, no save states in the run. Ten days later it finished the game in 37 minutes and 2 seconds, verified from power-on.

The first half is how it learned: it never sees the screen (it reads the console's 2 KB of memory), it taught itself which tiles are walls by walking into them, it rehearses every room from a bookmark and keeps the best take, it plays every move 200 frames into the future before pressing a button, it read the game's own code to find a rule about bombs, and for ten days half its sword swings went sideways because of an 8-pixel grid. The second half is the fastest run, uncut, with the AI's reasoning panel on the right.

Tokens used 16M generated, ~5B cached context re-read over 13k turns.

▶ THE CODE AND THE RUN
Everything is open: the harness (about 20,000 lines of Python), the AI's journal, and the input file for the run. With the emulator (BizHawk 2.11.1) and your own copy of the game, your computer can play this exact run frame for frame and check it byte for byte.
GitHub: https://github.com/bearsgaming-ui/AIB...


▶ THE RULES
• Unmodified game, running in an emulator (BizHawk).
• Controller inputs only. No memory editing, no cheat codes, no glitches (no screen scrolling, no block clips).
• One continuous run from power-on to Zelda.
• Practice with save states is allowed; the final run is one unbroken input log, replayed in a fresh emulator and compared byte for byte.
• No human input during the run. Not once.

So this is tool-assisted, the way a TAS is. A human world record (27:40, any% No Up+A, with glitches) is set live on real hardware in one sitting. That is a different sport, and this video does not claim to beat it.

▶ CHAPTERS0:00 Intro
0:28 Six copies of Zelda, all night
0:46 It doesn't play live: it built a player
1:35 It never looks at the screen
1:56 Learning which tiles are walls
2:41 Walking is a path search
3:16 Finding Level 3 without a map
3:34 Bookmarks: 341 rooms, 60 tries each
3:58 Everything becomes one currency: frames
4:31 Replayed from power-on and verified
4:53 The five Darknuts that broke the first approach
5:12 Looking ahead: nine futures, every 8 frames
6:05 The prices are its personality
6:32 Measuring the bosses
6:50 Reading the cartridge: the tenth kill
7:21 The whole map, decoded from the ROM
7:33 Routing the entire game
8:05 The pathing was still weird
8:31 Six runs: 1:42 to 37:02
9:22 Run it on your own computer
9:51 Could it beat the human record?
10:44 THE RUN (37:02, uncut)
11:28 Level 3 (the raft)
16:45 The White Sword
17:44 Level 1
20:51 Level 4
25:14 Level 8
28:04 Level 2
30:20 Level 5
34:39 The shops
35:36 Level 7
39:01 The Magical Sword
39:25 Level 6
42:33 Level 9 (Death Mountain)
47:22 Ganon
47:45 Zelda