FlyFF File Formats

Joined
Sep 9, 2008
Messages
1,947
Reaction score
391
This is a sticky for the development and discovery of the various file formats for FlyFF. I will basically cover what each file type is, what its for, and where you can find the format.

LND - Landscape File: - http://forum.ragezone.com/f457/lnd-file-format-557578/
This file holds all of the data for the landscapes in the game. For example it stores hightmaps, which tile to paint where and collision restrictions. It also has the coordinates for each object like houses, pipes, etc. It also holds where the SFX are at. You can find the format in basic layout at Xadet's web site .

O3D - Object Model File: http://forum.ragezone.com/f484/o3d-format-636686/
This is the file that holds all the verticy, lines, points, etc just like a 3dmax file but in a different format. This is what the client loads for all the objects in the game. This does NOT include bones, and animations. Those are separate altogether. The format is being worked on in the development section by Divine, Duotone and others.

DYO - world npc and ctrl spawns http://forum.ragezone.com/f457/dyo-file-format-578809/

RGN - area region and spawns region http://forum.ragezone.com/f457/region-file-format-579209/

RES - Packed file tge client reads from http://forum.ragezone.com/f457/res-file-format-568781/

SFX - special effects: http://forum.ragezone.com/f484/sfx-file-format-623163/

ANI - Model Animation files: http://forum.ragezone.com/f484/flyff-file-formats-646847/#post5538116

WDF - Packed file from Cflyff: http://forum.ragezone.com/f457/wdf- file-format-583147/

Edit by Reimniess July 2nd 2010:
noticed the thread was way out of date so I added all thee file formats to my knoledge that have been released
 
Last edited by a moderator:
thanks

so actually we know : dyo,o3d,lng,res,sfx and rgn. .ani also in duotone o3d thread if i remember.

For information chineese o3d have a different header but the main structure is similar...

So i will add thoses link :

SFX file structure : http://forum.ragezone.com/f484/sfx-file-format-623163/

O3d file structure (by duotone, pipelli and fatduck: http://forum.ragezone.com/f484/o3d-format-636686/

ANI File structure (by duotone) :

Code:
struct tAnimationState
{
    float rotateX;
    float rotateY;
    float rotateZ;
    float degrees;
    float rotatePositionX;     //center point of rotation
    float rotatePositionY;
    float rotatePositionZ;
};

//-------------------------------------------------------------------------------------------
// Beginning of file
//-------------------------------------------------------------------------------------------

int unk2;
int unk1;
float unk3;         //allways 0.5

int unk4[ 8 ];
int nBones;

int nAnimationStates;
int unk11; 

struct tbonedata2
{
    int namelen;
    char bonename[ namelen ];           //bone name. usually "Bone1", "Bone2", etc
    float trans1[ 16 ];
    float trans2[ 16 ];
    int some_index;                     //starts with -1, less than nBones
}bonedata2[ nBones ];

int nUnk3;

for(int j = 0; j < nUnk3; )
{
    int unk5;   			//0 or 1 allways
    if( unk5 != 0 )
    {
        tAnimationState globalAnimStates[ nAnimationStates ];
        j += nAnimationStates;  //increase counter here only
    }else
    {
        //this branch (unk5 == 0) does NOT increase the counter
        struct tbonedata16
        {
            float trans[ 16 ];
        }bonedata16;
    }
}

int unk6;       //0 or 1 allways (well, not for ani. its sometimes 2)
if(unk6 == 0)
{
    struct tbonedata17
    {
        float trans[ 16 ];
        int unk7;
    }bonedata17;
}

//rest is unknown, mostly 0's

with xadet lnd,dyo and res file structure we know now a good part of the code structure, it 's not finished actually and we should try to see into .chr file but those informations could be very usefull.

And if some people try to look into chinese o3d file they see that they have structure like eflyff o3d (but they don't have eflyff o3d header and texture name are not given in their code.

But they seem to use a "color" for each vertices....
 
Last edited:
For information chineese o3d have a different header but the main structure is similar...

For information chineese lnd is similar as well.
Its divided into two files tho. First file is the lnd's first half (heightmap AND texture layers), second file is lnd's second half, objects only. This differs from lnd's object field but isn't really hard to guess the struct.

My problem is that they seem to use a different ID method. And im clueless how to pair object ID's to their files.
 
Last edited:
ive got an question to some c# experienced
how could i interpret
Code:
int unk4[ 8 ];
( from Ani Fileformat ) in C#'s BinaryReader ?
Is it an 8Bit Int ? :S

-------------------------

Solved : while i was trying i came to this result .
Any other way to read an 32Byte Int ?
Code:
int unk4 = BitConverter.ToInt32(sfxfile.ReadBytes(32),0);
 
Last edited:
Solved : while i was trying i came to this result .
Any other way to read an 32Byte Int ?
Code:
int unk4 = BitConverter.ToInt32(sfxfile.ReadBytes(32),0);
There's no such thing as a 32byte int.
[8] could be either a Int64, or 8 4-byte integers or something else.
I'll look into it in a sec.

Edit:
Pretty sure it's 8 4-byte integers.
8x4=32 = The reason you could read 32 bytes.
 
Last edited:
im not sure but arent 17 bones just for prophet wings (the big one with 6 wing parts) a bit too much ?
Code:
struct tbonedata2
{
    int namelen;
    char bonename[ namelen ];           //bone name. usually "Bone1", "Bone2", etc
    float trans1[ 16 ];
    float trans2[ 16 ];
    int some_index;                     //starts with -1, less than nBones
}bonedata2[ nBones ];
after the second step of
Code:
int nBones = sfxfile.ReadInt32();
for (int i = 0; i <= nBones; )
            {
                try
                {
                    Bone b = new Bone();
                    b.namelen = sfxfile.ReadInt32();
                    b.bonename = BitConverter.ToString(sfxfile.ReadBytes(b.namelen), 0);
                    b.trans1 = BitConverter.ToSingle(sfxfile.ReadBytes(8), 0);
                    b.trans2 = BitConverter.ToSingle(sfxfile.ReadBytes(8), 0);
                    b.some_index = sfxfile.ReadInt32();
                    bones.Add(b);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
i get an out of memory exception .
 
Last edited:
ive got an question to some c# experienced
how could i interpret
Code:
int unk4[ 8 ];
( from Ani Fileformat ) in C#'s BinaryReader ?
Is it an 8Bit Int ? :S

-------------------------

Solved : while i was trying i came to this result .
Any other way to read an 32Byte Int ?
Code:
int unk4 = BitConverter.ToInt32(sfxfile.ReadBytes(32),0);

this mean that you're creating a table with 8 int value...

in c# it's int[] unk4 = new int[8];

and while there are 4 bytes in an int value, of course it's = to 32 bits

And in tbonedata float [16] mean you have a matrix 4*4 which give 16 float value, another table to manage those value... You don't have to use any bitconverter just use 16 time ReadSingle() function of your binaryreader object...
 
Last edited:
what is nAnimationStates it isnt defined anywhere in the format :S
should it be the count of available AnimationStates ?
is it normal that nUnk3 is sometimes a negative high number ?
Could add me maybe on msn and help me a bit out ?

Greetz haddel .
 
Back