Skip to content

Instantly share code, notes, and snippets.

@CatoTheYounger97
Last active November 11, 2022 13:28
Show Gist options
  • Save CatoTheYounger97/ddc2dd4ec459212466ea6f9887bc764b to your computer and use it in GitHub Desktop.
Save CatoTheYounger97/ddc2dd4ec459212466ea6f9887bc764b to your computer and use it in GitHub Desktop.
YoYo Loader Externalising and Compressing Textures (PVRTC2_4BPP) Instructions:

YoYo Loader Externalising and Compressing Textures (PVRTC2_4BPP) Instructions:

  • This manual texture externalisation method provides 2x compression compared to the built in YoYo Loader optimisation.
  • For reducing the size of the game.droid file, overall file size, memory usage and memory bandwidth over gpu.
  • Note: This is a very time consuming process that will heavily utilise your CPU.

You Will Need:

Setup:

  • Run the "PVRTexToolSetup.exe" installer and complete the installation.
  • Extract UndertaleModTool to a directory on your PC.
  • Place the "ExternalizeAllTextures.csx" in one of the UndertaleModTool sub folders ending in "scripts".
  • For example, "CommunityScripts". (It doesn't mater which one).
  • Make a backup of your data.win/game.droid.
  • If your game is a PC asset swap, contruct the Apk and make a backup.

Step 1: Optimise the game apk on vita

  • Place the game Apk on your vita, in the normal YoYo Loader data folder:
    ux0:data\gms\[game folder]\game.apk
  • Open YoYo Loader, navigate to the game name and open the traingle menu.
  • Select "Compressed Textures" and then run "Optimise Apk with Sounds Externalisation".
  • Leave it to complete the process and move on to step 2.

Step 2: Externalise and compress embedded texture files

  • Open the game.droid file of your game in UndertaleModTool.
  • Navigate to the "Scripts" tab, find "ExternalizeAllTextures.csx" and click to run it.
  • Click yes to the pop up. (this confirms that you would like to compress the textures. If you don't you should use YoYo Loaders built in texture externalisation).
  • You will then be prompted to locate "PVRTexToolCLI.exe" which you installed in "Setup". The default path for this is:
    C:\Imagination Technologies\PowerVR_Graphics\PowerVR_Tools\PVRTexTool\CLI\Windows_x86_64
  • Single click the "PVRTexToolCLI.exe" and press okay on the explorer window.
  • The externalisation will begin and take a long time. Your CPU will be heavily utilised, possibly affecting usabiltiy of your PC.
  • A folder will be created in the same directory called "ExternalizedTextures" containing all compressed texture files (x.pvr).

Step 3: Replacing the externalised textures on vita

  • Ensure the Apk optimisation started in "Step 1" is complete.
  • Connect your vita to your PC with USB cable and navigate to your game asset folder:
    ux0:data\gms\[game folder]\assets\
  • Observe the numbered .PVR files inside.
  • Overwrite these numbered .PVR files with the files inside "ExternalizedTextures" folder, created in "Step 2".
  • The .PVR file sizes will now be half what they were previously.

Optional: Compressing to PVRTC2_2BPP
Note: for most games this will result in significant loss of texture quality (especially pixel art games). PVRTC2_2BPP compression also takes longer than PVRTC2_4BPP. The only game I recommend doing this for is "Cook, Serve, Delicious 3".

  • If compressing to PVRTC2_4BPP does not provide good results, you can try compressing to PVRTC2_2BPP.
  • This provides 4x compression compared to built in YoYo Loader optimisation.
  • Open the "ExternalizeAllTextures.csx" in a text editor.
  • Navigate to line 32 of the script:
    string pvrTexToolFormat = "PVRTCII_4BPP,UB,lRGB";
  • Change PVRTCII_4BPP to PVRTCII_2BPP
  • Follow this guide using the edited version of the script.

Visual Comparrison between YoYo Loader (DX5) and PVRTC2_4BPP Compression

YoYo Loader Built In Compression 2022-05-21-190023 PVRTC2_4BPP Manual Compression (this guide) 2022-05-22-015321 PVRTC2_2BPP Manual Compression (optional) 2022-05-22-020127 Original Textures Uncompressed image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment