NFSAddons Forums

Main Menu

FeData file format?

Started by TheXDS, Mar 07, 2024, 9:40 PM

TheXDS

Hi everyone! Sorry for my broken english.
I'm currently working on a new, modern re-implementation of modding tools for NFS3/4.
Right now, I was trying to parse the FeData files inside VIVs. There's a bunch of bytes on the header, right before the string offset table that I don't have any idea what they do, and hunting down information on the internal structure of those files has been futile.

Does anyone have a full description of the FeData file format? So far, I'm able to parse all the well known fields (car id, serial, bonus, is cop, car class and compare table) but there are at least 27 bytes on the header that I'm struggling to identify.

So far, this is more or less what I've got: (in C#)

[StructLayout(LayoutKind.Sequential)]
private struct FeDataHeader
{
    public static FeDataHeader Empty = new()
    {
        FlagCount = 0x0009,
        Unk_0x0c = 0x0003,
        Unk_0x16 = 0x0080,
        Unk_0x2c = 0x05,
        StringEntriesCount = 0x0028
    };
    public ushort FlagCount; // Unless internally treated as max array index? that'll make sense with all the zeroes after S/N
    public ushort IsBonus;
    public ushort AvailableToAi;
    public ushort CarClass;
    public ushort Unk_0x0c;// = 0x0003
    public ushort Unk_0x0e;// = 0x0000
    public ushort IsPolice;
    public ushort Seat;
    public ushort Unk_0x14; // = 0x0000
    public ushort Unk_0x16; // = 0x????
    public ushort SerialNumber;
    public ushort Unk_0x1a; // = 0x0000;
    public ushort Unk_0x1c; // = 0x0000;
    public ushort Unk_0x1e; // = 0x0000;
    public ushort Unk_0x20; // = 0x0000;
    public ushort Unk_0x22; // = 0x0000;
    public ushort Unk_0x24; // = 0x0000;
    public ushort Unk_0x26; // = 0x0000;
    public byte Accel;
    public byte TopSpeed;
    public byte Handling;
    public byte Braking;
    public byte Unk_0x2c; // = 0x05;
    public ushort StringEntriesCount;
    // string offset table (40 entries)
    // string data pool
}


Edit: as of right now, this is just for NFS3 FeData files. NFS4 FeData files have a lot more data (mostly zeros) and have a completely different header structure

pete9516

Quote from: TheXDS on Mar 07, 2024,  9:40 PM
Hi everyone! Sorry for my broken english.
I'm currently working on a new, modern re-implementation of modding tools for NFS3/4.
Right now, I was trying to parse the FeData files inside VIVs. There's a bunch of bytes on the header, right before the string offset table that I don't have any idea what they do, and hunting down information on the internal structure of those files has been futile.

Does anyone have a full description of the FeData file format? So far, I'm able to parse all the well known fields (car id, serial, bonus, is cop, car class and compare table) but there are at least 27 bytes on the header that I'm struggling to identify.

So far, this is more or less what I've got: (in C#)

[StructLayout(LayoutKind.Sequential)]
private struct FeDataHeader
{
    public static FeDataHeader Empty = new()
    {
        FlagCount = 0x0009,
        Unk_0x0c = 0x0003,
        Unk_0x16 = 0x0080,
        Unk_0x2c = 0x05,
        StringEntriesCount = 0x0028
    };
    public ushort FlagCount; // Unless internally treated as max array index? that'll make sense with all the zeroes after S/N
    public ushort IsBonus;
    public ushort AvailableToAi;
    public ushort CarClass;
    public ushort Unk_0x0c;// = 0x0003
    public ushort Unk_0x0e;// = 0x0000
    public ushort IsPolice;
    public ushort Seat;
    public ushort Unk_0x14; // = 0x0000
    public ushort Unk_0x16; // = 0x????
    public ushort SerialNumber;
    public ushort Unk_0x1a; // = 0x0000;
    public ushort Unk_0x1c; // = 0x0000;
    public ushort Unk_0x1e; // = 0x0000;
    public ushort Unk_0x20; // = 0x0000;
    public ushort Unk_0x22; // = 0x0000;
    public ushort Unk_0x24; // = 0x0000;
    public ushort Unk_0x26; // = 0x0000;
    public byte Accel;
    public byte TopSpeed;
    public byte Handling;
    public byte Braking;
    public byte Unk_0x2c; // = 0x05;
    public ushort StringEntriesCount;
    // string offset table (40 entries)
    // string data pool
}


Edit: as of right now, this is just for NFS3 FeData files. NFS4 FeData files have a lot more data (mostly zeros) and have a completely different header structure
Hey there, nice to see a fresh project like this, but all i can say about the NFS4 file format is that there are some additional flags for where the engine is placed ("for burning car" particles) and there's 1 other known flag, i think AJ_Lethal found them but i can't recall what it is. I think there's a topic about it here


TheXDS

Quote from: pete9516 on Mar 08, 2024,  1:59 AM
Here's something that might be interesting for you:
https://www.nfsaddons.com/downloads/nfshs/tools/7401/nfshs-hidden-fedata-flag-editor-cheat-table.html

Actually yes, but for NFSHS... both games have completely different fedata headers. I've tried cross-comparing fedata files before and after editing them in nfswizard, but I just could not get any more info than that. I believe that NFS3 also includes the engine position flag (probably on 0x16 or 0x0e) but I do this on my spare time, and sadly, I don't really have much time to play nfs to test these flags out  :(

Still, good call! I'll need it for NFS4 fedata files. Thanks!

bfut

Nicely done. I implemented an NFS3 FeData generator in Python a few years ago. It immediately generates the entire set of versions and can be run wherever Python is installed.
https://www.nfsaddons.com/downloads/nfshp/tools/7885/bfut-fedata3gen.html

Implementing a full blown program in C# for such a minor file format seems like a lot of work. Looking forward!