Anonymous

Changes

From Final Fantasy Inside

FF7/Battle model format (PSX)

No change in size, 22:38, 4 August 2005
Playstation Battle Model Format
== Playstation Battle Model Format battle model format ==
The entire file is compressed using [[FF7/LZS format|LZS format]] and is decompressed into the playstation user memory for a battle. The file consists of several section blocks, a header, compiled HRC and model information, battle animations, a texture image in [[PSX/TIM_format|TIM format]], and optional weapon models. All integers short or long are little endian based. This includes some of the [[FF7/Animation Format|animation data]] as well.
=== Battle Model Header model header ===
The header section is a sequence of little endian 32 bit unsigned integers. The first integer (entitled SectionCount) contains the number of pointers offset from the begining of the file. The remaining integers are SectionCount number of pointers.
=== Battle Model model HRC/Model Information model information ===
This is the first section and consists of real model data and bone structure. Without the animation information the model CANNOT be displayed properly.
==== HRC Data data ====
This data resembles [[PSX/HRC|Hierarchy files (.HRC)]], from the PsyQ library. To be correct the HRC files were used to generate this information hence it's called HRC data. The HRC data begins with an unsigned 32 bit integer (BoneCount) indicating the number of bones. Following this is the '''root bone''', which is allays zero'd. After the root bone is BoneCount number of bones. The bone information is stored in a structure like the thus (using C conventions):
<pre>typedef struct
Where offset is relative to the begining of the section. If Offset is 0 then the object is a '''Joint''' otherwise it's a bone. All FF7 bone lengths are negative.
==== Model Information information ====
Following the HRC Data is the model information, these are referenced by offsets in the '''Bone''' structure. Each bone has it's own model section specific too it. Each bone section has the following information uint32 VertexCount (int bytes), Vertices, Textured Triangle Count (Poly Count Structure), Textured Triangles, Textured Quadric Count (PCS), Textured Quadrics, Triangle Count (PCS), Triangles, Quadric Count (PCS), Quadrics. If the count of any of these is zero then the follow data is a Poly Count Structure.
The Flags field on the Textured polygons contains the texture palette offset for the [[PSX/TIM_format|TIM]] texture file associated with the model. The TexPage is not used in any of the battle models however battle scenes do use this to refer another page of texture data (for 8bpp [[PSX/TIM_format|TIM]]'s used in them).
=== Battle Animations animations ===
This is identical to the PC version of FF7.
=== Texture Information information ===
see [[PSX/TIM_format|TIM format]]
=== Weapon Models models ===
These are identical to the bone model structures, as the weapon models are treated as bones in character animation. They have NO texture data period.
Anonymous user