Tools potential updates for P5R (may have spoilers)

Share, discover, or contribute to mods for Persona 5 Royal for PS4.
Post Reply
User avatar
Elvagan
Posts: 17
Joined: Sat May 09, 2020 6:03 pm
Has liked: 5 posts
Been liked: 7 posts

So I started to dig into the P5R files and found that some things changed.

For pac events :
- EVT and ECS are now encoded in LittleEndian. It seems that the events already present in P5 were not modified though. I managed to modify EvtTool to allow reading LittleEndian, all the procedures were here but the BigEndian reading was hardcoded ^^. (I take the oportunity to ask again if someone have the EvtTool sources, working on a decompiled exe is tedious :D )
Sadly for now I'm not able to play P5R events in P5, and I might never be as it probably want to load things that are not here (i tried importing all the models/animations used in the evt but it still crashes, maybe some textures are also missing?

For animations :
- The new version number is 0x01105100, this was an issue when i tried to load animations in GFD Studio. Some byte reading were made if the version was ">= 0x01105100", P5 version was 0x01105070 so it was ok but now I just removed the "=" in the comparaison and it worked like a charm.
I don't really know what those byte readings were for and so is the Tool developper as they were labelled "unknown1" and "unknown2" xD)

For models :
- I am currently able to load "Kasumi" models but not all "Sumire", it seems to be related to the glasses? If anyone have an idea on this one (maybe a new shader?)

We are not close to be able to mod P5R so there is no need to do these updates right now but at least the info will be here when the time comes. But if the devs want to do some testing/updates, i can point where to find files if they need any (but not here ;) ).

I'll post updates if I find new issues. For now I'll see if I can understand why the audio files I extract are all saturated (it might be reuired if someone wants to work on the P5D costume music mod requested earlier ^^)

Cheers
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 the EVTTool source, not sure why it never ended up on Github. Really glad to hear it was as simple as that and there weren't any other format changes! Would love to have the modified version. https://cdn.discordapp.com/attachments/ ... EvtTool.7z

I wonder if the reason they don't work in P5 is that they use new event functions exclusive to R, although I doubt that would be the case for every scene.

Also, here's a modified build of GFD Studio that should load more stuff from R. I think it skips embedded EPLs and supports the new animation version. Not 100% sure it'll fix the problem but worth a shot: https://cdn.discordapp.com/attachments/ ... fd_test.7z
User avatar
Elvagan
Posts: 17
Joined: Sat May 09, 2020 6:03 pm
Has liked: 5 posts
Been liked: 7 posts

Thanks a lot for the sources! It's a relief to be able to work on a clean code :D

Here is the modified version that should read EVT and ECS Royal files (only had to edit EvtFile and EcsFile). I didn't edit the writing methods as for now we can only work with P5 so writing an event back as a P5R format wouldn't be any use (i guess?).
https://cdn.discordapp.com/attachments/ ... EvtTool.7z
I don't know where to find LSD files, and didn't found any during my explorations, so if you know events that might contains one tell me so I could check if the format changed too.
Anyway don't take this code as a "release quality", it's just to be able to analyse the new events in JSON or with your EvtEditor application ^^

Talking about EvtEditor, I'm using it to try to find why the new events are not loading. Do you know the minimal commands required to have the field/camera and models load and wait for the user input (like writing a message or something) before exiting? Because all my attempts lead to the event loading and unloading in approx 0.5s, not really practicall to see if things are loading properly :D

