Where to start with P4G modding?

Describe your problem in as much detail as you can. Other users might help.
Post Reply
User avatar
yosuke
Posts: 8
Joined: Sun Feb 09, 2020 10:02 am
Has liked: 5 posts
Been liked: 1 post

I want to start modding P4G for Ps Vita, but I dont know where to start. How will I go about making simple texture edits? Is there a tutorial on how to extract certain files from the game, edit them and then replace the original so something will appear different ingame? Is it as simple as creating a patch then adding files in a directory that reflects a said directory in P4G's files to overwrite them and appear different? I'm really excited to start modding this game but I need a little help since I haven't used a Vita with CFW before so I need to get used to things. Is there a guide anywhere? Thanks.
Image atta boy yosuke you're in the ZONE
User avatar
ShrineFox
Site Admin
Posts: 290
Joined: Mon Oct 07, 2019 3:19 am
Has liked: 277 posts
Been liked: 115 posts

Here's some old guides that should still help as far as getting mods running

h-encore (hacking the Vita itself): https://amicitia.github.io/guides/vita/h-encore
rePatch (loading custom files ingame): https://amicitia.github.io/guides/vita/repatch
extracting p4g files: https://amicitia.github.io/guides/p4g/cpk-extract (they're also available for download at https://shrinefox.com/files so you don't have to dump your own)
using the mod compendium (to repack files): https://amicitia.github.io/guides/p4g/mod-compendium

