FlyFF File Formats

Results 1 to 14 of 14
  1. #1
    Alpha Member GlaphanKing is offline
    MemberRank
    Sep 2008 Join Date
    World of MorrowLocation
    2,594Posts

    FlyFF File Formats

    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 here.

    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/regio...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...7/#post5538116

    WDF - Packed file from Cflyff: http://forum.ragezone.com/f457/wdf-<...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 Reimniess; 02-07-10 at 10:25 PM.


  2. #2
    Account Upgraded | Title Enabled! divinepunition is offline
    MemberRank
    Dec 2008 Join Date
    FranceLocation
    621Posts

    Re: FlyFF File Formats

    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 by divinepunition; 28-02-10 at 08:21 PM.

  3. #3
    Valued Member Duotone is offline
    MemberRank
    Jun 2009 Join Date
    107Posts

    Re: FlyFF File Formats

    Quote Originally Posted by divinepunition View Post
    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 by Duotone; 04-03-10 at 08:50 PM.

  4. #4
    Account Upgraded | Title Enabled! divinepunition is offline
    MemberRank
    Dec 2008 Join Date
    FranceLocation
    621Posts

    Re: FlyFF File Formats

    yes same than o3d i don't know how they link texture to o3d, i haven't any texture name in the structure

  5. #5
    Account Upgraded | Title Enabled! divinepunition is offline
    MemberRank
    Dec 2008 Join Date
    FranceLocation
    621Posts

    Re: FlyFF File Formats

    add wdf file format (cFlyff) from duotone : http://forum.ragezone.com/f457/wdf-file-format-583147/

  6. #6
    Ace of Hearts Reimniess is offline
    MemberRank
    Jul 2009 Join Date
    in your headLocation
    784Posts

    Re: FlyFF File Formats

    there was a lot missing so I added everything I knew was released so far as well

  7. #7
    Alpha Member Organic is offline
    MemberRank
    May 2007 Join Date
    2,077Posts

    sad Re: FlyFF File Formats

    Quote Originally Posted by Reimniess View Post
    there was a lot missing so I added everything I knew was released so far as well
    Might want to fix up the really crummy spelling.

  8. #8
    0xC0FFEE spikensbror is offline
    MemberRank
    Dec 2006 Join Date
    SwedenLocation
    1,855Posts

    Re: FlyFF File Formats

    Might want to stop being such a grammar nazi.
    Good work putting this as a sticky, Rena.
    It's really useful.

  9. #9
    Ace of Hearts Reimniess is offline
    MemberRank
    Jul 2009 Join Date
    in your headLocation
    784Posts

    Re: FlyFF File Formats

    Quote Originally Posted by spikensbror View Post
    Might want to stop being such a grammar nazi.
    Good work putting this as a sticky, Rena.
    It's really useful.
    thanks and it's ok he had a good point until a re edited it, it has several pesky spelling mistakes

  10. #10
    Enthusiast haddel is offline
    MemberRank
    Feb 2008 Join Date
    38Posts

    Re: FlyFF File Formats

    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 by haddel; 06-07-10 at 09:08 PM.

  11. #11
    0xC0FFEE spikensbror is offline
    MemberRank
    Dec 2006 Join Date
    SwedenLocation
    1,855Posts

    Re: FlyFF File Formats

    Quote Originally Posted by haddel View Post
    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 by spikensbror; 07-07-10 at 08:04 AM.

  12. #12
    Enthusiast haddel is offline
    MemberRank
    Feb 2008 Join Date
    38Posts

    Re: FlyFF File Formats

    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 by haddel; 07-07-10 at 04:54 PM.

  13. #13
    Account Upgraded | Title Enabled! divinepunition is offline
    MemberRank
    Dec 2008 Join Date
    FranceLocation
    621Posts

    Re: FlyFF File Formats

    Quote Originally Posted by haddel View Post
    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 by divinepunition; 07-07-10 at 05:28 PM.

  14. #14
    Enthusiast haddel is offline
    MemberRank
    Feb 2008 Join Date
    38Posts

    Re: FlyFF File Formats

    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 .



Advertisement