Thanks ficedula.
Here comes more accurate decription of section 3
Field file - section 3
======================
This section is about data for showing 3d objects actually to screen, to do that you need some external data and names of files for these data is what is stored here.
Note to position: I am changing sign or something like that so, if you will take x,y,z and change signs according to me, you will get correct position in walkmesh. I just load walkmesh. coordinates [x,y,z] in walkmesh are just x,y,z. No change.
typedef struct {
S16 blank; // always zero
S16 numchar; // number of characters
S16 size; // same as size
object charinfo[numchar];
} sec3;
Lets dig in. Sec3 is structure for complete file.
blank - always zero.
numchar - number of 3dobjects in field. Although it is named char(acters), it can be anything, savepoint, treasure box...
size -- everywhere I lookes was same as size after .HRC (look below for more info), but nothing happend if I changed it(PC version). I thought it is maybe backup if size is not define after HRC then use this. Again wrong. Well, I dont know what it is for, just give it same size as you give after ????.HRC. It doesnt resize walkmesh either. Maybe obsolete from development when they thought it would be nice to have one resize for all and after that they thought it would be nice to let every object have different resize.
typedef struct {
S16 charnamelen;
chars charname[charnamelen];
S16 blank; // 0 end of string?
char skeletname[12]; // AAAA.HRC1024 or AAA.HRC512\0 - just 12 chars, no ending zero
U16 numani; // number of animation or whatever it is. see ani[]
light_s light[3];
U8 ambientred;
U8 ambientgreen;
U8 ambientblue;
animation ani[numani];
} object;
After few necessary information comes numchar * structure object. It has all information for 3dobject - name of skeletonfile, animations and such.
charnamelen - lenght of name for this object. Not really sure, whether there are some rules, but every name I have seen was something like [name_of_location_file][description_of_object_or_its_name][separator, is always 0x2E]char -> eg. condor1main_n_cloud\0x2Echar .charname is string without ending zero, only characters of string.
blank - seems to be always zero
skeletname - every skeleton file for field is 4 chars long (eg. AAER). Then there is separator 0x2E, chars HRC and after this is number of maximum four digits (often 512 or 1024 ). This number define resize value. Every skeleton has some lenght of bones, its .p files have vertexes with some coordinates for x,y,z. These coordinates and lenghts are to be multiplied by this number. TO sum it up, this number define how bigger object will be than is in original files (I hope, I maybe there is some sort of fixed point, but bigger this number is, bigger object on screen). (look ar
http://www.ms.mff.cuni.cz/~havlj3am/FF7/condor1_hrc768.png and compare with
http://www.ms.mff.cuni.cz/~havlj3am/FF7/condor1_hrc1024.png)
numani - number of animation for this object
typedef struct {
U8 red; // composition of light for spotlight
U8 green;
U8 blue;
vector3S16 pos; // position. I walkmesh [-x,-y,z]
} light_s;
light[3] - every object has three light sources, you can choose its position (distance from [0,0,0]: square often use something around 4103+-5, I have seen 2095... just use imagination) and intensity of each component of light. The bigger is vale for some component the more it will take effect (you can use red for bloodfiled ^__^). Position has to be adjusted.
pos.x = -x;
pos.y = -y;
pos.z = z;
after lights with source, there is ambient light (light that is everywhere, no shading), again, you can define intensity of each component. Picture will show how does ambient light look, so I dont have to explain.
typedef struct {
S16 lenght; // how long will be anme of next animation
char name[lenght]; // ACFE.aki | ADCC.tor | ????.yos // . == 2E
S16 unknown; // often 0x0001 - maybe end of string?
} animation
And last part of are animation. There is numani * structure animation.
lenght - lineght indicator for animation
name - string without zero at the end. [name_of_animation_file][separator 0x2E][aki^yos^anm] like GWIE.anm, HOJD.yos, AAGA.aki ...What is meaning in different suffixes I dont know.
unknown - seems to be always 0x0001
Created by Kero (
[email protected])
If you find error, PM me or mail me.
I spent some time researching and writing this (10hrs, light were nasty), so if you find this usefull and write program be so kind let me know.
Thx goes to ficedula, halkun, alhexx..
EDIT:TODO
sec3.blank - always zero.
sec3.object[].blank - zero or 1. Nothing changed even if I set it to 0x11. Dont know purpose.
sec3.object[].ani[].unknown - various values from 0 to +-200
Link to simple convertor from sec3 to human readable format and it's
sourceYou may need to use
section divider (
src).