I know it's a bit all over the place at the moment, if anything doesn't make sense feel free to ask for more details! As for textures, P4G uses P3P's model format (GMO) but they renamed it to AMD and added an extra header. To edit the models you'd need to either erase the header with a hex editor or use an old version of Amicitia to open the AMD and extract the GMO data (one of the releases on this page should work https://github.com/TGEnigma/Amicitia/re ... after=v1.5 )

After that it's a matter of using P3P's mod tools to edit the model/texture. I'm not that experienced with that yet, but there's some old posts about it:
https://www.tapatalk.com/groups/amiciti ... php?p=2638
Oh and here's a reupload of the tools mentioned in that thread
User avatar
yosuke
Posts: 8
Joined: Sun Feb 09, 2020 10:02 am
Has liked: 5 posts
Been liked: 1 post

ShrineFox wrote: Mon Feb 10, 2020 2:04 pm Here's some old guides that should still help as far as getting mods running

h-encore (hacking the Vita itself): https://amicitia.github.io/guides/vita/h-encore
rePatch (loading custom files ingame): https://amicitia.github.io/guides/vita/repatch
extracting p4g files: https://amicitia.github.io/guides/p4g/cpk-extract (they're also available for download at https://shrinefox.com/files so you don't have to dump your own)
using the mod compendium (to repack files): https://amicitia.github.io/guides/p4g/mod-compendium

I know it's a bit all over the place at the moment, if anything doesn't make sense feel free to ask for more details! As for textures, P4G uses P3P's model format (GMO) but they renamed it to AMD and added an extra header. To edit the models you'd need to either erase the header with a hex editor or use an old version of Amicitia to open the AMD and extract the GMO data (one of the releases on this page should work https://github.com/TGEnigma/Amicitia/re ... after=v1.5 )

After that it's a matter of using P3P's mod tools to edit the model/texture. I'm not that experienced with that yet, but there's some old posts about it:
https://www.tapatalk.com/groups/amiciti ... php?p=2638
Oh and here's a reupload of the tools mentioned in that thread
THANK YOU SO MUCH!! THIS IS AMAZING!! All of this is really helpful, thank you!! I already extracted my data.cpk file beforehand, is it safe to use that? Will it still work the same? Thank you!!
Image atta boy yosuke you're in the ZONE
User avatar
yosuke
Posts: 8
Joined: Sun Feb 09, 2020 10:02 am
Has liked: 5 posts
Been liked: 1 post

I tried using the CriPakGUI to unpack my data.cpk following this https://amicitia.github.io/guides/p4g/cpk-extract and I just got a blank folder, is that supposed to happen?
Image atta boy yosuke you're in the ZONE
User avatar
ShrineFox
Site Admin
Posts: 290
Joined: Mon Oct 07, 2019 3:19 am
Has liked: 277 posts
Been liked: 115 posts

Sounds possible that the data.cpk is still encrypted. It should look something like this in a hex editor, but if it's completely different you might have to try extracting it again.
Image
The easiest way to decrypt is using Vitashell to mount the game's ux0:app/TITLEID folder (PCSE00120 for USA) by selecting it, pressing Triangle and choosing Open Decrypted. Then you should be able to copy it out of the folder and/or send it to PC
User avatar
yosuke
Posts: 8
Joined: Sun Feb 09, 2020 10:02 am
Has liked: 5 posts
Been liked: 1 post

Thank you!! This was really helpful! I extracted a decrypted data.cpk and I edited a texture file of the battle icon for Yu Narukami, unfortunately it did not work though and I do not know what I did wrong

Steps:
- Extracted decrypted data.cpk to my computer
- I used CriPakGUI to open the data.cpk, and extract all of the files to my PC
- Then, I used Amicitia v1.9.0 to find the file I wanted. The directory of where this file was located is as follows:

data.cpk_unpacked > battle > battle_pack.bin > panel/btlpanel.bin > b_p_k01.spr

In the last file, I opened the Textures directory, and extracted the 2 files in there: b_p_k01 , b_p_k01_a

I extracted them as a PNG file, so I could edit in paint.net
- When I finished editing, I replaced both of the textures with their respective new counterparts.
- I double checked that they imported back as TMX files, and then saved my battle_pack.bin
- I then went back into CriPakGUI, and clicked Patch CPK
- I selected the patch data directory as

data.cpk_unpacked > battle

and selected my new CPK path as a random folder called 'mod'

- When it finished patching, I got a data.cpk file back, and then went into Filezilla
- Here, I installed rePatch on my vita, and created a directory that was something like

rePatch > TITLEID > data

and placed the data.cpk in there

- I booted up P4G, and the texture replacement did not work
- I went back into VitaShell, and instead replaced the games actual data.cpk, booted up P4G, yet again to no avail.

I have no idea where I went wrong. It feels really similar to the way modding works on Rhythm Heaven Megamix for 3DS, and I imitated some of those steps, but still have no idea why it didnt work. I hope I can get some answer or help with this. Thanks!
Image atta boy yosuke you're in the ZONE
mylifesalie
Posts: 9
Joined: Sat Feb 08, 2020 7:11 pm
Been liked: 5 posts

Are you using the latest repatch? I had the same issue until i changed to this older version:https://github.com/dots-tb/rePatch-reDu ... s/tag/2.71
User avatar
ShrineFox
Site Admin
Posts: 290
Joined: Mon Oct 07, 2019 3:19 am
Has liked: 277 posts
Been liked: 115 posts

Agreed, it's best to use rePatch instead of the game's actual installation directory. That way you don't have to reinstall the game if something goes wrong, and it's less data to transfer too. Using the custom eboot, you can make a brand new cpk (named mod.cpk) containing only the modified files. Makes it easier to diagnose why it might not be working, too. I've never used cripakgui's patch feature so idk if maybe the program put battle_pack.bin in the wrong directory of the cpk instead of replacing the original file.

Then again, P4G has a bunch of redundant duplicate files so I'm not always sure which ones are actually used or not. There's battle_pack.bin and battle_pack2.bin, and then also btlpanel.bin and btlpnlop.bin in the panel folder. To be on the safe side I'd just replace all the Yu icons in each of them.

Either way I recommend installing the AutoPlugin VPK from here with Vitashell and using the app it installs to get repatch so that you don't have to worry about configuring it. From there, you can put your mod.cpk in ux0:rePatch/PCSE00120/data/mod.cpk and EBOOT goes in ux0:rePatch/PCSE00120/EBOOT.BIN.

As for making a new cpk from scratch instead of using the patch function, there's a couple ways to go about that. Easiest way in my opinion is using the Mod Compendium. Clicking the New button will generate a folder for your mod, and from there you can put your new file in like this:
ModCompendium\Mods\Persona4Golden\YourModName\Data\battle\panel\btlpanel.bin
then it's just a matter of setting the Output Directory of your new cpk in the settings and clicking Build and transferring it over to your Vita.

Alternatively there's cripackedfilemaker which should be able to make a new cpk from a folder (matching the structure of the extracted cpk) like so:
C:\Users\Username\Desktop\Mod\battle\panel\btlpanel.bin
(the "Mod" folder in this example would be the one you choose to build the cpk from)
User avatar
yosuke
Posts: 8
Joined: Sun Feb 09, 2020 10:02 am
Has liked: 5 posts
Been liked: 1 post

IT WORKED!!! Thank you so much!! Image
Image atta boy yosuke you're in the ZONE
Post Reply

ShrineFox 2020 - 2023
Support | Progress | Labs | Privacy | Terms
This site is NOT affiliated, associated, authorized, endorsed by, or in any way officially connected with Atlus Co., Ltd, Atlus U.S.A., Inc. or Sega Games Co., Ltd, or any of its subsidiaries or its affiliates.