010 Editor templates documentation?

Need help finding something? Is a program not working? Game crashing? Give us all the details you have and we'll try to sort it out!
Please be patient when waiting for a response, this is a small community staffed by a handful of busy volunteers. It may take up to a day or two.
User avatar
Iredc
Posts: 9
Joined: Wed Jun 02, 2021 5:00 am
Been liked: 3 posts

010 Editor templates documentation?

Post by Iredc »

I've been messing around with TGE's binary template to edit events in P4 (the "atlus_pm.bt" here: https://github.com/TGEnigma/010-Editor- ... /templates), with rather... "interesting" results. Here's the initial scene, as example:

Image

Obviously, I'm changing things around blindly, so I wondered if there was some sort of documentation, or reference list for animations, to help me understand what the fields and values in the template mean.

I think this tool would be extremely useful for modding if it was better understood.
User avatar
ShrineFox
Site Admin
Posts: 243
Joined: Mon Oct 07, 2019 3:19 am
Has liked: 269 posts
Been liked: 103 posts

Re: 010 Editor templates documentation?

Post by ShrineFox »

010 templates tend to already have everything that’s known about a format so far, even if it’s only the structure. By changing things with trial and error, you’re already taking the next step of researching the format by potentially identifying what each field is for. If you do end up with concrete findings, renaming fields in the template source code and contributing to the Github pushes the scene forward.
But as far as info goes that may not already be in the template, there’s this list of models which probably get referenced by ID in the event files. If you open each model in Noesis you can also preview the order of animations, which is probably referenced by index. Here’s also a list of areas that are probably called by ID as well.

On the more technical side, there’s a prototype of P3 with a working event editor and someone made a method of exporting edited event files from memory. Since it’s the same format, it should also tell us about how certain info is stored by viewing it with the template.

One last thing that might be useful is this PM1MessagescriptEditor that extracts/repacks text from events, which may help you identify the index of the messages displayed in the event.

Oh and here’s some findings from Sierra in case any of them aren’t already represented in the templates
User avatar
Iredc
Posts: 9
Joined: Wed Jun 02, 2021 5:00 am
Been liked: 3 posts

Re: 010 Editor templates documentation?

Post by Iredc »

Thank you very much! That was really useful.
It's more or less as Sierra explains in those posts. I also noticed a different type of block not registered in the template: blocks that begin with 21 00 seem to control the camera.
The areas are referenced by ID, but not the NPC models. Sierra says that model reference is in .FBN files, but I don't find those. Opening the field .arc in Amicitia doesn't show any .fbn. Do you know where they are?

Sierra also says that he doesn't know what dictates the order of animations/movements. I suspect it may be what he describes as "Time" in each of the blocks? I haven't tested it yet, but the value increases for each character frame, until the start of next character's block, when it goes back to 01 00.

As for the .pm3 files, I don't know what they're used for. Replacing it with a totally different .pm3 seems to change nothing.

I also took a look a while ago at that P3FES event editor save. But the emulator kept crashing each time I tried to save. Don't know what I was doing wrong...

Anyway, I'll keep looking at this, in case I find something useful.
Thanks.
User avatar
Iredc
Posts: 9
Joined: Wed Jun 02, 2021 5:00 am
Been liked: 3 posts

Re: 010 Editor templates documentation?

Post by Iredc »

More findings.
I've been looking what each block of the .pm2 files does. The most interesting ones are in the section called PMD_DATATYPE_FRAME in the template. The blocks that begin with 01 (called PMD_OBJTYPE_UNIT) control characters' movements and the like. There are several types.
I'm going to use event 104_001.pm2 (Yu arriving at the station at the beginning) as example.

Image

This one is to move characters around the map.

-The first 01 indicates that it's an OBTYPE_UNIT block.
-3C 00 (60) is the frame time. This serves to set the order of actions. For example, a block with time 54 would come before, and one with time 61 would come immediately after.
-01 0C is the character code. Looking this hex number in the corresponding area's .fbn, shows that it belongs to model 12 (Yu with the travelling bag). So this Yu will perform whatever action scripted by this block.
-The next 01 sets the type of action performed by the block (01 is for movement).
-04: This sets the speed of walking.
-The rest of the numbers seem to be coordinates of some sort, to set the path the character will follow. Unfortunately, I couldn't make sense of them, and I didn't get reliable results when changing these numbers around.

Image

This is for animations.

-02: type of action (02 for animations)
-01: the animation performed. Upon looking the model in Noesis, the animations play in order. The first one is the character standing (00) and the next one is walking (01), which is the animation performed here. If it was changed to 02, for example, Yu would move around while shaking hands, instead of walking.

Image

This is for rotation.

-04: type of action (04 for rotation)
-2E 4E (46 67): amount and direction of rotation? I haven't investigated this much, really.

Image

This is for the special effects that sometimes appear over the character's head.

-05: type of action (05 for effects)
-02: effect ID (02 is the interrogation sign)

The following is a (non-exhaustive) list of the effects' IDs (in decimal):

-0: exclamation
-1: double exclamation
-2: interrogation
-3: exclamation + interrogation
-4: red angry sign (like the one Nanako shows when hitting Dojima at the station scene)
-5: flowers
-6: musical note
-7: a star (angry? surprise?)
-8: grey cloud showing annoyance
-9: blushing
-10: speaking signs
-11: rays
-12: pink heart
-13: Zzzzzz (sleeping)
-14: cellphone beep
-15: sweatdrop
-16: sweatdrops (surprise)
-17: star
-18 and 19: musical notes when you increase affinity

Image

Similar to rotation, but only rotates the head.

-06: type of action (06 for head rotation)
-16 43 (22 67): amount and direction of rotation. Changing 67 to 66 made Yu rotate the head in the opposite direction.

Image

This is a different type of block. It begins with 04 (PMD_OBJTYPE_MESSAGE in the template). These come after the UNIT blocks, and basically set the order in which the messages from the .pm1 file show. Again, this order is dictated by the frame time at the beginning.

-05: Message number, as seen in the .pm1 file. I've noticed that for MC's selections, there's a 10 (in hex) right after the message number.
-The 01 before message number indicates that this message is conditioned. That is, it will only show if MC makes a specific choice. The 02 before this, means the message is related to the third choice (00 for first choice, 01 for second, and so on.) Conditioned actions like movements or animations show the same pattern. The numbers in these case would come before the type of action, instead of message number.

By knowing all these things, it's possible to edit events considerably. I still have to figure out how to control movement (I'm not good with numbers, so those coordinates baffle me, really). It's also possible to extend conversations and scenes by copy-pasting blocks in a hex editor and adjusting the frame times. In this case, it's enough to extend the LastFrame and TotalFrame as neccesary at the beginning of the template, as well as adjusting the ItemCount to reflect the new frames.
Post Reply