Mabinogi File Formats Documentation

05/19/2012 02:05 adam_j#1
I wasn't sure whether I should bother to post this here, because well, nothing of value ever really takes place here.

But what the hell, maybe you guys will surprise me.




So, I've been staring at Mabi's files in hex for a week now, and examining source/output of various converters, and this is what I have so far, on PMG files: (There's more, but I've literally only just finished typing the PMG section so far, which is by -FAR- the section I know most about)

I'll start with some basic grouping conventions that are applied in many of the formats, before going into specific detail on any of the formats:

All files formats start with some sort of definition in the first 3 bytes, take a look, you'll see what I mean. [Only registered and activated users can see links. Click Here To Register...]

Names take up at least 32 bytes usually. Some can take upto 128 bytes, and the client will probably expect it to be that way, but you can usually see quite easily what sizing format it's using (The relevant value is usually followed by a sea of zero bytes). This seems to be part of Devcat's cunning plan to be as inefficient as possible.

If you see 00 00 80 3F, you're in the Matrix. Well, A matrix. I fully recommend that you stop consuming whatever pills you're taking immediately.
Seriously though, these are usually Frame Transform Matrixes, you'll often find three 00 00 80 3F values in a matrix, punctuated by a number of 00 00 00 00 groups. These come in several flavours, 4 bytes x 16 groups being the most common, and most often a Frame Transform Matrix.
Basically, these tell the renderer how to size the object. The 80 3F is a floating point value of 1.0, so it means that it's treated as a 1:1 ratio.
Try altering these values for amusing results.

That's really all the non-specific things I can think of, and as I'll explain the files in detail (to the extent that I CAN), it's simply there for reference.
Don't fret if you just read that, and you're looking at your screen like "......O__o..?", It'll make sense in a bit.

So, to begin with, the file type I know most about:
PMG:

Before you start, download this: [Only registered and activated users can see links. Click Here To Register...]

The simpler version:

PMG related files:
[Only registered and activated users can see links. Click Here To Register...]


The point of this, is quite simple: Custom content.

Several private servers are in development, and with documented file formats, new monsters, pets, clothes, even new races, with their own frames, and working joints, could easily be created.

Also, feel free to PM me if you want to get involved in the project, or just post any contributions you might have.
05/21/2012 13:42 adam_j#2
Since I was updating a thread elsewhere, I may as well add this here too:


Frm files:

[Only registered and activated users can see links. Click Here To Register...]

The first 3 bytes tell you that the file is a Pleione framework, and that apparently is exciting, due to the the exclamation mark xD;

Bytes 5 and 6 tell you that the frame is version 1.0, and byte 7 tells you that there are 26 bones in this frame.


The blueish/purple line outlines the location data for the "com" bone (this bone is the root, basically), with all values being float points. I'm not really sure what the values do, as of yet, as I have yet to experiment with them all. This section is 192 bytes, so, possibly 3 transform matrixes?

The green line outlines the bone's name, which is 32 bytes in size.

The red line shows the bone's assigned number, and what it's connected to. Com is bone 00, and is connected to FF. The following 2 bytes are simply empty.

The light blue line outlines 32 bytes of data that the client doesn't care about. At all. I deleted all 26 sections, the client doesn't appear to even notice.

That's the format for the bone information, which is simply repeated 25 more times, with different information in the sections ^^


Now, the part I don't understand about this file is the remaining 50%:
[Only registered and activated users can see links. Click Here To Register...]

Red outline: number of bytes in this section. (9348, not including itself. Always tells you the number of bytes.)

Green outline: Number of bones in the frame (Always.)

Light blue: 2x the number of bones in the frame (Always.)

Orange: 18? 4608? A floating point? I have no idea (Not always 18. Also not sure if the yellow section following is a part of it.)

Purple: Again, not sure what this is, or what it does, or even if the yellow outlined parts that follow are a part of it. (I assume that they are, though.)

Pink: The number of visible equipment slots. A character has 9 visible pieces of equipment, altering that to 08 made all equipment in my hands invisible (Which was pretty amusing.)

Grey: The client just doesn't seem to care about these bytes. I filled them in with random junk data, client didn't even notice. The other values are essential though.

Everything else: Data involving the display of the body parts. I've tried filling bytes in with zeros, it takes a LOT of zeros to make a difference, and as such, I've not worked out any sectioning to this data.

Perhaps someone here would be able to shed some light on what this data could mean?
Also, do the pictures help, or not?
05/21/2012 20:42 Somebody Fake#3
Stop copy pasting the thread from MM. Why not just link to it?
05/21/2012 23:02 adam_j#4
Quote:
Originally Posted by Somebody Fake View Post
Stop copy pasting the thread from MM. Why not just link to it?
Because not everyone HAS an MM account, and I'm not updating it for either site specifically anyway.

But you are indeed correct, posting it on either site serves zero development purpose, I'm simply doing so out of interest.
05/26/2012 18:52 harrybong1#5
Pictures help, i like the multi colored lines. What are you hoping to achieve with this adam?
05/26/2012 19:05 adam_j#6
[quote=adam_j;16755047
The point of this, is quite simple: Custom content.

Several private servers are in development, and with documented file formats, new monsters, pets, clothes, even new races, with their own frames, and working joints, could easily be created.
[/QUOTE]

Quote:
Originally Posted by harrybong1 View Post
Pictures help, i like the multi colored lines. What are you hoping to achieve with this adam?
The coloured lines were totally not just an excuse to play around in paint, instead of look at hex.

<.<

>.>