Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CatoTheYounger97/10db240958c9ba17af9069a7f8cc1716 to your computer and use it in GitHub Desktop.
Save CatoTheYounger97/10db240958c9ba17af9069a7f8cc1716 to your computer and use it in GitHub Desktop.
YoYo Loader Reducing Size of Game Textures: For reducing the size of game.droid and game memory usage

YoYo Loader Reducing Size of Game Textures:

  • For reducing the size of the game.droid file and game memory usage.
  • Textures can be reduced in size by up to 70%.
  • Note: Doing this won't guarantee your game will start working in YoYo Loader.

You Will Need:

Setup:

  • Extract UndertaleModTool to a directory on your PC.
  • Extract pngquant to a directory on your PC.
  • Move your data.win/game.droid to a new directory.
  • Make a backup of your data.win/game.droid file.

Step 1: Exporting all embedded texture files

  • Open the game.droid file of your GMS game in UndertaleModTool.
  • Navigate to the "Scripts>Unpack assets" tab, find "ExportAllEmbeddedTextures.csx" and click to run it.
  • A folder will be created in the same directory called "EmbeddedTextures" containing all embedded texture files.
  • You do not need to save the game.droid file at this time.

Step 2: Reducing exported texture size with pngquant

  • Locate the "pngquant.exe" in your pngquant directory and copy and paste it into the "EmbeddedTextures" folder.
  • Launch Command Prompt and change directory to the "EmbeddedTextures" folder:
    cd C:\[YourFilepathToTheFolder]\EmbeddedTextures
  • Now run the following script in Command Prompt:
    pngquant *.png --f --ext ".png"
  • This script will use "pngquant.exe" to reduce the size of all textures with no noticeable loss to visual quality.
  • Once the conversion is complete, delete the "pngquant.exe".

Step 3: Re-importing all embedded texture files

  • Open the game.droid file of your GMS game in UndertaleModTool.
  • Navigate to the "Scripts>Repack assets" tab, find "ImportAllEmbeddedTextures.csx" and click to run it.
  • Save your game.droid file. It should be smaller in size.
  • The "EmbeddedTextures" folder can be deleted.

Step 4: Repacking the assets

  • You can now simply drop your new game.droid file back into your APK.

NOTE: Textures can be further reduced from the default pngquant settings, though this will impact visual quality.

  • all available options for pngquant can be found by: pngquant -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment