Author Topic: FF8 Field Models  (Read 19437 times)

JWP

  • *
  • Posts: 194
    • View Profile
FF8 Field Models
« on: 2007-08-22 18:16:20 »
I've been having a few issues extracing the data from the field models. I can find the locations of each section of data, I just think that my interpretation of the data is slightly off.
I've been trying to extract the geometry from the d002.mch file, here are the structures I'm using:

struct vertex {
   short x;
   short y;
   short z;
   short unk;
};

struct TextureMap {
   BYTE u;
   BYTE v;
};

struct face {
   u32 opcode; 0x07060125 = triangle, 0907012d = Quad
   BYTE unk[8];
   u16 verticies[4]; //vertex id's
   u16 verticies1[4]; //Edge data???
   u32 Vertex_Colours[4];
    TextureMap TextureData[4]; //haven't tested yet
    u32 Padding[3];
   //64 bytes
};

my understanding of the skeleton is such that I've managed to work out how all the bones fit together and the various lengths and I know that all the vertex offsets are relative to the bones that they are linked with. I can tell that most of what I've extracted seems to be alright since I have a (mostly) intact head of squall and body.

EDIT 1: I've fixed the missing polys issue, it was to do with importing the quads wrong and due to this I've also managed to fix the normals issue just by flipping all the
normals.

The issues that I'm having:
      FIXED: I've had trouble with the normals, so I've just duplicated all the polygons with the opposite normals for now.
      FIXED: There appear to be some polygons missing, like a few triangles of the head and body. (I'll upload a screenshot when I find somewhere to upload it)
      The arms and legs appear disjointed and there's a large gap between the body and the arms (I'm guessing this is mostly due to the arrangement of the skeleton  and the orientation of the various limbs). I've managed to reduce the deformation somewhat but it's still slightly messed up.

EDIT: I managed to get the textures working now, although I had to manually scale and flip the coords.

Does anyone with a better understanding of the format have a clue what's going wrong?
« Last Edit: 2007-08-23 13:11:42 by JWP »

Hades

  • *
  • Posts: 43
    • View Profile
Re: FF8 Field Models
« Reply #1 on: 2007-08-23 15:42:17 »
Post some screens up for us?

JWP

  • *
  • Posts: 194
    • View Profile
Re: FF8 Field Models
« Reply #2 on: 2007-08-23 17:10:00 »
sure:




the renders were made in 3ds max, as you can see there are a few obscurities like the hands being upside-down and squall being anorexic but it's workable. I have a hunch that the arms are messed up because the hands are supposed to be up in the air in the base pose, as for the body, I don't have a clue atm. It would be helpful if someone that has worked with the format before could post some more info though.
« Last Edit: 2007-08-23 18:03:59 by JWP »

ultima espio

  • *
  • Posts: 1357
    • View Profile
Re: FF8 Field Models
« Reply #3 on: 2007-08-23 20:38:24 »
Qhimm and Mirex would be the dudes to talk to about ff8 models.


JWP

  • *
  • Posts: 194
    • View Profile
