Monday, January 25, 2016

FF7's CHOCOBO.WAT - having fun with 3D models

While trying to understand the different sections of the WAT files, I made a tool to convert some of them to 3D models; you can download the result here:
http://www.geocities.jp/ergonomyjoe/chocobo_obj_20160126.zip

Of course it is just an interpretation of the original data, and it lacks some information, like transparency and billboards(sprites).


The converted sections are:
-LDG3, LDG4, SDG3 and SDG4: the S stands for "SHORT" and the L for "LONG" and DG3 is for triangles while DG4 is for quads.
-SDOMEG3 and LDOMEG3 which are the "skydomes" for respectively the SHORT and the LONG course; the happen to be the same.

I used a slightly improved Wavefront .obj format, to include color in the vertex information; depending on the viewer you use you may not be able to see them.

By the way, here is the C structures of these sections:

#pragma pack(1)
struct SVECTOR {
 short x,y,z,pad;
};

typedef union {//size 4
 struct {
  unsigned char r,g,b,a;
 }c;
 unsigned rgba;
}tRGBA;

struct t_chocobo_data_DOMEG3 {//size 0x24
 /*+00*/struct SVECTOR vert_0,vert_1,vert_2;
 /*+18*/unsigned color_0,color_1,color_2;
};

struct t_chocobo_data_DG3 {//size 0x1c
 /*+00*/struct SVECTOR vert_0,vert_1,vert_2;
 /*+18*/tRGBA color_0;
 //color_1 and color_2 are "hidden" in vert_0.pad, vert_1.pad, vert_2.pad
};

struct t_chocobo_data_DG4 {//size 0x28
 /*+00*/struct SVECTOR vert_0,vert_1,vert_2,vert_3;
 /*+20*/tRGBA color_0,color_1;
 //color_2 and color_3 are "hidden" in vert_1.pad, vert_2.pad, vert_3.pad, color_0.c.pad
};
#pragma pack()


Have fun!!

1 comment:

Tom50872 said...

Hello, I am Tom and am part of the Q-Gears project, and would like to help you decompile the game as it has been one of my dreams to decompile it. I am good at deobfusticating java code, because I decompiled Minecraft Classic. (Deobfustication = finding out what variable do and renaming variables and methods to what they do)
So, what progress have you made, and can I help with debugging and figuring out what does what?

I also tried posting a comment from my phone but as it turns out it didn't come through.