Modding Undertale

This is a guide/tutorial on modding Undertale, for both Windows and Mac.

Extracting the resources

First, you will need to extract the resources of Undertale so you can change them.

If you're using Windows:

If you're using Mac:

Changing the text

Inside the "assets" folder are two text files: "STRG.txt" and "translate.txt" which are currently identical. You'll want to make your changes inside of "translate.txt".

Note that the text in Undertale is stored in a special format, where certain character combinations do certain things.
I don't recommend changing the characters at the end of a line (/, /%%, %%, %, /%, /*, /^ and \C), these control the flow of the dialog and changing them could break things.
& or # stands for a newline and \z4 seems to be replaced with a infinity character.
\T followed by a character changes the text sound and font. Again, I recommend not changing them, because you can't change the default for a character, only change it mid-sentence.
\E, \F and \M all followed by a number also do... something, again, I recommend not changing them.
The text color is controlled by the following sequences: \W - white
\X - black
\p - pink
\R - red
\O - orange
\Y - yellow
\G - green
\L - cyan
\B - blue
\P - purple
These can be changed without issue.
You can find more detailed information here (also were I took the color codes from).

Changing the textures / sprites

Inside the "assets" folder is a folder called "TXTR" with 16 files containing the sprites of Undertale.

Note that there is something special about the sprites, each is 2 pixels bigger on each side (4 inside "1.png"). There are two ways that this is done:
Duplicating the pixels on the border of the sprite, as seen here:

The red edge is the actual border, everything between the blue and red borders is duplicated on all sides. This seems mostly done with the sprites.

Or "looping" the pixels from the other side, as seen here:

The red edge is the actual border, everything between the blue and purple lines is duplicated on the opposite side. This seems mostly done with the backgrounds / tilesets.

Changing the music

The easiest to change, simply change / replace the .ogg files that are found with "data.win" / "game.ios" in your copied folder / .app.

Changing the sounds

Inside the "assets" folder is a folder called "AUDO" with all of Undertale's sound effects. Make sure that, when saving them, you save them as 16-bit wav, not 32 bit.

Testing

After editing things, you probably want to test your mod.

If you have Windows:

If you're using Mac:

Getting ready for publishing

When you're done with your mod, you probably want to upload it somewhere.

The simplest way to do this is to create a new folder and put winextract, winpack, the .bat files and the "info.txt" file in it.
Make a folder called "sounds" and put all the sound files that you edited in it. Also make a folder called "textures" and put all the textures that you edited in it.
Put a copy of your "translate.txt" with the .bat files.
If you have edited the .oggs, copy all the changed .ogg files into a folder called "music" and put that with the rest of the files / folders.
You'll also need to create a readme file with instructions. Here is a example for the installation instructions: Installation instructions for Windows: (always choose replace when asked.)
Find your UNDERTALE.exe. The steam version is located at "C:\Program Files\Steam\SteamApps\common\Undertale".
If it is the DRM-free version, use a unarchiving utility to unpack it.
Make a copy of the folder and rename "steam_api.dll"
Copy the "data.win" file into this folder (the one with this readme) and run "unpackwin.bat".
Put all the files from the "sounds" folder into the "AUDO" folder within the (new) "assets" folder
Put all the files from the "textures" folder inside the "TXTR" folder within the "assets" folder.
Put the "translate.txt" file inside the assets folder.
Run "repackwin.bat".
Copy "data.win" back into the copied folder.
Copy the .ogg files from the "music" folder into the copied folder as well.

Installation instructions for Mac: (always choose replace when asked.)
Install winebottler. Download it at http://winebottler.kronenberg.org/ .
Find your UNDERTALE.app. The steam version is located at "~/Library/Application Support/Steam/SteamApps/common/Undertale".
Make a copy of the .app, right (ctrl) click it and open "contents/resources".
Copy the "game.ios" file into this folder (the one with this readme) and run "unpackmac.bat".
Put all the files from the "sounds" folder into the "AUDO" folder within the (new) "assets" folder
Put all the files from the "textures" folder inside the "TXTR" folder within the "assets" folder.
Put the "translate.txt" file inside the assets folder.
Run "repackmac.bat".
Copy "game.ios" back into "resources".
Copy the .ogg files from the "music" folder into "resources" as well.
After putting everything together, simply zip it up.


If you have questions, recommendations or need help, send me a message with the contact-form found here.