Modding Persona 5 Royal on PC/Switch

16

UPDATED 10/24/22: Corrected some minor inaccuracies, mentioned new mod loading methods that have just been released

We asked, and apparently Atlus listened– Persona 5 Royal released for PC and Switch on October 21, 2022. Whether you’re using the Steam or Windows version, you’ll be happy to hear the game is largely unchanged from its initial PS4 release, so existing P5R mods should be compatible with PC after a little tweaking.

Accessing Game Files on Steam

Right click the game in your Library, go to Manage > Browse Local Files.

You can read my guide on how to mod the PC version here.

Accessing Game Files on Switch

On PC emulators, such as RyujiNX and Yuzu, simply right click the game and choose to extract RomFS data.

Or, on Switch, use the homebrew nxdumptool to extract the data.

Whether you’re modding the game on emulator or on console, you can read my guide on modding the Nintendo Switch version here.

Current State of Modding

As of right now, there’s no mod support patch released, nor an update for mod managers such as Aemulus in order to merge multiple mods together with ease.

Fortunately, on both fronts, developments are being made in the meantime. You can still follow the guides linked above to manually load modded files yourself. It’ll be updated as soon as possible pending any new breakthroughs.

UPDATE: Aemulus Package Manager has been updated to support merging mods for the Switch version, and a mod loader has been released using Reloaded II on PC. Aemulus won’t be coming to the PC version, as the Reloaded II mod loader is planned to eventually support all the same features, except optimized for direct file loading rather than .CPK creation.

On Switch hardware, you can also enjoy a 60 FPS cheat made by DeathChaos. It doesn’t seem to have any major bugs or performance impact.

The Main Changes

Really quickly, I want to explain the few things that did change. These will impact mod creators and end users alike, so it’s important to understand.

1. Denuvo & New CPK Names

Concerning the PS4 release, just like on PS3, there were two main archives containing most of the game’s assets: ps4R.cpk and dataR.cpk. The data one contained things like models, scripts, and field data that doesn’t change much between platforms. On the other hand, the PS4 one contained stuff that did vary in format– videos, sounds, and textures.

In addition to that, there were also .CPK archives for the Japanese voice track, English/French/Italian/German/Spanish translations, and files patched in updates.

But on PC, it seems that most of the game’s data was moved to one massive BASE.CPK, and each supported language got its own .CPK. Additionally, video files and sounds for each language were separated as well.

For the uninitiated, a .CPK file is a Criware Package— you can think of it like one big zip file containing all the other files. We have software to extract the files from them, and we can also rebuild them by putting the files in a mod manager like Aemulus and building a new .CPK.

You might remember that on PS3 and PS4, fans patched the executable to support loading from a new .CPK that doesn’t exist in the game by default: mod.cpk. This is the filename that our mod managers default to for P5R, but it’s not known yet when, or if, P5R PC will get a mod.cpk patch (spoilers: it did). That’s because the executable is protected by Denuvo, proprietary DRM that calls itself “anti-tamper technology.”

It’s likely that Atlus only includes the Denuvo roadblock to prevent piracy, since without it, the game could be cracked with astronomically less effort. But Denuvo also prevents modders from decompiling, analyzing, and modifying any virtualized functions of the game’s executable. The ability to do so is pretty essential for creating patches, which made projects like Persona 5 EX possible on previous editions of the game. Until a proper workaround is somehow devised, any changes to the main logic of the game should be considered unfeasible for now.

CORRECTION: While Denuvo does add another degree of challenge to reverse engineering, aggressive inlining of code is what makes it so difficult to decompile and patch functions modders are interested in.

But on the bright side, this only applies to PC– creating patches for the Switch version is more in line with how it’s always been on PS3. Also, we still have .DLL Injection (using avenues such as ASILoader and Reloaded II) at our disposal. This all may seem reminiscent of the situation with P4G modding on PC, where we have to use Reloaded II to modify the game’s memory at runtime.

At the very least, we can still modify assets with relative ease– including scripts, maps, models and music/sound. That’s enough that you could (theoretically at least) build an entirely new game in the engine of P5R PC with enough time and dedication.

So, how do we replace assets now?

At first, we had to extract 62 GB worth of files from BASE.CPK, combine it with 700 MB of files from EN.CPK, and repack it into a new, whopping 62 GB BASE.CPK. This triples the size of the game since for some reason, compressing the CPK would crash the game.

Fortunately, a recent release by Sewer56 and Lipsum (A.K.A. Zarroboogs), called “Persona 5 Royal Essentials,” means we can use Reloaded II to load modded files directly on PC, rather than fuss with .CPK files at all. In fact, there’s no need to extract them at all anymore if you’re just installing downloaded mods! More info here.

The Switch version’s PATCH1.CPK can simply be unpacked and repacked without extracting and rebuilding several gigabytes of files first.

Fortunately, on Switch it’s a bit easier because there’s a PATCH1.CPK containing only one video file. You can easily unpack and repack that with modded files, similar to the now-outdated procedure for PC.

2. New Texture Res, .GNF to .DDS Format

Some textures, most notably for fields, bustups, and Thieves Den images, used .GNF format on PS4– which is only really used on Sony consoles. Since we’re now dealing in the realm of Microsoft, .DDS (their DirectDrawSurface image format) seems to take precedence.

That means any mods that used .GNF need to have them converted to BC7 .DDS. Paint.NET is a free image editing tool that can save images in that format using a plugin. As for converting from .GNF, GFD Studio can open and export these files as .PNG.

You’ll also want to keep in mind many assets have been upscaled to support 4K resolution, so you may want to AI upscale or otherwise remake your modded textures coming from previous editions– especially UI textures.

3. Unpacked Field .PACs

For whatever reason, it seems this time field data is no longer contained in .PAC files, which is one less hindrance to consider when creating mods. Porting modded field files is another story, since you’ll have to unpack and rename the files from each .PAC. This can be done automatically using a batch script and PakPack.exe from AtlusFileSystemLibrary:

for /r %%i in (*.pac) do pakpack.exe unpack "%%i"

Save this as a .bat file, put it in the same folder as all the .pac files you want to unpack, and also download PakPack.exe and place those files in the same folder. Run the .bat and it will auto-extract everything!

Fortunately, you don’t have to worry about whether the filenames and folders are uppercase or lowercase, since the game will load them either way.

4. New Audio Encryption

On PS4, .ACB and .AWB files contained .ADX files encrypted with a certain key. On PC/Switch, the key was updated, so you’ll have to decrypt and re-encrypt the .ADX files to port them to this new platform… Which is a hassle, but can probably easily be automated in the near future. For now, here’s some batch files that might help out with that.

By the way, on Switch, the audio format was changed to .HCA instead of .ADX, but both formats can be used interchangeably on both PC and Switch, which is great news for supporting mods on both platforms!

Future Developments

I’ll keep updating the guide on docs.shrinefox.com as new information and tools are released! Hopefully for now, being able to work on manually porting individual files will be good enough to satisfy you all. I know this is a very exciting, but also very ambitious time for Persona modders, but be sure to take your time.

There’s no rushing these things, and no matter how long it takes, we’ll still always have these excellent new ports to enjoy on our favorite platforms from now on.

I look forward to seeing how the Persona modding scene grows and adapts in the coming years, and what awesome creations await. If you need me, I’ll be busy updating my own mods and sharing them here when they’re ready. Be sure to drop a line on the Troubleshooting Forum if you have any questions of your own.

16

Leave a Reply

Your email address will not be published.