Page 1 of 1

[P5R] Editing .gnf Bustups?

Posted: Thu Sep 23, 2021 4:44 pm
by wudabed
I'm currently working on a mod that involves the replacement of a bustup, however upon extracting the .bin for the bustup I saw that the files were in .gnf rather than .dds
I attempted referencing the wiki for any information on the format but the page for Persona 5 Royal simply listed it as one of the filetypes used in the game with no corresponding article existing
I did some further digging on the internet about the format and found that Noesis was capable of viewing .gnf files and exporting them to standard image formats however it's not capable of repacking images back into .gnf which is necessary for making the mod

Is there any tool that can both unpack and repack the .gnf files?

Re: [P5R] Editing .gnf Bustups?

Posted: Thu Sep 23, 2021 4:48 pm
by DniweTamp
The only tools for generating new GNF images are PS4 SDK tools

The game should still be able to read dds bustups though, if that doesn't work try tga (yes, it can read tga)

Re: [P5R] Editing .gnf Bustups?

Posted: Fri Sep 24, 2021 4:00 pm
by wudabed
I exported the files in the bustup archive to .dds via Noesis, removed the .gnf s, did my edits, repacked the folder into into a bin and attempted to load the mod but the game crashed when the bustup was loaded
Not sure if it's an issue with the way I'm saving the edited files in photoshop

For reference I'm using DDS2Tool to pack/unpack the bin (PS4 Bustup Repacker can unpack the bin but won't pack the folder if there's .dds files inside)

Re: [P5R] Editing .gnf Bustups?

Posted: Fri Sep 24, 2021 10:00 pm
by Century_
As long as you save your bustups as dds with BC3 (DXT5) compression, the game should be able to read them. You do have to make sure they don't have any mipmaps though.

Apart from this, you should try editing the bustup .bins using amicitia or building them again from folders using PAKPack.

Re: [P5R] Editing .gnf Bustups?

Posted: Sat Sep 25, 2021 2:09 pm
by wudabed
So I
-Saved the edited main bustup image (b210_000_00) as a .dds with BC3 (DXT5) compression
-Opened the .bin for the bustup in amicitia, deleted b210_000_00.gnf, and added the .dds file (using the replace function just renamed the file extension to .gnf that when exported wasn't viewable in noesis unlike the normal .gnf)
-Saved the bin
-Built the mod.cpk and loaded it into the game

And when the bustup was called in game surprisingly the game didn't immediately crash this time but but there was nothing there except for these small squares in the top-left of the area where the sprite would normally be
Upon exiting the shop menu which should cause the sprite to disappear the game did crash however

Alternatively I repeated the same process in the bullets except replacing every file in the bin with a .dds verson (b210_000_00_e1, b210_000_00_m1 etc.) but the game just crashed upon trying to draw the sprite like in my previous post

Image
This is how the folder with the .dds files looks like (the edited bustup isn't my actual mod just a quick edit for testing purposes)

Re: [P5R] Editing .gnf Bustups?

Posted: Sat Sep 25, 2021 6:28 pm
by Century_
You have to make sure the texture has no mipmaps, because P5R doesn't support them. The Nvidia texture tool tends to save dds with a mipmap count of 1, even when you don't select the "generate mipmaps" option.
I'd recommend you take a look inside each .dds file using the DDS binary template for 010, once you're in, change the mipmap count from 1 to 0 and save it.

DDS Binary Template Here:

Re: [P5R] Editing .gnf Bustups?

Posted: Sun Sep 26, 2021 11:23 am
by wudabed
Image
Image
I changed the mipmap count to 0 for each dds and saved it for each, repacked them into the bin through Amicitia like before but the game still crashes at the same spot

Re: [P5R] Editing .gnf Bustups?

Posted: Sun Sep 26, 2021 6:13 pm
by Century_
Did you make sure to edit the flags section of the header and the dwCaps section? Those might be causing the crash.

Image

Re: [P5R] Editing .gnf Bustups?

Posted: Tue Sep 28, 2021 6:06 pm
by wudabed
Also edited the mipmap count in the flags and and dwCaps section to 0 for each of the .dds files and packed the bin through the same process as before, still crashes at the same spot
Image

Re: [P5R] Editing .gnf Bustups?

Posted: Tue Sep 28, 2021 7:36 pm
by Century_
I have no idea why your texture keeps crashing the game, the way your header looks isn't very far off from what a normal P5R texture's looks like. Maybe you could try editing the depth field in the header? That seems to be put on 0 for Royal textures.
Image