Undertale is a 2D role-playing video game created by indie developer Toby Fox. Undertale has three main endings: Neutral, True Pacifist, and Genocide. This TAS achieves the True Pacifist ending ("good ending") and Genocide ending ("bad ending") at the same time. To do this, the player must complete the game without killing any monsters or bosses, but at the same time kill all the monsters in each area and then kill each area's boss. On the way, we do other funny glitches to amuse the viewer. The TAS is optimized primarily for viewer enjoyment and then for time.
The goal of achieving both endings at once is impossible in the normal game, but can be made possible with a minimal amount of save file manipulation and noclip. Specifically, by starting the game with a glich item known as the Punch Card and by enabling noclip for a single frame, we can achieve this goal. This TAS is meant more as a joke superplay showcasing many of the cool glitches found in Undertale instead of a true speedrun starting from a legitimate starting point.
For the TAS to sync, you must check Runtime > Time tracking > clock_gettime() and disable Runtime > Prevent writing to disk. You must also avoid fast-forwarding through frame 72389 of the TAS. I think this is some sort of libTAS bug where fast-forwarding may incorrectly emulate audio volume, since in that area of the TAS there is a cutscene that fades out the music, and thus runs shorter or longer depending on how loud the music is. You can fast-forward and set the TAS to pause at 72389, advance a few frames manually, and then fast-forward the rest to correctly run through the TAS.
This TAS is slightly modified from the original TAS, which used many music mods and some visual mods and has several memes tailored more towards the Undertale speedrunning community. The version of the TAS I am submitting is probably more suitable for an audience unfamiliar with our memes and inside jokes. However, for completeness the original version is embedded below.
Game objectives
- Emulator used: libTAS v1.4.2 (32-bit)
- Plays on version v1.0
- Reaches both the True Pacifist and Genocide endings simultaneously
- Performs other amusing glitches along the way
- Avoids taking damage, unless it is required for a trick or saves time
This TAS features complex and unintuitive routing, and heavy usage of RNG manipulation and complex glitches. The run involves following the True Pacifist route until the Papyrus fight, constantly making sure to avoid setting the "redemption flag", which irrevocably aborts Genocide (further explained below). Then we save and get a Neutral ending, which is required for True Pacifist. Next we complete the True Pacifist requirements and beat the final boss Asriel, again avoiding the redemption flag, while also setting up glitches to be used later in the Genocide section. This puts us in the game's epilogue, which grants access to the Ruins again. This is the game's tutorial area; during normal gameplay it gets blocked off after completing it. We now turn to fulfilling the Genocide requirements. We use a glitch involving the Hotland lasers to fulfill the kill requirements for each area, then use a time-travelling glitch to warp back to the start of the game. We replay nearly the whole game in Genocide mode and kill each area's final boss. With the Genocide requirements now fulfilled, but still in the True Pacifist epilogue, the game is now in a state in which we can, from the very same save file, exit the Underground and trigger the True Pacifist ending, or alternatively trigger the final Genocide cutscene and have the Fallen Human destroy the world.
Tricks Used
Wall Humping
Wall humping is a movement technique where the player oscillates between facing up and facing down each frame. This technique is performed by holding Up and Down simultaneously while against the bottom side of a wall. This can be useful in certain circumstances such as when you are moving left or right but need to be facing up or down. In rooms where the player is in contact with and between two horizontal walls, this technique will cause the player to move at double speed, as the two walls both move the player simultaneously.
Menu buffering is a movement technique where the player opens the menu and presses an arrow key on the same frame. This type of movement does not count as a step for random encounters and is not considered movement by blue lasers. Although menu buffering causes the player to move at half speed (alternating between the menu buffer and closing the menu), this technique can save time in certain circumstances where additional steps are not desirable.
Punch Card Exploit (PCE)
Although the punch card can be used to trigger many different exploits, PCE refers specifically to a glitch where the player menu buffers onto a cutscene trigger, uses the punch card from the item menu, then closes the punch card to regain movement in the cutscene. The reason this glitch happens is because there is one frame between using the punch card from the item menu and the punch card opening where the player has full control, and it is during this one frame that the cutscene trigger is activated. Because most cutscenes only lock movement at the very start of the cutscene, the punch card's own ability to unlock movement after being closed is enough to skip the entire cutscene.
There is a variation of PCE called PCE slide where instead of menu buffering onto the cutscene trigger, the player uses the one frame of full control to walk onto the cutscene trigger, which also triggers the cutscene.
Wrong Warp
In Undertale speedrunning, wrong warping refers to entering a room and being placed at the default location in that room rather than the door the player entered from. When the player touches a room transition, the variable global.interact is normally set to 3. Then once the player reaches the next room, the game checks if global.interact is set to 3 and if it is, the game runs the code that places the player at the appropriate door marker. However, if global.interact is not 3, the player is not moved from the default location in the room. This default location is manually assigned per room by the game developer and is often closer to the middle of the room than the door marker is. There are several methods of triggering a wrong warp, all of which achieve the same result: setting global.interact to 0 (the value for full player control) while transitioning to the next room.
Text Corruption
Text corruption is a glitch which allows changing cutscene text in some, but not all cutscenes that have multiple sets of textboxes. Certain text boxes, such as dropping an item, use a variable called global.msc. When a textbox is created, the object creating the textbox assigns a value to global.msc, which is then used to lookup which set of text to display. By creating such a textbox between the cutscene's sets of textboxes, global.msc is changed to something unexpected, and so the following sets of textboxes will display the textbox that corresponds to the current global.msc value instead of the cutscene text that is meant to play.
Choicer Overflow
Choicer overflow in the context of Undertale speedrunning refers to a glitch that involves using multiple choicers at once to advance text beyond its normal limits. Choicers are types of textboxes that give the player a choice between two different options. These choicers also use the variable global.msc. If the set of text that is playing includes a choicer, global.msc is incremented by 1, which normally contains the post-choicer text, if any, as well as potentially other code that accompanies the selected choice. If another choicer is then activated, the value global.msc is incremented a second time and the corresponding set of text is displayed. This can be done repeatedly to advance global.msc to a particular value, as long as there are enough choicers available. This is used regularly in the TAS to showcase unused textboxes.
Persistence Glitch
The persistence glitch is the newest type of glitch in Undertale speedrunning. Rooms have a property called persistence, which saves the state of each object in the room. This property is set when entering a battle and then unset once the player returns. However, by leaving the room on the frame before a battle starts, the room persistence is never unset until one closes the game. Dying, for example, does not reset persistence.
Text Storage/Overflow
Text storage (also called overflow) is a type of glitch where the player regains movement while text is on the screen, often by using the Punch Card's 1 frame of full control to interact with a sign or NPC. This can be useful in different ways, as some text can be used to set global.interact to 0 upon closing the textbox. Text storage is necessary to regain movement during the exclamation mark that appears above the player's head as part of the transition to a random encounter, as using the Punch Card to do this doesn't work. Text storage can also be used to store the text in a persistent room for later.
Phasing Storage
Phasing storage is a glitch where the player enters a persistent room and has disabled collision, meaning you can walk through walls and completely avoid cutscene triggers and other objects. It can be triggered by entering a persistent room while also having phasing (disabled collision) enabled. In normal rooms this does nothing because there's a line of code that runs at the start of each room to disable phasing, but in persistent rooms this code never runs.
Plot Warping
Progress through the game's story is almost entirely handled by a single variable known as global.plot, exceptions being nonlinear areas such as CORE and True Lab. When a cutscene ends, global.plot is set to a certain value corresponding to the cutscene. All cutscenes destroy themselves upon being initialized by entering the room if global.plot is greater or equal to the cutscene's corresponding plot value, assuming (usually correctly) that the story has progressed past this cutscene. If this somehow doesn't happen, for example if the cutscene was stored in a persistent room, the cutscene can be triggered and finished, so global.plot will be set to that cutscene's value. This effectively "reverses time", because now all cutscene after this one will be trigger-able again since global.plot is low enough. Note that only global.plot is affected; other variables, such as the player's inventory or the Epilogue flag, remain unchanged.
RNG Manipulation
Undertale's RNG is determined by a seed that advances each time RNG is called. By calling RNG a different number of times, different outcomes can be achieved. Text calls RNG twice per character per frame and so changing how many frames text is displayed is the most common method of RNG manipulation. RNG is manipulated for various reasons such as getting particular monsters in random encounters and determining which step count random encounters will occur on. One thing to note is that the function randomize() is called upon loading into the game and this function sets the RNG seed based on the system time. However, after this initial seed, RNG is no longer affected by system time until the save file is reloaded or the game is restarted. RNG manipulation is used throughout the run and for the most part this is accomplished by delaying clearing text by some number of frames. Usually, the unlikelier an event is, the more frames it costs to manipulate RNG. While this does lose a small amount of time each time it's done, the various timesaves or funny glitches afforded by manipulating RNG more than make up for the few frames lost in the process.
In the first half of the run, we want to get to the True Pacifist epilogue without setting the "redemption flag". This flag is set by exiting a battle with certain enemies without having killed said enemy, aka by sparing or fleeing from the enemy. These enemies are: Toriel, Doggo, Lesser Dog, Dogamy, Greater Dog, Shyren, Glad Dummy, Monster Kid, Royal Guard 01, Royal Guard 02, and Muffet. Since we can't kill them, which aborts True Pacifist, we need to make sure we completely skip their battles.
Ruins
As mentioned earlier, we start with a modified save file. This file starts with all variables set to their defaults at the start of a run, with the only exception being that the Punch Card is in the first inventory slot. There is no default for the character's name, so we have some creative liberty in choosing the name. When modifying a save file, we don't have the usual 6-character name limit, so we use a very long and rather amusing name, which will be read out every time we die or when our name is read out by other cutscenes. The name involves control characters that change the text's color and which character reads out the text, among other cool functions.
In the Ruins, we only need to skip Toriel. This is not so simple, because her battle trigger can't just be bypassed via a simple PCE. We can, however, bypass it with persistence glitch. First we save at Toriel's house. Next we get persistence glitch off her battle. In battle, we kill her, which aborts True Pacifist. We re-enter the persistent battle room, which destroys the cutscene trigger, since the battle with Toriel is over. We exit the room again and die to an enemy, which for amusement purposes is another Toriel battle. This reloads the save file made at Toriel's house before we killed her, meaning we are back on the True Pacifist path. However, the persistent battle room remains persistent and with the battle cutscene completed, and as such we can just walk through the room and effectively skip the Toriel battle on this save file.
Snowdin
In Snowdin, we need to skip Doggo, Lesser Dog, Dogamy, and Greater Dog. All of them are easy to skip using the Punch Card.
We move on to the Papyrus battle and die to him 3 times. On the 4th try, he will let us pass without a battle, but before that we save in Snowdin Town. This is because once we beat Papyrus, the Snowdin encounters get deactivated. We need them later after the Neutral ending to set up persistence glitches, so we save now.
Neutral ending
We then continue the run through Waterfall, Hotland, CORE and New Home to the end of the game, beating Asgore and Photoshop Flowey. Afterwards we reload the save back to Snowdin. Because of this, we don't care about keeping the True Pacifist or Genocide requirements active, and can kill or spare enemies however we like. Getting a Neutral ending is a requirement for True Pacifist, which is why we do this whole section.
Snowdin
We reload our Snowdin save file and go through every room with random encounters in Snowdin and get persistence glitch in all of them. This is important for the glitch to get the Ruins kill requirements during the Epilogue later. After the last persistence glitch, we die to the enemy, because it's faster than walking back to Snowdin. The persistence glitches all stay active between deaths.
After beating Papyrus (remember that we saved after the 3rd try so this is our 4th try, so he just lets us pass), we go date him. This is a requirement for the True Pacifist ending, and additionally has quite a few amusing glitches.
Waterfall
In Waterfall, we need to skip Shyren, Glad Dummy, and Monster Kid. The latter two enemies only occur when actively on the Genocide path, however Shyren is always there. Her trigger is unskippable, both via PCE and via persistence glitch. So, this is the only point in the run in which we use noclip to get out of bounds and just walk around her battle trigger.
At Undyne, we get persistence glitch off her battle. This will keep the battle cutscene and the Undyne chase object active in the room until the game is closed. We can use this to plot warp later.
Hotland
In Hotland, we need to skip the Royal Guards and Muffet. Both can be skipped via simple PCEs.
After skipping the Mettaton News Show, we take a trip to Waterfall to date Undyne, which is a requirement for True Pacifist. That way, later after completing the CORE we'll get a phone call from her telling us to visit her in Snowdin to pick up a letter for Alphys. Normally it's faster to date Undyne after CORE, since she'll directly give you the latter at the date, but we actually want to do glitches using her phone call, so we date Undyne now.
After completing CORE, as explained we go to the bridge to CORE and get a phone call from Undyne. This phone call locks us into True Pacifist route by guaranteeing that we'll get the Undyne Letter from Undyne in Snowdin. As such, we can now concentrate on fulfilling the Genocide requirements without worrying about not getting any kills.
However, that phone call doesn't disable random encounters (they only get disabled upon actually receiving Undyne's Letter), so we can go to CORE and kill some enemies to start working on the Hotland/CORE kill requirements. This was fixed in all subsequent versions after 1.0. We will fully complete the kill requirements later. While in CORE, we get persistence glitch in the Warrior's Path, which will store the scripted encounters there for later.
Snowdin
We head to Snowdin yet again and grind Snowdin kills. We enter the persistent bridge room, and since it was made persistent before Snowdin encounters were disabled by beating Papyrus, we get an encounter. Killing the encounter reactivates all Snowdin random encounters, since the game only disables them if both Papyrus was beaten and we have zero Snowdin kills. Since we now have 2 kills, we can now grind out more encounters. We get 13 out of the 16 Snowdin kills we need for the Snowdin kill requirements. It is important that we kill Snowdrake at least once, since that is also a requirement for Genocide. We will get the remaining kills via a different exploit shortly.
We then get Undyne's Letter (and Undyne's Letter EX). This permanently disables random encounters across the entire game, so we will need to find some other way to fulfill the area kill requirements.
Hotland
We head back to Hotland and date Alphys, which is a True Pacifist requirement. Interestingly, the game doesn't update the number of enemies killed to 0 during the date-battles, so we automatically get the last 3 required Snowdin kills simply by completing the Alphys date.
We then go back to the Undyne Arena and, since the room was persistent and the Undyne chase object was stored, we can fight her again and kill her. This plot-warps us to after the Undyne battle, so we can now go through Hotland again and all the cutscenes are back.
We go kill the Royal Guards, which is a Genocide requirement, and also set up persistence glitch there, which sets up a plot warp. We will use this after the Asriel battle to reactivate the laser mini-battles, which we will use to fulfill the area kill requirements later.
We head through Hotland to the Mettaton battle and kill him, which is a Genocide requirement. Note that for Genocide the game doesn't care if we kill Mettaton EX or Mettaton NEO. Also note that we didn't have to complete CORE again, since progress through CORE is not determined by our plot value, but by seperate flags.
True Lab and New Home
We progress more or less normally through True Lab, walk through New Home, and finish the Asriel battle, which enables the Epilogue flag. This means we can exit the Underground to get the True Pacifist ending. We can also explore all of the Underground, including the Ruins, which normally is blocked off by a closed door, but is now accessible again.
Hotland
We go back to Hotland and activate the plot warp in the Royal Guards room. We then demonstrate the glitch used to grind out all the remaining area kill requirements: the lasers. During the Asriel battle, a flag is set that doesn't allow you to die; instead your soul fuses back together and the last battle you were in is restarted. The laser mini-battles don't count as battles in the game's eyes, but you can still die to them, so if you do just that, the game will load you into the last other battle you were in. In this case, it's still the Asriel battle, but we will change that next.
We progress to CORE and enter the stored Warrior's Path triple encounter. This will now be stored as the last battle.
We go back to the lasers on floor 1 and die to them. As explained, this re-loads the Warrior's Path triple encounter, which we kill. We repeat this process until we have 37 out of the required 40 Hotland kills. We will get the remaining kills using scripted encounters later.
Our next goal is to change which area our kills count towards. The game uses a flag known as the "area kills pointer" for this. It is updated to the correct area every time the player enters a room with random encounters, unless the room is persistent.
So we now head to Ruins and go to the last "perspective puzzle" room, which has Ruins encounters. This updates the area kills pointer to Ruins. Then we go back to the Hotland lasers. Since we made all the Snowdin rooms with encounters persistent long ago, the area kills pointer doesn't update to Snowdin when passing through those rooms. We head to Hotland and go back to the laser room, making sure not to enter any Hotland rooms with encounters. In the same fashion as before, we die to the lasers and kill the Warrior's Path triple encounter over and over, except this time the kills count towards the Ruins kill count instead of the Hotland kill count. We grind to 18 out of required 20 kills. We will get the remaining kills using Toriel later.
Finally, we repeat the same for Waterfall kills: we head to Waterfall to set the area kills pointer, then go to the Hotland lasers and grind kills. We grind to 16 out of required 18 kills. We will get the remaining kills using scripted encounters later.
Ruins
We head back to the Ruins again, storing a choicer along the way in Snowdin's Box Road, which is still persistent. We then set the area kills pointer back to Ruins and choicer-overflow Toriel's diary. Using the stored choicer in Box Road, we overflow one more time into the text corresponding to the dialogue with Toriel in her chair by the fireplace. This is the only instance in the game where a textbox instead of a cutscene sets the plot value, so by reading this text, we have plot-warped back to the point where we talk to Toriel in her chair, all the way at the beginning of the game in Ruins.
We can now battle Toriel again, and kill her, which is a Genocide requirement. Due to copy-pasted code, the Toriel battle always temporarily plot-warps the player back to the Napstablook battle; in normal gameplay this is always immediately fixed by the post-battle cutscene. So by getting persistence glitch off the Toriel battle, the post-battle cutscene doesn't have the chance to start; it would only start if we re-entered the persistent room. So by not doing that, we can go back to the main hallway in Toriel's house and progress back to the battle and kill her again. We need to restart the game to clear the persistence in the Toriel battle room first though. In this manner, we get the 2 remaining required Ruins kills.
Snowdin
In Snowdin, we need to kill Doggo, Dogamy, Greater Dog, and Papyrus as Genocide requirements. We have already completed the other Genocide requirements in Snowdin (killing Snowdrake and killing 16 Snowdin enemies).
Waterfall
In Waterfall, we need to kill Shyren, Glad Dummy, and Undyne the Undying. Doing so completes the area kill requirement of 18 kills as well.
Hotland
In Hotland, we need to kill Muffet, and additionally the Royal Guards to complete the 40 required Hotland kills. We have already killed Mettaton (the other Hotland Genocide requirement) by killing Mettaton EX earlier. This whole time we have also successfully avoided setting the redemption flag. Thus we have completed all of the Genocide requirements, meaning that the Sans fight (which itself is not actually a Genocide requirement) and the final Genocide cutscene can now be triggered.
New Home
This is where we can finally reap the rewards of everything we've set up in the TAS, since we are now in a sort of double-state of having completed both the True Pacifist and Genocide requirements.
We first save before Sans and skip his battle trigger, instead directly triggering the final Genocide cutscene. Since we didn't beat Mettaton NEO or Sans, our LV is still at 16. Those enemies usually set our LV to 19 and 20, respectively, so normally the player always ends a Genocide run with LV 20. On the frame before our save files get deleted by the Fallen Human, we reload the game.
This time, we beat Sans and then, since despite everything we are still in the True Pacifist Epilogue, we can exit the Underground and get the True Pacifist ending. Since we beat Sans, we have LV 20; normally the player always ends a True Pacifist run with LV 1, since no monsters should be killed in that route.
Coolest additional glitches
In addition to the overarching route of the TAS, which is described above, here is a list of some of the most amusing other glitches done along the way.
- 3:58 Unused textboxes "Mettaton Mortal Enemy Request" and "Bepis valley granola bars"
- 26:56 Stacking multiple songs on top of each other
- 30:25 Unused option "Bepis" as an article of clothing for both armors in the dialogue
- 1:13:18 Taking Papyrus farther through Snowdin than expected and going out of bounds
- 1:16:58 Overflowing many textboxes in Papyrus's house and getting unused textbox "TestMonster and its cohorts"
- 1:26:05 Getting the umbrella outside its intended bounds and walking around while diagonal
- 1:38:05 Overflowing 5 Glamburgers from the lab fridge
- 1:43:38 Overflowing lots of text at Napstablook and getting two Frisks onscreen
- 1:45:36 Thundersnail glitches
- 1:48:13 Duplicating Undyne
- 1:53:37 Visiting every vent and taking nearly all of them to a different platform than intended
- 2:02:27 Getting a text from Toriel outside of the epilogue
- 2:04:34 "Dropping" the Undyne Letter EX
- 2:11:53 Getting lots of Popato Chisps in the lab and getting unused Error Message from Toriel
- 2:19:14 Getting unused error text from Burgerpants
- 2:21:50 Turning Mettaton around in the lab and getting the menu cursor out of its intended bounds
- 2:26:29 Floating through the bedroom in True Lab and messing up the mirror with the umbrella
- 2:39:00 Dodging Asriel's hardest attack without moving
- 2:46:04 Fleeing from Asriel
- 3:15:08 Toriel Army and Double Toriel in the main hallway
- 3:30:28 Playing the piano in battle
- 3:50:32 Killing Sans before he falls asleep, then dating him in MTT Resort
- 3:52:40 Bricking the save file by saving in a "dog-checked" room (Result can be seen at 4:02:24.)
Special thanks
Special thanks goes to RichConnerGMN, who very often motivated me to continue working on the TAS, and to colinator27, iamanissue, Jean Poilu, OceanBagel, and again RichConnerGMN, who found or helped find many of the coolest glitches in the TAS.
Screenshots
feos: Updated annotations to only contain critical info, and platform Windows.
feos: Claiming for judging.
feos: Accepting to Alt as explained
here.