- 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:
- UndertaleModTool "GUI-windows-latest-isBundled-true-isSingleFile-true": https://github.com/krzys-h/UndertaleModTool/actions/runs/2363644069 (free github account required to get action build)
- ExternalizeAllTextures.csx: https://gist.github.com/JohnnyonFlame/9ed4032eb7226e60c37b255d70993cde
- PVRTexTool (free account required): https://developer.imaginationtech.com/downloads/
- Archive extractor. Example: 7zip: https://www.7-zip.org/
- Game files of your GMS game.
- YoYo Loader and your PS Vita
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.
YoYo Loader Built In Compression PVRTC2_4BPP Manual Compression (this guide) PVRTC2_2BPP Manual Compression (optional) Original Textures Uncompressed