Undertale Code Review: Is it THAT BAD?
194K views · May 11, 2026 · Science & Technology
Comments · 527
@OceanBagel · 4 months ago · pinned
Great video! I've probably seen just about every line of code in the game and it's certainly frustrating when some of those other videos pop up that just quote rumors or falsehoods about the code. So it's very refreshing to see someone who took the time to actually learn how the code works before making a video about it. So thank you!<br><br>I'll write out a few notes as I watch, with timestamps:<br>1. <a href="https://www.youtube.com/watch?v=BzvFFQ0DbOI&t=224">3:44</a> audio_channel_num() sets the maximum number of simultaneous audio channels, so it doesn't really do anything until you go to play a 129th simultaneous sound. Incidentally, the default value set automatically is also 128, so this line doesn't actually do anything at all.<br>2. <a href="https://www.youtube.com/watch?v=BzvFFQ0DbOI&t=236">3:56</a> We have some evidence via the Undertale Demo (which has code stored in uncompiled plaintext, preserving original formatting and comments) that indicates these flags really did go unnamed. It's possible they kept a list or some comments to keep track of them later in development, but there isn't any evidence of that yet.<br>3. <a href="https://www.youtube.com/watch?v=BzvFFQ0DbOI&t=349">5:49</a> Regarding the section on where the dialogue is stored, your explanation is correct for the original release of the game. However, when they released the Japanese localization, they actually ended up pulling most of the dialogue out of the inline locations and created two ds_maps: one for English and one for Japanese. This allows the game to look up a particular line in whatever the current language is, and can even be extended further to other languages. (Also as a side note, it appears your copy of the code is not quite accurate, as the switch case is in reverse order from how it was actually written.)<br>4. <a href="https://www.youtube.com/watch?v=BzvFFQ0DbOI&t=431">7:11</a> Although json was supported at the time of Undertale's release, csv was not (at least not as something that can be automatically parsed)<br>5. <a href="https://www.youtube.com/watch?v=BzvFFQ0DbOI&t=802">13:22</a> Actually, this code is still fully functional! It doesn't work as intended because all write operations in Gamemaker act on the save folder, rather than the game folder. However, if you were to make a copy of undertale.exe and put it into your save folder, the game will actually delete that file when this code runs. The other issue preventing this from working as intended is that the game can't delete its own exe file even if it could delete files in the game folder. However, there is a way to get this to work very close to the way Toby intended using pure gml. There's an obscure way to set the save folder to the same folder as the game folder, and by doing this, you can target the game's data.win file (the file that holds all the code and assets) and potentially even every file <b>except</b> the exe file and delete them all. Then when you go to run the game the next time, it would simply refuse to open.<br>6. <a href="https://www.youtube.com/watch?v=BzvFFQ0DbOI&t=1060">17:40</a> You can add "no boolean types" to that list as well, which is why the code exclusively uses 1 and 0 for true and false (with the exception of modern UndertaleModTool decompiled code, which contains manual corrections where the UTMT team assumed "true" or "false" was intended). In GM:S1, you could type "true" or "false" in the code editor, but they'd be compiled into 1.0 or 0.0 respectively.<br><br>Overall a great take on the nuances of Undertale's code. And there are many, many more examples of funny quirks, workarounds, and accidents left over in Undertale. Despite having seen most of it, I still find things I didn't know about sometimes. It would be neat to see a video on Deltarune's code, because the progression of the code style from chapter 1's code written by Toby to the later chapters' code written by a team with proper tools and infrastructure is incredibly stark.
650
@ratchet227 · 4 months ago
We can talk about TobyFox's code on how bad certain things are but at least he didn't do that while claiming he got 10y of dev experience at Blizzard.
903
@RDnathKolkata · 4 months ago
UX Engineers are designers who program to make the experience.<br>Technical architects are developers who design in the game but mostly bind frontend and backend.<br><br>Toby Fox, is a musician.
1.7K
@BenderBendingRodriguezOFFICIAL · 4 months ago
It’s exaggerated and mostly a meme that got out of hand.<br>Yes, there are large switch-style structures, but for a solo developer learning as he went, the overall codebase is fairly pragmatic and organized around functional systems rather than strict architecture.<br><br>It’s not what you’d typically see in AAA development, but that doesn’t make it “bad code.” It’s a working indie codebase that prioritizes getting features implemented over architectural purity.<br><br>He was able to add content and systems without constantly breaking things, which suggests it isn’t the “spaghetti mess” people often imply.<br><br>In the end, it’s not professionally architected in the AAA sense, but it’s stable, functional, and clearly served its purpose well.
297
@olagarto1917 · 4 months ago
we have programer art, undertale is artist code
53
@gush5436 · 4 months ago
could Toby Fox secretely be Papyrus?? no other explanation for all this spaghetti code lol
840
@luizchagasjardim · 4 months ago
When I started programming, I used to make software with a lot of spaghetti code. Now that I know the best practices, I don't make working software at all.<br><br>Those patterns and stuff are all nice for working in a team and making maintainable software, but if you just want a small game, just do whatever. Worst case scenario, you'll learn from it and rewrite from scratch.
140
@Frisk9undertale · 4 months ago
I'm happy you mentioned the limitations of gamemaker language back then (even tho it doesn't justifies every toby's bad practice). I feel like most people making jokes about the code don't have any knowledge about how barebones it was, which is quite ironic if you ask me
657
@Olavr_UA · 4 months ago
my favorite thing is that the post-erasing file is called system_information<br>That file name is hilariously genius, since some players who want true reset just delete save files from folder, but since that file is called system_information they probably won't delete it because file with that kind of name must be important<br>And after deleting save files from folder, they thinking that they have true reset the game will STILL get a bad version of pacifist ending - they will not escape their consequences<br>Thats why hiding Chara file as "system_information_962" was a genius move by "bad programmer" Toby
512
@Cute_Clord · 4 months ago
Toby Fox had a goal with Undertale, to learn basics of coding. Through cheer determination to learn as of how he succeeded.<br><br>Supposedly it was to figure out how to code Deltarune more properly that Undertale got made as the scope of it's more ambitious. Definitely would be convenient with things like localizing the game when dialogue is stored better way so you just give a file to translate with some instructions.
45
@atypicalambience3487 · 4 months ago
I feel like there is a weird intuition people have were they see code that is not particularly abstract and assume it's worse because it's not "clever". I played undertale several times without noticing a single bug, and I can read every line from the game I have seen so far with zero ambiguity. People who come from a C or assembly background like Toby are going to write more procedural inline code than most, but I don't see that as a bad thing.
106
@Bib_The_Boulder · 4 months ago
The black screen after Chara erases the world isn’t infinite. If you stay on it for 10 minutes, there’ll be special dialogue, which in short, allows you to play the game again, while writing a value to the undertale.ini file that locks you out of the true pacifist ending, and replaces it with an alternate one that has a much more dire ending until you delete the file.
315
Up next

