<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by HADHAD on Medium]]></title>
        <description><![CDATA[Stories by HADHAD on Medium]]></description>
        <link>https://medium.com/@katai5plate.sub?source=rss-5c92f3da76fc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bprQnvBc4BdtLkO9NblFAA.png</url>
            <title>Stories by HADHAD on Medium</title>
            <link>https://medium.com/@katai5plate.sub?source=rss-5c92f3da76fc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 02:11:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@katai5plate.sub/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why Messy Code Actually Works Better for Game Development]]></title>
            <link>https://medium.com/@katai5plate.sub/why-messy-code-actually-works-better-for-game-development-5e4119932adc?source=rss-5c92f3da76fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e4119932adc</guid>
            <category><![CDATA[indie-game-dev]]></category>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <dc:creator><![CDATA[HADHAD]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 13:55:34 GMT</pubDate>
            <atom:updated>2026-06-22T00:05:26.185Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIPs965u1QPhhzlnvOwHgw.jpeg" /></figure><p>This essay was originally written by me in Japanese.<br>I used Claude to translate it into English, then reviewed and edited the translation myself.<br>The original Japanese version is here:</p><p><a href="https://note.com/had2apps/n/nc598541aa3b5">汚いコードのほうがゲーム制作が上手くいく理由｜不定刊・はど編集室</a></p><p>For the first time in a long while, I opened up a game prototype I made back in the Unity 4 era.</p><p><strong>I was speechless.</strong></p><p>2,000 lines of code in a single C# file. Massive amounts of if statements. Multidimensional arrays. Triple execution of PlayerPrefs. Not a shred of object-oriented programming. <strong>I was writing pure procedural code in C#.</strong> No classes. The comments said things like “deta[A][B][C][D][E] is for flags.”</p><p>It was an absolute mess. But the game worked. There were no problems at all. <strong>The save data was being saved three consecutive times</strong>, but it doesn’t matter how many times you save at the same moment — the result is the same.</p><p><strong>It runs. It’s playable. It’s finished.</strong></p><p>What about me now? When I try to make a game, <strong>I just keep refactoring and never finish anything.</strong> The game never gets done, but the plugins keep piling up. I can’t function without a formatter and a linter installed.</p><p><strong>I spend all my time thinking about asynchronous processing design, and the actual game experience is completely absent from my mind.</strong></p><p>I’m supposed to be making a game, but it feels like I’m building a tool. Nothing experiential ever comes out of it. <strong>It never gets finished.</strong></p><p><strong>How did it come to this???</strong></p><h3>Undertale and Yandere Simulator Are “Messy”</h3><p>While I was thinking about this problem, two games crossed my mind.</p><p>Undertale’s source code contains a massive 5,593-line script called SCR_TEXT.gml — a structure that centrally manages a huge amount of text and events.</p><p><a href="https://github.com/fachinformatiker/undertale">fachinformatiker/undertale: Undertale src code</a></p><p>The text dialog is written with complex switch statements. By any general standard of “clean code,” it’s quite messy.</p><p>Yandere Simulator is the same. The creator himself explains on his official page: “At the beginning of Yandere Simulator’s development, my goal was to quickly create a rough proof-of-concept that could be used for pitching the game on Kickstarter. During that period of time, writing efficient and optimized code was not a priority, since I was not planning for any of that code to be in the final version of the game.”</p><p><a href="https://yanderesimulator.com/code/">Code — Yandere Simulator</a></p><p>He also wrote in a 2017 blog post that there were over 300 scripts, and checking a small change took 30 seconds to compile plus 30 seconds to launch.</p><p><a href="https://yanderedev.wordpress.com/2017/06/28/has-any-progress-been-made-on-osana-how-close-is-osana-to-being-finished-whats-taking-so-long/">Has any progress been made on Osana? How close is Osana to being finished? What’s taking so long? | Yandere Simulator Development Blog</a></p><p>Both are generally considered “messy code.” But both work as games. At the very least, they run. They’re playable. People show up to play them.</p><h3>“Public Cleanliness” and “Author’s Cleanliness” Are Different Things</h3><p>There’s an important distinction to be made here.</p><p>Masses of nested switch statements and thousands of lines of else-if — they’re messy code by general standards. But <strong>for the creator, they may have been clean, highly maintainable code.</strong></p><p>YandereDev himself explains the situation with the tinyBuild programmer in detail on his official page. That programmer would rewrite `(variable == false)` as `!variable`, or convert if/else if chains into ternary expressions. YandereDev’s response: “<strong>the top one is easier for me to understand at a glance</strong>” and “I sometimes relied on using ctrl+f to search for instances of code that was written a very specific way.” He said he wanted to avoid his code “<strong>becoming alien and foreign</strong>” to him.</p><p><a href="https://yanderesimulator.com/debunk/">Debunk — Yandere Simulator</a></p><p>In a 2018 blog post, he further explained that refactoring the main scripts would make it impossible to release updates for a long time, which he judged would be fatal to the game’s popularity — so he ultimately decided against it.</p><p><a href="https://yanderedev.wordpress.com/2018/06/10/hey-whatever-happened-with-that-whole-tinybuild-thing/">Hey, whatever happened with that whole tinyBuild thing? | Yandere Simulator Development Blog</a></p><p>In other words, <strong>generally refined coding style and coding style that’s easy for the author to read are completely different things.</strong></p><p>Knowing where everything is. Knowing how to search for things. Writing everything with the same personal habits. In practice, that’s actually quite “clean.”</p><p>Dismissing all of this as “messy code is bad” <strong>means you’ve lost sight of who that cleanliness is for.</strong></p><h3>Undertale’s Creator Was Not a Beginner</h3><p>In a 2013 interview, Toby Fox talked about making RPGs with his siblings in RPG Maker 2000 as a kid, making quite a few EarthBound ROM hacks in high school, and that Undertale was his “first REAL game project.”</p><p><a href="https://meloshantani.wordpress.com/2013/05/25/toby-foxs-undertale-dev-2-dev-interview-1/">Toby Fox’s Undertale — DEV 2 DEV INTERVIEW #1 | ambient-melodic</a></p><p>In other words, even if this was his first commercially finished product, he already had a wealth of game development experience.</p><p>In a recent Game Informer interview, he talked about the “smart” way of making games — building reusable systems — and then explained that his own way is not like that. Everything in the game becomes a container for a never-before-seen gimmick. The method he chose is, by his own admission, inefficient and laborious.</p><p><a href="https://gameinformer.com/2026/05/25/inefficient-and-laborious-the-ongoing-path-to-making-deltarune">Inefficient And Laborious — The Ongoing Path To Making Deltarune — Game Informer</a></p><p>Toby is fully aware that his approach isn’t standard. He knows it’s inefficient. But he stuck with it. He didn’t pander to the conventional idea of “clean design.” He trusted his own design.</p><p>That’s why he managed to finish it.</p><h3>This Doesn’t Work for Tool Development</h3><p>This only holds true because it’s game development. <strong>In tool development, it’s absolutely an anti-pattern.</strong></p><p>Because <strong>tools don’t sell an experience — they sell systems and mechanisms.</strong> They need consistency. They need to be easy to test.</p><p><strong>Games are different.</strong> The quality target isn’t “functionality or usability” — it’s ”<strong>whether it’s fun.</strong>” Fun can’t be verified with unit tests. That’s why playtesting exists.</p><p>Robert Nystrom writes in Game Programming Patterns: ”<strong>It’s easier to make a fun game fast than to make a fast game fun.</strong>” So in game development, you should compromise by keeping the code flexible until the design is solidified.</p><p><a href="https://gameprogrammingpatterns.com/architecture-performance-and-games.html">Architecture, Performance, and Games · Introduction · Game Programming Patterns</a></p><p>Game Developer’s prototyping guidelines are equally blunt: ”<strong>Let go of perfection and go for the core.” “Don’t do work that doesn’t bring you closer to your goal.</strong>”</p><p><a href="https://www.gamedeveloper.com/programming/rapid-game-prototyping-tips-for-programmers">Rapid Game Prototyping: Tips for Programmers</a></p><p>Another article puts it this way: prototypes should <strong>set a time limit, assume the code will be thrown away, and avoid over-designing.</strong></p><p><a href="https://www.gamedeveloper.com/design/howto-develop-a-prototyping-mindset">HOWTO: Develop a Prototyping Mindset</a></p><p>On top of that, games are fundamentally built on <strong>code that is mostly one-off logic.</strong></p><p>There is no scenario where you reuse Sans’s battle script for Papyrus’s battle in Undertale. Each boss has unique gimmicks, each event has unique staging, each dialog has unique branching. Every element in the game is a container for a “never-before-seen gimmick.”</p><p>General “clean code” only has value when the same pattern is repeated. A web server processing thousands of identical requests. An ETL pipeline transforming uniform data structures. <strong>The DRY principle works because “repetition” actually exists.</strong></p><p>At the gameplay layer of a game, there’s very little repetition. Each boss is different. Each stage is different. Each conversation is different. You pay the cost of abstraction even though there’s nothing to reuse. And worse — <strong>abstraction constrains your design space, so when you want to do something special for just this one boss, you slam into the wall of your own abstraction.</strong></p><h3>Refactoring Doesn’t Make a Game More Fun</h3><p>By Martin Fowler’s definition, <strong>refactoring is “restructuring an existing body of code, altering its internal structure without changing its external behavior.”</strong></p><p><a href="https://martinfowler.com/tags/refactoring.html">refactoring</a></p><p>Refactoring doesn’t make a game more fun. It can’t. <strong>Its only value is making the next change easier.</strong></p><p>There’s also the concept of Preparatory Refactoring, attributed to Kent Beck: ”<strong>Make the change easy, then make the easy change.</strong>”</p><p><a href="https://martinfowler.com/articles/preparatory-refactoring-example.html">An example of preparatory refactoring</a></p><p>But what happens when this goes out of control in game development? <strong>You haven’t even figured out what you’re building, but you spend all your time “preparing for changes.” The game experience hasn’t advanced a single step, and the code just keeps getting organized for “the ideal change that might come someday.</strong>”</p><p>What on earth are you doing? Weren’t you supposed to be making a game?</p><h3>“Messy” Is Not Uncommon in the Industry</h3><p>Game Developer has a feature series called “dirty coding tricks.”</p><p><a href="https://www.gamedeveloper.com/programming/dirty-coding-tricks">Dirty Coding Tricks</a></p><p><a href="https://www.gamedeveloper.com/design/more-dirty-coding-tricks-from-game-developers">More dirty coding tricks from game developers</a></p><p>The intro reads: ”<strong>Programmers are usually a methodical and precise breed who do their best to write clean, well-documented code. But when the technical constraints are especially tricky, and the ship date is looming, even the most well-intentioned coder will resort to a quick-and-dirty fix.</strong>”</p><p>In the postmortem for the commercial game Trine, it was reported that among 298,000 lines of shipped code, there were 1,438 comment lines containing “hack” or “todo.” Yet Trine shipped, received praise, and became a series.</p><p><a href="https://www.gamedeveloper.com/audio/postmortem-frozenbyte-s-i-trine-i-">Postmortem: Frozenbyte’s Trine</a></p><p>A 2026 Unity article explicitly recommends going “fast and loose” during prototyping — while also noting that once you move past the prototype stage, it becomes a liability.</p><p><a href="https://unity.com/blog/scaling-workflows-lessons-from-medium-to-large-projects">Scaling Unity Workflows for Medium To Large Projects | Unity Blog</a></p><p>In other words, at least in the early stages, prioritizing speed of experimentation over cleanliness is normal. This isn’t eccentric behavior — it’s a widely shared practice across the industry.</p><h3>Guernica Was Painted Because He Was Skilled</h3><p>”<strong>Writing messy code” and ”deliberately writing messy code” are completely different things.</strong></p><p>The former isn’t a technique. It’s ignorance. The latter is a technique. It’s craft.</p><p>Picasso didn’t paint Guernica because he was bad at painting. He mastered oil painting by age 8, entered the Barcelona Academy of Fine Arts at 13, and completed large-scale realistic paintings by 15. He himself reflected: ”<strong>I could paint with that academic precision, but what I wanted was the clumsiness and simplicity of a child.</strong>”</p><p><a href="https://mymodernmet.com/picasso-early-work/">Early Picasso Art Reveals a Different Side of the Modern Artist</a></p><p><a href="https://www.dailyartmagazine.com/picasso-and-early-talent-5-early-works-you-may-not-know-about/">Young Picasso’s Early Art You May Not Know</a></p><p>In the art world, there’s a concept called “deskilling.” As Claire Bishop describes it, deskilling is “the conscious rejection of one’s training and traditional abilities.” <strong>To reject something, you must first have acquired it</strong>.</p><p><a href="https://brooklynrail.org/2011/12/art/unhappy-days-in-the-art-worldde-skilling-theater-re-skilling-performance/">UNHAPPY DAYS IN THE ART WORLD? De-skilling Theater, Re-skilling Performance — The Brooklyn Rail</a></p><p>The same applies to game development. ”<strong>Deliberately” writing messy code</strong> is something only people who know clean code can do. <strong>It can only be done by someone who understands ideal code design and can make the judgment to discard it.</strong></p><p>Martin Fowler also classifies technical debt along two axes: <strong>deliberate vs. inadvertent, and prudent vs. reckless.</strong></p><p><a href="https://martinfowler.com/bliki/TechnicalDebtQuadrant.html">Technical Debt Quadrant</a></p><p>A shortcut taken knowingly and a state of collapse from ignorance may look like the same “messiness,” but the substance is completely different.</p><h3>When Knowledge Becomes Censorship</h3><p>The reason I could finish games with 2,000 lines in a single file back in the day wasn’t that the mess miraculously worked. It’s that I’d minimized decision-making costs to the extreme, freeing me to focus on the experience.</p><p>The reason I can’t finish now isn’t that I lack skills. It’s the opposite — <strong>I know too much, and all of that knowledge is functioning as censorship.</strong></p><p>I have to run the formatter.</p><p>I have to run the linter.</p><p>I have to separate concerns.</p><p>I have to make it readable later.</p><p>I have to write it by the proper rules.</p><p>I have to maintain perfect maintainability for anyone who might read it.</p><p>Is that the experience?</p><p>Isn’t that exactly why game development grinds to a halt?</p><p>This is the same as a musician who learns too much theory and can no longer write songs, or a writer who knows too much about writing techniques and can’t put pen to paper. <strong>Knowledge becomes censorship before it becomes skill.</strong></p><p>Now suppose you carve into your heart: <strong>”There’s no need to write clean code.”</strong></p><p><strong>Can you actually stop yourself from writing clean code?</strong></p><p>Impossible. I grew up looking at clean code. If there’s no obligation, of course I’m going to want to write clean code.</p><h3>Intentional Messiness as a Technique</h3><p>In other words:</p><p>“You don’t have to write clean code” isn’t enough. Even without an obligation, your hands will naturally try to write cleanly. That’s precisely why you need <strong>a reverse constraint.</strong></p><p><strong>”Deliberately messy — draw the raw contents of your brain exactly as they are.”</strong></p><p>That is the true best practice.</p><p>However, this doesn’t mean the entire game can be like this. Save systems, networking, billing, builds, asset pipelines — these <strong>tool-like infrastructure layers must not be broken.</strong></p><p><strong>You can only be intentionally messy in the layers that directly touch the experience.</strong> Staging, dialog, behavior, gimmicks, UI, pacing, one-off processes.</p><p>The experience layer doesn’t need to be clean by public standards, but <strong>it must be high-quality in the sense that the author can modify it at high speed.</strong></p><p>“Infrastructure layer changes” and “experience layer changes” should have been written differently from the start. <strong>You can’t just lump everything together and tidy it all up indiscriminately.</strong></p><p><a href="https://martinfowler.com/bliki/TechnicalDebt.html">Technical Debt</a></p><h3>Closing Thoughts</h3><p>Strictly speaking, it’s not that “game code should be messy.” What matters is <strong>abandoning public accessibility.</strong></p><p>Others might not be able to read it. It might not follow general conventions. But inside your head it’s orderly, and changes are fast. During the exploration phase of game development, that is the most important quality.</p><p>Undertale looked messy by external standards, but it ran to the finish line on the author’s own internal order.</p><p>Yandere Simulator had its own internal order too, but the project’s scale exceeded the capacity of that order. That’s why updates stalled.</p><p><strong>What game development needs isn’t refactoring — it’s “calibrating how well your brain is synchronized with the code, and committing to the experience.”</strong></p><p>Yandere Simulator’s struggle happened because the project outgrew the brain’s capacity. That’s exactly why <strong>”synchronization with your brain”</strong> is what matters.</p><p><strong>It’s precisely because you know clean code that you can wield messy code.</strong></p><p>So I’m going to try it myself.</p><h3>Bonus: The Michael Jackson Parallel</h3><p>There’s actually another type alongside Picasso. Michael Jackson.</p><p>MJ couldn’t play instruments. So how did he make demo tapes? Because he could beatbox. And his beatboxing wasn’t even all that technical — it was made up of roughly four sounds.</p><p>But with his innate sense of rhythm and vocal ability, he produced music with his mouth that was good enough to serve as a demo tape. One of his engineers recalled: “One morning MJ came in with a new song he had written overnight. We called in a guitar player, and Michael sang every note of every chord to him. ‘Here’s the first chord, first note, second note, third note. Here’s the second chord, first note, second note, third note.’ He would sing us an entire string arrangement, every part. Had it all in his head, harmony and everything. Not just little eight bar loop ideas.”</p><p>MJ’s beatboxing wasn’t like other beatboxers’, where beatboxing is the point. <strong>His beatboxing was a language for communicating music.</strong></p><p>In other words:</p><p><strong>Just as music was playing inside MJ’s brain and came out through beatboxing, game development should be something you can play inside your brain, and what comes out is the code.</strong></p><p>So maybe playtesting and development shouldn’t be separate at all. You should develop while playtesting. With playtesting as the main activity and looking at code kept to a minimum.</p><p><strong>In tool development, you work by “if I do X, the system becomes Y” — principle-driven development.</strong></p><p><strong>But in game development, you should work by “I wish this were like that” — motivation-driven development.</strong></p><p>Programming shouldn’t become labor. <strong>You should be programming as an extension of playing the game you imagined.</strong></p><p>That’s what I think.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e4119932adc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>