Re: FF8 Field Models
« Reply #5 on: 2007-08-24 14:07:43 »
yer, I've read most of them already, thx for the help though anyway.
I'm also looking at the battle models (.dats), what do you know about the format of those mirex?
I've managed to decypher roughly what each of the sections are but I haven't yet managed to decypher the geometry, it looks like it's split into 3 sections each with different size structures, one looks like it might be 6 bytes, the second structure looks like 16 bytes and the third looks like 20 bytes. I'm not able to figure out how to know when one type of structure ends and the other begins since I haven't been able to find any counts, all I know is that there appears to be some 0x00's between the first type of structure and the second, I'll probably have a better look in a couple of days.
what I think the file structure is atm (correct me if I'm wrong):

1: Bones
2: Geometry
3: Animation?
4: Unknown (was empty on the models I looked at)
5: no idea
6: Bone-vertex links?
7: Monster Info
8: Looks like a script for the monster moves etc. (I saw some text in there that appears in battle)
9: Sound/music data? (contains "AKAO")
10: Sound/music data? (contains "AKAO")
11: Texture

in the geometry section, I'm guessing the 1st section is verticies and the 2nd and 3rd are to do with triangles/quads. The problem I'm having is that only 2 of the items in the 2nd stucture appear to be vertex references (shorts) and 3 in the 3rd structure, which leaves me puzzled as to how it's structured. I'm also clueless as to what the "AA00" or "AB00" short means, so in less I find some more clues, I'm pretty unlikely to decrypt the data anytime soon. It's kinda a waste to spend time on something that's already been decrypted by other people though =\.
I'm trying to decypher as much data as I can because I'm looking into possibly making a converter (depending on public opinion probably) and possibly helping put FF8 support into Q-Gears, since FF8 has long been one of my favourite FF games (and the first one I ever owned).

EDIT: I've managed to obtain a copy of the FF8 battle model viewer, although this may help somewhat (face counts, vertex counts, animation data and skeleton structure), it's still not quite as good as a file desciption =\
« Last Edit: 2007-08-26 16:39:56 by JWP »

Lucleonhart

  • *
  • Posts: 40
    • View Profile
    • Lucleonhart.de
Re: FF8 Field Models
« Reply #6 on: 2007-09-12 20:45:17 »
HIGH interesting!
I have been busy with the model think a year ago for a currently total freezed project... But i wanna go on with it soon, so this is very very interesting.

I have come so far last year:
http://ff8shrine.m4luc0.de/models/squall.swf

JWP

  • *
  • Posts: 194
    • View Profile
Re: FF8 Field Models
« Reply #7 on: 2007-09-12 22:52:31 »
ok, nothing new so far on the field model front because I've not had much time lately, that and I've been looking a bit at the battle models recently.

I've managed to find the vertex count, and all the UV coords in the geometry section, now all I've got to do is sort out the remaining data (shouldn't be too hard since there isn't that much of it left now and I have a pretty good idea of what's what, though I haven't tried rendering anything yet)

The verticies appear to be sets of 3 shorts though I don't know exactly when the vertex data starts and ends due to there being some other values around it.
the other 2 sections of the geometry appear to be as follows:

struct unk16 { //triangles
   short verts[3];
   short UVcoord;
   short UVcoord1;
   short unk;
   short UVcoord2;
   short unk1; //AA00, AB00
}

struct unk20 { //quads
   short UVcoord;
   short UVcoord1;
   short verts[4];
   short UVcoord2;
   short unk;
   short UVcoord3;
   short unk1; //AA00, AB00
}

kinda weird way to store the data if you ask me =\. The first vertex in each set appears to be indexed at 0x8000.

the monster info section decyphered so far:

struct Item {
   BYTE id;
   BYTE amount;
};

struct Action {
   BYTE type; //??? 0x02 = generic magic
   BYTE animscript; //???
   BYTE id; //???
   BYTE unk;
};

struct MonsterInfo {
   char name[24]; //FF8 encoded - length might be less than this

   BYTE HP[4]; //HP = (HP[0]*x*x)/20 + (HP[0] + 100*HP[2])*x + 10*HP[1] + 1000*HP[3], where x = monster lvl
   BYTE unk0[24];

   Action RosterL[16];
   Action RosterM[16];
   Action RosterH[16];

   BYTE Unk1[4];

   BYTE Card[3]; //1st Byte = Card Drop, 2nd Byte = Carded into, 3rd Byte = Rarely Carded into, 0xFF = no drop/can't card
   BYTE Devour[3]; //Low, Med and High lvl Devour effect id's

   BYTE unk2[6];

   USHORT LowLvlDraw[4];
   USHORT MedLvlDraw[4];
   USHORT HighLvlDraw[4];

   Item LowLvlMug[2];
   Item LowLvlRMug[2];
   Item MedLvlMug[2];
   Item MedLvlRMug[2];
   Item HighLvlMug[2];
   Item HighLvlRMug[2];

   Item LowLvlDrop[2];
   Item LowLvlRDrop[2];
   Item MedLvlDrop[2];
   Item MedLvlRDrop[2];
   Item HighLvlDrop[2];
   Item HighLvlRDrop[2];

   BYTE unk3[20];

   BYTE ElemRes[8]; //These are how resistant the monster is to each element 0 = very weak
               //0 - Fire
               //1 - Ice
               //2 - Thunder
               //3 - Earth
               //4 - Poison
               //5 - Wind
               //6 - Water
               //7 - Holy
   BYTE StatusRes[20]; //Status resistances 0xFF = immune
               //0 - Death
               //1 - Poison
               //2 - Petrify
               //3 - Darkness
               //4 - Silence
               //5 - Beserk
               //6 - Zombie
               //7 - Sleep
               //8 - Haste
               //9 - Slow
               //10 - Stop
               //11 - Regen
               //12 - Reflect
               //13 - Doom (red timer) - command/doomtrain
               //14 - Slow Petrify? (white timer) - cast using doomtrain
               //15 - Float
               //16 - Confuse
               //17 - Drain
               //18 - ???
               //19 - ???
};


I'm getting there slowly :)

oh, I also made a quick proggy that splits the dat files up into the different sections into folders with the filename and the monster name in brackets. I might release it if anyone is interested but I wont bother otherwise because I can't be arsed :P.

I noticed 2 enemies called "Gunblade" c0m082.dat and c0m142.dat, there's dialogue in the latter that goes something like this:

Zell "...the hell is this!?"
Squall "What the...?"
Selphie "Ewww!  Nasty!"

EDIT: just realised it's the same text as when you face Gerogero

It'd be interesting to battle this thing but I don't have anything to replace files in .fi archives :( (I used unmass to extract them).

How did you get that model Lucleonhart?
« Last Edit: 2007-09-13 16:50:33 by JWP »

ultima espio

  • *
  • Posts: 1357
    • View Profile
Re: FF8 Field Models
« Reply #8 on: 2007-09-13 14:42:33 »
It would be a shame if you didn't release it :wink:

JWP

  • *
  • Posts: 194
    • View Profile
Re: FF8 Field Models
« Reply #9 on: 2007-09-13 15:54:08 »
http://bin.mypage.sk/FILES/dat%20reader.exe

don't blame me if it's buggy :P
USAGE:

it's a command line program, you specify the path to a directory with lots of .dat files in it in the argument and it must have a "\" at the end (otherwise it crashes :P)
eg. C:\battle\
and the path can't have any spaces or quotes around it.

symbols that can't be displayed in the folder name are replaced with a $ sign ie. the ? in UFO? and the "s in "Sorceress"

the program will create a data folder in the folder you specified and nicely organises all the file parts for you :).

to get all the .dat files in the first place, use mirex's unmass to extract them all, they're in the battle.fi file.
« Last Edit: 2007-09-13 15:55:58 by JWP »

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: FF8 Field Models
« Reply #10 on: 2007-09-14 02:17:23 »
Ahh it works only with the PC media information?

Well someone has some PS1 data I suppose I could revisit my first attempt at it.  That would mean I would need to fix my compiler to work properly! AHHHH
:D
I stopped because I couldn't get GLScene to Compile in BCB.
Sigh I may have to break down and get a newer version of BCB.

Cyb

JWP

  • *
  • Posts: 194
    • View Profile
Re: FF8 Field Models
« Reply #11 on: 2007-09-14 10:31:47 »
I could probably extract the psx data with a few changes, I know roughly where the data is because I can search for the name in the monster info section, the monster info section in the PSX ver has an extra 304 bytes but that's easy enough to compensate for. I'll see what I can do about extracting the PSX data :P.
I'll see what I can do :)

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: FF8 Field Models
« Reply #12 on: 2007-09-14 11:38:24 »
The PSX data should be very similar. I remember when I was reversing the PC format, the game used PSX GPU packets to describe the models. (They had the textured quad header). Take a look at my PSX doc under the GPU section to get an idea of the packet format. If I remember right, it wasn't a full packet. It was missing it coordinate information. Mostly likely that was filled in while in the rendering pipeline.

That should point you in the right direction.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: FF8 Field Models
« Reply #13 on: 2007-09-14 22:41:37 »
Hmmm I thought it had mixed quads and triangle information? I know that what I displayed was.. mostly garbage.

I suppose resurrecting my ancient experiments (save those wiped out) might lead to something more interesting than just conversation.

Cyb

JWP

  • *
  • Posts: 194
    • View Profile
Re: FF8 Field Models
« Reply #14 on: 2007-09-14 23:24:38 »
well I've extracted the majority of the PSX battle models (143 of them), I'll put a link to a copy of the extractor in this post when I get around to it.
every single section of the data is identical, even the order of the models is the same, only difference I could find is that the pc version has extra copies of the dummy model.
The extra 304 bytes was from when I was searching though a .iso file, so it was probably just sector information or something.

EDIT:
http://bin.mypage.sk/FILES/PSX%20Dat%20Reader.exe

output directory is specified in the command line, same drill as before with the formatting, I think the directory might have to exist aswell.
You will also need c:\ff8disc1.img - just copy it from FF8 disc 1.

same but for mch files (field models):
http://bin.mypage.sk/FILES/PSX%20Mch%20Reader.exe

only does 47 of them atm though
« Last Edit: 2007-09-15 16:16:34 by JWP »

G

  • *
  • Posts: 104
  • , kupo.
    • View Profile
Re: FF8 Field Models
« Reply #15 on: 2007-09-16 15:13:09 »
Can you share info about offsets of your extracted files (I am trying to regulate and extract PSX FF8 data and finish my extractor, see http://forums.qhimm.com/index.php?topic=6890.0)?

JWP

  • *
  • Posts: 194
    • View Profile
Re: FF8 Field Models
« Reply #16 on: 2007-09-17 00:00:26 »
sure, I'll give you the information when I get back home in a few days (I'm at Bristol atm looking for a job for when I go back to uni in October). Do you want me to mod the program to output offsets or just give you a list of the offsets in my FF8 version (PAL)?
Only thing is that the offsets might be region specific. I tried using your FF8 extractor and it extracted a few 64 byte files and then crashed, said "the runtime requested that this application be terminated in an unusual way" or something like that.
atm I'm only on my "craptop" as I like to call it and I don't really have access to anything except the internet lol.
Just let me know if I can help in any other way with finishing your extractor :).
« Last Edit: 2007-09-17 00:06:28 by JWP »

G

  • *
  • Posts: 104
  • , kupo.
    • View Profile
Re: FF8 Field Models
« Reply #17 on: 2007-09-17 10:43:11 »
Hm, I forgot, that PAL and NTSC versions can be different...
I'll try to get PAL FF7 version and look what we have there
I think game data isn't very different, if you want, you can modify my extractor for PAL region support

Lucleonhart

  • *
  • Posts: 40
    • View Profile
    • Lucleonhart.de
Re: FF8 Field Models
« Reply #18 on: 2009-01-14 20:59:33 »
~sry wrong topic~

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: FF8 Field Models
« Reply #19 on: 2019-02-17 15:10:20 »
sorry for digging up ten years old thread, but I was working with the MCH files on chara.one from world map. This is what I get:

like some geometry might be missing as you wrote but looks like there were no answer so far to this. Also what's the deal with the second vertices array? this:

Code: [Select]
  u16 verticies1[4]; //Edge data???

Is it normal? I'm also retriangulating quads with ABCD> ABD ACD (as in battle stages)
My guess is it's because of the animation and geometry is not in t-pose, what's your opinion?