On the topic of events:
My current guess is that even if I added Kasumi character in the game (imported her "model/character" folder with mod compendium) there are still files that i forgot to import, because, as soon as I try to set her inside an event it doesn't load.
Also if I replace another character by her (instead of just adding her folder), and load an event with the said character the event loads and I see Kasumi (of course with weird bones as it will use the other character's event animation).
Do you know if Atlus use tables to tell the events where to find the model/animations/etc... that I might need to update?

Edit: I just noticed that P5R events seems to use AnimationMajorId set to '1' on "character" definition while P5 ones uses '4'. It might be related but I don't know what these IDs are for :/

Cheers
User avatar
chlorophylls
Posts: 32
Joined: Sun Nov 24, 2019 7:24 pm
Has liked: 9 posts
Been liked: 28 posts

Elvagan wrote: Sun May 17, 2020 9:32 am Thanks a lot for the sources! It's a relief to be able to work on a clean code :D

Here is the modified version that should read EVT and ECS Royal files (only had to edit EvtFile and EcsFile). I didn't edit the writing methods as for now we can only work with P5 so writing an event back as a P5R format wouldn't be any use (i guess?).
https://cdn.discordapp.com/attachments/ ... EvtTool.7z
I don't know where to find LSD files, and didn't found any during my explorations, so if you know events that might contains one tell me so I could check if the format changed too.
Anyway don't take this code as a "release quality", it's just to be able to analyse the new events in JSON or with your EvtEditor application ^^

Talking about EvtEditor, I'm using it to try to find why the new events are not loading. Do you know the minimal commands required to have the field/camera and models load and wait for the user input (like writing a message or something) before exiting? Because all my attempts lead to the event loading and unloading in approx 0.5s, not really practicall to see if things are loading properly :D

On the topic of events:
My current guess is that even if I added Kasumi character in the game (imported her "model/character" folder with mod compendium) there are still files that i forgot to import, because, as soon as I try to set her inside an event it doesn't load.
Also if I replace another character by her (instead of just adding her folder), and load an event with the said character the event loads and I see Kasumi (of course with weird bones as it will use the other character's event animation).
Do you know if Atlus use tables to tell the events where to find the model/animations/etc... that I might need to update?

Edit: I just noticed that P5R events seems to use AnimationMajorId set to '1' on "character" definition while P5 ones uses '4'. It might be related but I don't know what these IDs are for :/

Cheers
First of all, thank you for updating the EvtTool with P5R stuff! I know it's not release-ready, but I've been hankering for something that lets me tinker around with viewing P5R events.

Second, in EVT files (at least in P5 vanilla, I don't see why this would change in P5R), the AnimationMajorId typically denotes the "general" animation pack that the Character uses for "general" animations like walking, talking, sitting, etc. For example, a typical Character code chunk looks like this when opened with the JSON tool:
"Type": "Character", ← Type, pretty self-explanatory
"Field08": 1,
"Field0C": 0,
"ResourceMajorId": 6, ← Model major ID; in this case, 0006 is Makoto
"ResourceSubId": 0, ← Model sub ID
"ResourceMinorId": 63, ← Model minor ID; in this case, 0006_063 is Makoto in her swimsuit.
Some EVTs have this as 0, which is a placeholder value that tells the EVT to auto-calculate and load the appropriate model/character in the appropriate outfit for the event, based on the current day/schedule.
"Field1C": 0,
"AnimationMajorId": 1, ← Animation major ID, typically a general usage animation pack. I believe this usually indicates pulling from be[model major ID]_[animation major ID].GAP. In this case, Makoto would be using animations from be0006_001.GAP.
"AnimationMinorId": 747, ← Animation minor ID, typically used for event-specific animations. For Makoto’s Hawaii beach date (e747_000.PAK), the gift-giving animation is event-specific and thus pulls from 0006/event/ae_0006_747.GAP)
(I haven’t figured out yet how to specifically call animations from the model’s “minor” animation pack in a MAB_ command; I’ve just been replacing animations in GFD Studio as needed.)
"AnimationSubId": -1,
"Field28": 0,
"Field2C": 0
It's possible that you're running into problems with the AnimationMajorId because you forgot to copy over the be[model major ID]_001.GAP from P5R to be[model major ID]_004.GAP in the character's event animations folder in P5.

I do have an EVT editing mini-guide that might be useful: https://docs.google.com/document/d/1pcf ... sp=sharing

It's not done yet, and I doubt it will be anytime soon because EVTs still need a lot of research, but I hope it can come in handy.
User avatar
Elvagan
Posts: 17
Joined: Sat May 09, 2020 6:03 pm
Has liked: 5 posts
Been liked: 7 posts

Oh nice thanks! I'm really glad to see that someone is gathering informations on the subject, this will help me for sure :)
Now i'll be less stressed about this AnimationMajorID, this is not what is missing in my imports.

For now i'm trying to get a minimal event to experiment things (just load a map, some models and avoid the event from ending immediatly) but it seems way more complicated than i thought :D
For example I removed half on the e702_101 duration in EvtEditor (set the time at 60 and removed all the tabs that were after that). I thought i would have only first half of the event. Oh sweet summer child... The lights were missing some effects and the event started directly from MSG_05 (?!) up to the Rank up animation and quit. I was like wtf :D

Do you know how the "Time"/"Duration" values are important? I thought it was the timeline of the event but it doesn't seem to be that as by removing the last commands it cut some early dialogues :/
When i extract an event to JSON it says for example Duration:1753, if i load the same evt in EvtEditor there are 132 frames and if i save it with EvtEditor and extract it again as a JSON it says Duration:132. So i guess the duration value is not really important?

I guess I'm far from understanding events, but hey that's what is fun (at least for now ^^).
Post Reply
cron

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.