Deltarune Code Review: Is it better than Undertale?
Howdy ツ · 75K views

I reviewed Pirate Software's code. Oh boy...
Coding Jesus (getcracked.io) · 3.1M views

{GAMEDEV STREAM} lets work on my VIDEO GAME
reptile · 76 views

SILKSONG SOURCE CODE Deep Dive: Optimization, Movement Logic & Architecture
Howdy ツ · 185K views

The Best Scrabble Player is GENUINELY insane
s0ngbird · 12M views

Every Single Bit of Lore You Might Have Missed in UNDERTALE!
Phil Gaimz · 344K views

1 Hour of Theoretically Possible Events in Minecraft
Rovant · 1.4M views

Mildly Insane Deltarune Hunger Games
Pillow Game Fortress · 38K views

Programming in Assembly without an Operating System
Inkbox · 2.1M views

Developer Examines PirateSoftware - Part 1 - Job History and Development Hell
Slop Media Network · 2.1M views

GTA Vice City Code Review: Insane Memory Optimizations
Howdy ツ · 256K views

What is Sans HIDING in DELTARUNE? (Analysis/Theory)
DoubleDan · 361K views

So... DELTARUNE Chapter 5 Could've Been Better
AurumAlex · 85K views

How Important are Leitmotifs in Deltarune?
KazooCat · 528K views

What CLEAN CODE Looks Like: Slay the Spire 2 Source Code Deep Dive
Howdy ツ · 159K views

Balatro Source Code Review: "Bad" Code & Math Tricks
Howdy ツ · 115K views

How Undertale Was Made and Why its Success Scared The Creator
ThatGuyGlen · 3.3M views

I Tested Horrible Coding Languages
commonLuke · 879K views

The 10 Eras of Vsauce Explained
Asian Bay City · 363K views

Undertale is a horribly made game
Juniper Dev · 1.9M views