Transcript for:
Undertale Development and Design

okay you saw the title but I'm not talking about the gameplay I'm not talking about the dialogue I'm not talking about the story I'm talking about the way that the game was made see Toby Fox was not an incredible developer he never claimed to be he never wanted to be but he still made one of the bestselling games of all time because the code of undertale is filled with a bunch of interesting workarounds to problems and many failed attempts you know how you have the option to either kill enemies or spare them well if you decide to butcher them all like a psychopath which I'm sure you know is called the genocide route you're eventually given the choice to erase the world and when you do that the game comes to an end by crashing itself and exiting well what was originally meant to happen in this ending was a little more intense the initial idea was to actually delete the game itself off of your system gone as if you had just uninstalled it but the thing is Toby didn't know how to do that he tried blessed his heart he tried and you know what it would probably take me a hot minute to figure out how to do that too but it's really funny to see his attempts at doing so in the code you can see here that he tries every case sensitive version of deleting the file name undertale but no luck there are other games that manage to do that and the effect is very unsettling you feel completely powerless doky DOI literature Club kind of does something like that and so does a game called One Shot the idea is that you only have one chance to beat the game and if you close the game or leave well the main character who you're controlling and needs you um dies of neglect and then you don't have a character to play the game with so you're done playing the game it's pretty intense so you can understand why Toby wanted to do something like that and it would have resonated heavily to feel completely responsible for not only killing off every character but also destroying their world in an alternate timeline that is the genocide route ending the many endings of undertale are part of what defines the game but another part of that is the art style it's quirky it's colorful and as you probably noticed not perfect it's not beautifully shaded the line work can be a little funky and it's kind of inconsistent I was trying to find the general consensus on whether people liked the art and undertale or not and I made the mistake of opening a steam thread which is the one place I found that's worse than a Reddit thread but I did get the information that a lot of people passed on undertale solely because of the art and what's funny with that is that a lot of undertale's art was actually removed or changed because it looked too good yeah there's this art of Papyrus where the animation was too good so they had to simplify it and this art of Doge had to be redone because it and I quote didn't look crappy enough the bad art and I say that very lovingly definitely has a charm to it though and even the completely unused art does too this was an early test Sprite called lava creature which is later renamed to pole and used as an object without the face big Bob has no known purpose but just kind of exists unused used in the game and here's this Sprite of Floy which I think is meant to be funny but it's honestly the most unsettling expression that I've seen this character have I could imagine flowy saying some pretty terrifying things with this face or this one wow and speaking of another interesting thing about the code of undertale is actually the way that the dialogue is handled usually when you make dialogue in a video game you have a distinct file that has all the possible text that can pop up in your game this is usually a CSV file or a Json and you can think of it as basically a database for text so then at different parts in your code you extract specific parts of this file and that'll depend on what character you're talking to if you have a certain item whatever and that's one of the most efficient and common ways to do it but the way that undertale handles dialogue is much worse all of the dialogue in the entire game every text box that pops up is handled in one massive if statement this is what it looks like it's called a switch ston and it works like this a condition goes here let's say we're looking at a number now if that number is one do this if it's two do this Etc so for undertale this was a huge statement containing all of the dialogue and every time dialogue was run it would run case 737 out of what must have been at least 1,000 lines now this is technically decompiled code so it looks slightly different but I imagine that it's like oh if you're in this part of the game Talking to Papyrus make it say this if you're in this specific Place talking to this specific character with this specific item do this undertale is already a highly custom experience where the dialogue varies greatly depending on what choices you make so you can imagine the sheer size of this switch statement and usually something like this would be very bad because it would slow things down and just very inefficient but undertale itself requires such little space and memory that I I guess it's fine it doesn't cause substantial lag anywhere and I guess Toby was fine doing it this way so hey all the power to him he can make the code as unoptimal as he wants and it doesn't matter and he can write it however he wants to there are rooms with literally hundreds of if statements there's like 10 cutcenes controlled by one object nestled in an increasingly verbose series of if statements to determine where it goes the Snowballs in that one room have like a bajillion vertices and then the best part doesn't matter Kudos toay on Twitter for that one they also told us that the moving text box gag in the conveyor belt room creates and destroys and recreates the text every single frame in order to give the illusion of a moving box that's right ladies and gentlemen instead of just moving a box we're going to make it a stop motion animation Toby clearly writes whatever he wants to which is why when you inspect the undertale website you're actually given a fun little message at the very bottom that reads what are you doing looking for Secrets Don't Put your nose where it doesn't belong or you might learn something you don't like he Toby actually once talked about how he's sad that games in this era don't have any secrets hardly which I agree and disagree with but undertale is definitely one of the games out there with a lot of secrets secrets throughout the game that you might actually never find and they're designed to be that way and not because you aren't digging hard enough for them but because at the start of each new playthrough and undertale you're actually assigned a random number from 1 to 100 called a fun value and then different rare occurrences happen to depending on what value you got if your number is in the range of say 2 to 39 you'll get a call from a random number as you're walking through Snowden other events will only happen if your number is one specific value or in a very small range the occurrences that do happen are kind of just fun little eggs or short dialogue or small changes that don't affect the gameplay a whole lot but it is cool and not a lot of games will predetermine a value at the very start of your game that affects encounters because that means you're sacrificing a lot of content that the player would just never run into it's a classic game developers dilemma you want your players to have a custom personal experience but the more customization or choices you give them the less gameplay will be visible across the board but undertale is built differently cuz it said you know what I don't care you would have to replay the entire game in order to get some endings and there are so many conditionals that go into every dialogue statement heck you skip nearly all the puzzles in the game if you choose to kill every enemy undertale is clearly a game made out of passion wanting to tell a story give you things to think about and put you into a video game where your choices actually matter not the illusion of your choices mattering where encounters are the same no matter what dialogue option you choose which by the way is the stupidest thing in game design but whatever undertale don't do that and the best part is that to make an experience like that you don't have to be an expert programmer if anything is the takeaway from this video it's that games aren't a science you don't have to be perfectly optimal of course some things should be or else we could this fun thing that we call lag but they don't have to be Flawless in how they work they just have to work they have to do what you want them to do and tell the story that you want them to tell remember undertale was made by one person with the help of an artist in a free software that software is game maker who I thank for partnering with me on today's video I've used game maker for a lot of my own projects and it was actually the first game engine that I started making games with I found that it's very intuitive everything is laid out on this nice big dashboard where you can move everything around folders are pre-made for you it's very easy to see everything you're working on at once visually which My Little organization brain loves and needs tile sets animations level editing movement all these scary things in game development are wildly uncomplicated compared to other engines I could explain all those things to you in like 60 seconds but I don't have to because there are so many tutorials online that can teach you how to do it because the community is massive there's a reason why undertale used it remember Toby Fox was not not a professional developer but he's still made undertale because game maker is extremely beginner friendly there's a code option where you can obviously write code for your game or a visual drag and drop option which can be a really nice introduction to just learning how to think like a programmer and make your very first game we're talking Hotline Miami hyper light Drifter Katana zero Delta Rune also of course those iconic Indie titles have all been made in game maker it's completely free to use for any non-commercial games you make and if you do decide to sell your games it's it's a onetime fee for any PC web or mobile exports you might make and of course they also offer console exports download game maker for free using the link in the description I am so excited to see all the Indie Games you guys are going to bring into the world with game maker now that my friends is why undertale is the most horrible game ever written and I hope it's clear by now we know I was not talking about the gameplay the dialogue or the story because that is incredible the game is imperfect it's quirky a little weird a little funky but it's a lovable story and it's really cool to see how many other games it's gone on to inspire I'd be willing to bet that at least 50% of solo game developers could tell you that they were inspired by undertale that's all I got though I'm losing my voice I hope you have a wonderful rest of your day a wonderful rest of your day if you're interested in joining a community of game developers check out the Discord server Linked In the description I'll see you guys in the next one bye hey there are dogs in the game and you can pet the dogs this might not be the first game to have so many dogs you can pet as many dogs you can pet but people have been wanting their whole life is a game where you can pet a lot of dogs