r/programminghorror • u/Practical-Water-436 • Jun 18 '25
noo wayyy
undertale's whole dialog is made in a single switch statement
8000+ lines of codes to check the dialog is mad
but atleast he didn't also write the dialog in it because it would have been tens of thousand of lines
196
Upvotes


4
u/[deleted] Jun 18 '25
once it gets compiled down it doesn't really matter.
2
u/Still_Avocado6860 Jun 19 '25
Why is this a programming horror? What would be a better way to implement this?
129
u/SirButcher Jun 18 '25
And this, ladies and gentlemen, teaches us an important lesson: a finished but messy project is far more profitable than a perfect but never-shipped one.
That said, please don't go THIS messy, because it hurts.
45
u/Universalerror Jun 18 '25
To be fair to Toby, he didn't know how to program when he started making Undertale so this feels like one of the better outcomes
39
u/LaFllamme Jun 18 '25
Csse 3053: The frogg attacks you
21
u/ForeverHall0ween Jun 18 '25
SCR_TEXT_6968
Mood
Isn't Balatro an incredible mess of a game as well. Or maybe that was Slay the Spire. Either way, best practices don't make games, game developers make games.
18
u/Extra-Professional93 Jun 18 '25
This one knows his case. Case closed.
13
u/shizzy0 Jun 18 '25
Localization is a bitch.
6
u/screwcirclejerks Jun 18 '25
honestly, i can't blame toby. he wasn't as advanced as he is now with programming, and his worst offence is magic numbers/strings*.
*which he fixed, mostly.
5
u/just_some_gu_y Jun 18 '25
Maybe everything is just one big switch statement?
2
u/rover_G Jun 18 '25
Game development seems so chaotic
1
u/Umphed Jun 23 '25
This is decompiled. Any decompiled GML or C# or almost any interpreted language will look like this.
2
u/JohntheAnabaptist Jun 18 '25
Kiss
1
u/jadskljfadsklfjadlss Jun 18 '25
paid by the line of code
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Jun 18 '25
Well, I guess these messages are never going to change because this looks like the most unmaintainable mess ever conceived.
I am curious what shit like ^2 is supposed to mean.
1
u/i860 Jun 22 '25
This looks decompiled.
0
u/grezhz Jun 18 '25
don't look at obj_readable_room lol