Changes
From Final Fantasy Inside
no edit summary
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" align="center" | Offset! style="background:rgb(204,204,204)" align="center" | Length! style="background:rgb(204,204,204)" align="center" | Description|-| 0x0000| 4 bytes| Pointer to first data file. You must multiply it by 4 to get actual data file offset. If the pointer is equal to FFFFFFFFh then it means that the end of block has been reached.
|-
| 0x00040
| 4 bytes
| Pointer to second data file. You must multiply it by 4 to get actual data file offset. If the pointer is equal to FFFFFFFFh then it means that the end Number of block has been reachedsections (always =11, except for c0m127.dat)
|-
|colspan="3" align="center" 4| ...nbSections * 4 bytes| Section Positions
|-
| 0x003C4 + nbSections * 4
| 4 bytes
| Last pointer, usually it equal FFFFFFFFh.|-| 0x0040| 4 * (pointer2 - pointer1) bytes| First data file in block. It's a gziped file.<br>''Note: Sometimes it may finish by 0xFF bytes, because its File size must be multiple of 4.''|-| pointer2 * 4| 4 * (pointer3 - pointer2) bytes| Second data file in block. It's a gziped file.<br>''Note: Sometimes it may finish by 0xFF bytes, because its size must be multiple of 4.''|-|colspan="3" align="center" | ...|-| lastpointer * 4| 4 * (2000h - lastpointer) bytes| Last data file in block.<br>''Note: There are about 6 to 12 files in each block. Each block finishes by 0xFF bytes, because its length must be 2000h (8192d) bytes.
|}
===Data file format=Section 1: Skeleton ==
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204,204,204)" align="center" | Offset! style="background:rgb(204,204,204)" align="center" | Length! style="background:rgb(204,204,204)" align="center" | Description|-| 0x0000| 2 bytes| Enemy ID 1|-| 0x0002| 2 bytes| Enemy ID 2|-| 0x0004| 2 bytes| Enemy ID 3|-| 0x0006| 2 bytes| Padding (always FFFFh)|-| 0x0008| 4 * 20 bytes| Battle Setup (4 records) ([[#Battle_Setup_1_format|format explanation]])|-| 0x0058| 4 * 48 bytes| Camera Placement Data (4 records) ([[#Camera_Placement_Data_format|format explanation]])|-| 0x0118| 6 * 16 bytes| Battle Formation 1 (6 records) ([[#Battle_Formation_Data|format explanation]])|-| 0x0178| 6 * 16 bytes| Battle Formation 2 (6 records)|-| 0x01E8| 6 * 16 bytes| Battle Formation 3 (6 records)|-| 0x0238| 6 * 16 bytes| Battle Formation 4 (6 records)|-| 0x0298| 184 bytes| Enemy Data 1 ([[#Enemy_data_format|format explanation]])|-| 0x0350| 184 bytes| Enemy Data 2|-| 0x0408| 184 bytes| Enemy Data 3|-| 0x04C0| 32 * 28 bytes| Attack Data (32 records) ([[FF7/Attack_data|format explanation]])|-| 0x0840| 32 * 2 bytes| Attack IDs (32 records)
|-
| 0x0880| 32 * 32 bytes| Attack Names (32 records, [[FF7/FF Text|in FF Text format]])|-| 0x0C800
| 2 bytes
| Formation 1 AI Script OffsetNumber of bones
|-
| 0x0C82style="background:rgb(255,255,204)" | 2| 2 style="background:rgb(255,255,204)" | 14 bytes| Formation 2 AI Script Offsetstyle="background:rgb(255,255,204)" | Unknown
|-
| 0x0C8416| 2 bytes| Formation 3 AI Script Offset|-| 0x0C86| 2 bytes| Formation 4 AI Script Offset|-| 0x0C88| 0 - 504 bytes| Beginning Number of Formation AI Data ([[#AI_Data|format explanation]])|-| 0x0E80| 2 bones * 48 bytes| Enemy 1 AI Offset|-| 0x0E82| 2 bytes| Enemy 2 AI Offset|-| 0x0E84| 2 bytes| Enemy 3 AI Offset|-| 0x0E86| 0 - 4090 bytes| Beginning of AI Data ([[#AI_Data|format explanation]])Bones
|}
=== Bone struct ===
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204,204,204)" align="center" | Offset! style="background:rgb(204,204,204)" align="center" | Length! style="background:rgb(204,204,204)" align="center" | Description|-| 0x0000| 2 bytes| '''Battle location, as follows:'''|-|style="background:rgb(204,204,255)" align="center" colspan="2" rowspan="2" | |-| 0000h : Blank<br>0001h : Bizarro Battle - Center<br>0002h : Grassland<br>0003h : Mt Nibel<br>0004h : Forest<br>0005h : Beach<br>0006h : Desert<br>0007h : Snow<br>0008h : Swamp<br>0009h : Sector 1 Train Station<br>000Ah : Reactor 1<br>000Bh : Reactor 1 Core<br>000Ch : Reactor 1 Entrance<br>000Dh : Sector 4 Subway<br>000Eh : Nibel Caves or AForest Caves<br>000Fh : Shinra HQ<br>0010h : Midgar Raid Subway<br>0011h : Hojo's Lab<br>0012h : Shinra Elevators<br>0013h : Shinra Roof<br>0014h : Midgar Highway<br>0015h : Wutai Pagoda<br>0016h : Church<br>0017h : Coral Valley<br>0018h : Midgar Slums<br>0019h : Sector 4 Corridors or Junon Path<br>001Ah : Sector 4 Gantries or Midgar Underground<br>001Bh : Sector 7 Support Pillar Stairway<br>001Ch : Sector 7 Support Pillar Top<br>001Dh : Sector 8<br>001Eh : Sewers<br>001Fh : Mythril Mines<br>0020h : Northern Crater - Floating Platforms<br>0021h : Corel Mountain Path<br>0022h : Junon Beach<br>0023h : Junon Cargo Ship<br>0024h : Corel Prison<br>0025h : Battle Square<br>0026h : Da Chao - Rapps Battle<br>0027h : Cid's Backyard<br>0028h : Final Descent to Sephiroth<br>0029h : Reactor 5 Entrance<br>002Ah : Temple of the Ancients - Escher Room<br>002Bh : Shinra Mansion<br>002Ch : Junon Airship Dock<br>002Dh : Whirlwind Maze<br>002Eh : Junon Underwater Reactor<br>002Fh : Gongaga Reactor<br>0030h : Gelnika<br>0031h : Train Graveyard<br>0032h : Great Glacier Ice Caves & Gaea Cliffs - Inside<br>0033h : Sister Ray<br>0034h : Sister Ray Base<br>0035h : Forgotten City Altar<br>0036h : Northern Crater - Initial Descent<br>0037h : Northern Crater - Hatchery<br>0038h : Northern Crater - Water Area<br>0039h : Safer Battle<br>003Ah : Kalm Flashback - Dragon Battle<br>003Bh : Junon Underwater Pipe<br>003Ch : Blank<br>003Dh : Corel Railway - Canyon<br>003Eh : Whirlwind Maze - Crater<br>003Fh : Corel Railway - Rollercoaster<br>0040h : Wooden Bridge<br>0041h : Da Chao<br>0042h : Fort Condor<br>0043h : Dirt Wasteland<br>0044h : Bizarro Battle - Right Side<br>0045h : Bizarro Battle - Left Side<br>0046h : Jenova*SYNTHESIS Battle<br>0047h : Corel Train Battle<br>0048h : Cosmo Canyon<br>0049h : Caverns of the Gi<br>004Ah : Nibelheim Mansion Basement<br>004Bh : Temple of the Ancients - Demons Gate<br>004Ch : Temple of the Ancients - Mural Room<br>004Dh : Temple of the Ancients - Clock Passage<br>004Eh : Final Battle - Sephiroth<br>004Fh : Jungle<br>0050h : Ultimate Weapon - Battle on Highwind<br>0051h : Corel Reactor<br>0052h : Unused<br>0053h : Don Corneo's Mansion<br>0054h : Emerald Weapon Battle<br>0055h : Reactor 5<br>0056h : Shinra HQ - Escape<br>0057h : Ultimate Weapon - Gongaga Reactor<br>0058h : Corel Prison - Dyne Battle<br>0059h : Ultimate Weapon - Forest|-| 0x0002| 2 bytes| Upon defeat of all opponents in current formation, begin battle with [[FF7/Battle/Battle_scenes#Formation_ID|Formation ID]] without ending battle scene
|-
| 0x00040
| 2 bytes
| Escape CounterParent id
|-
| 0x00062
| 2 bytes
| Unused/Align 'FF'Bone size
|-
| 0x0008| 4 * 2 bytes| [[FF7/Battle/Battle_scenes#Formation_ID|Formation ID]] of candidates for next Battle Arena battle. style="background:rgb(default of 03E7h)|-| 0x0010| 2 bytes| Escapable Flag (Along with other flags)|-| 0x0012| 1 byte| Battle layout type (normal255, ambush255, side204). 0-8 types." |-4|style="background:rgb(204255,255,204,255)" align="center" colspan="2" rowspan="10" | 44 bytes|-| 00 - Normal fight|-| 01 - Preemptive|-| 02 - Back attack|-| 03 - Side attack|-| 04 - Attacked from both sides style="background:rgb(pincer attack255,255, reverse side attack204)" |-| 05 - Another attack from both sides battle Unknown (different maybe?often empty)|-| 06 - Another side attack|-| 07 - A third side attack|-| 08 - Normal battle that locks you in the front row, change command is disabled|-| 0x0013| 1 byte| Indexed Pre-Battle Camera position
|}
==== Camera Placement Data format ==Section 2: Model geometry ==
|-
| 0x000| 12 4 bytes| Primary Battle Idle Camera Position|-|style="background:rgb(204,204,255)" align="center" colspan="1" rowspan="7" | |-| 0x0| Camera X Position|-| 0x2| Camera Y Position|-| 0x4| Camera Z Position|-| 0x6| Camera X Direction|-| 0x8| Camera Y Direction|-| 0xA| Camera Z DirectionNumber of objects
|-
| 0x0C4| 2 nbObjects * 12 4 bytes| Other Camera Object Positions in the above format referenced in enemies' animations.|-| 0x24| 12 bytes| Unused/Align 'FF'
|}
==== Battle Formation Object Data ====
|-
| 0x000
| 2 bytes
| Enemy IDNumber of Vertices Data|-| 2| Varies * NbVerticesData| Vertices Data|-| Varies| absolutePosition % 4| Padding (0x00)
|-
| 0x02Varies
| 2 bytes
| position XNum triangles
|-
| 0x04Varies
| 2 bytes
| position YNum quads
|-
| 0x06Varies| 2 8 bytes| position ZPadding (0x00)
|-
| 0x08Varies| 2 numTriangles * 16 bytes| RowTriangles
|-
| 0x0AVaries| 2 numQuads * 20 bytes| [[#Binary_"Cover_Flags"|Binary "Cover flags"]]Quads
|-
| 0x0CVaries
| 4 bytes
| Gets mapped to battle unit structure 4020-403F and contains flags Total number of vertices (details pendingmay be not visible)
|}
==== Enemy data format Vertice Data ====
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204,204,204)" align="center" | Offset! style="background:rgb(204,204,204)" align="center" | Length! style="background:rgb(204,204,204)" align="center" | Description|-| 0x0000| 32 bytes| Enemy's name (completed by FFh bytes)|-| 0x0020| 1 byte| Enemy's level|-| 0x0021| 1 byte| Enemy's speed|-| 0x0022| 1 byte| Enemy's luck|-| 0x0023| 1 byte| Enemy's evade|-| 0x0024| 1 byte| Enemy's strength|-| 0x0025| 1 byte| Enemy's defense|-| 0x0026| 1 byte| Enemy's magic|-| 0x0027| 1 byte| Enemy's magic defense|-| 0x0028| 8 bytes| Element types (8 records):<br>00h - Fire<br>01h - Ice<br>02h - Bolt<br>03h - Earth<br>04h - Bio<br>05h - Gravity<br>06h - Water<br>07h - Wind<br>08h - Holy<br>09h - Health<br>0Ah - Cut<br>0Bh - Hit<br>0Ch - Punch<br>0Dh - Shoot<br>0Eh - Scream<br>0Fh - HIDDEN<br>10h-1Fh - No Effect<br>20h-3Fh - [[FF7/Battle/Status Effects|Statuses]] (Damage done by actions that inflict these statuses will be modified)<br>FFh - No element|-| 0x0030| 8 bytes| Element rates for elements above, respectively (8 records):<br>00h - Death<br>02h - Double Damage<br>04h - Half Damage<br>05h - Nullify Damage<br>06h - Absorb 100%<br>07h - Full Cure<br>FFh - Nothing|-| 0x0038| 16 bytes| Action animation index (1 byte each).|-| 0x0048| 32 bytes| Enemy Attack ID's (2 bytes each).|-|style="background:rgb(255,255,255)" | 0x0068|style="background:rgb(255,255,255)" | 32 bytes|style="background:rgb(255,255,255)" | Enemy Attacks [[FF7/Battle/Camera Movement Id List|Camera Movement Id]] for single and multiple targets (2 bytes each). If set this will overwrite camera movement set in attack itself.|-| 0x0088| 4 bytes| Item drop/steal rates.<br>These are chances to get items listed in next section. 1 byte per item. If the rate is lower than 80h, for e.g. 08h - then this is a drop item and has 8/63 [63 is max] chance for drop. But if rate is higher than 80h, let's say... A0h, then this is an item for steal, and chances for successful steal is A0h - 80h = 20h = 32/63.|-| 0x008C| 8 bytes| This is a list of Item ID's which are described above. 2 bytes per item. FFFFh means no item.|-| 0x0094| 6 bytes| Indexes of up to three attacks (2 bytes each) that enemy can perform while manipulated or berserked
|-
|style="background:rgb(255,255,204)" | 0x009A|style="background:rgb(255,255,204)" | 2 bytes|style="background:rgb(255,255,204)" | Unknown data|-| 0x009C0
| 2 bytes
| Enemy's MPBone id
|-
| 0x009E2
| 2 bytes
| AP points you receive when you win the battleNumber of vertices
|-
| 0x00A04| 2 nbVertices * 6 bytes| Enemy can be morphed into this item. FFFFh if it can't be morphed into anything.Vertices (nbVertices * 3 shorts)|-} ==== Useful structures ==== typedef struct {| 0x00A2 sint16 x, y, z;| 1 byte } vertice;| Multiplier for back damage. damage (sizeof = damage * 0xXX 6) typedef struct { uint16 vertex_indexes[3]; uint8 texCoords1[2]; uint8 texCoords2[2]; uint16 textureID_related; uint8 texCoords3[2]; uint16 u; // 8.textureID_related2|- } triangle;(sizeof = 16) typedef struct { uint16 vertex_indexes[4]; uint8 texCoords1[2]; uint16 textureID_related;| 0x00A3 uint8 texCoords2[2];| 1 byte uint16 u; // textureID_related2| align 0xff. uint8 texCoords3[2];|- uint8 texCoords4[2];| 0x00A4 } triangle;| 4 bytes(sizeof = 20)| Enemy's HP|-== Section 3: Model animation ==| 0x00A8| 4 bytes=== Header (data sub table) ===| Exp points you receive when you win the battle{|border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204,204,204)" | 0x00ACOffset! style="background:rgb(204,204,204)" | 4 bytesLength! style="background:rgb(204,204,204)" | Gil you receive when you win the battleDescription
|-
| 0x00B00
| 4 bytes
| Status immunitiesNumber of animations
|-
|style="background:rgb(255,255,204)" | 0x00B44|style="background:rgb(255,255,204)" | nbAnimations * 4 bytes|style="background:rgb(255,255,204)" | Unknown [Always FFFFFFFFh]Animations Positions
|}
==Section 4: Unknown ==Formation ID==== Formation ID is an index to a formation within a given scene. It is the scene index bit shifted 2 to the left plus formation index within the scene.
====AI Data=Header ===
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" align="center" | Offset! style="background:rgb(204,204,204)" align| Length! style="centerbackground:rgb(204,204,204)" | Script TypeDescription
|-
| 0x000| Initialize2 bytes|-| 0x02| Main|-| 0x04| General Counter|-| 0x06| Death Counter|-| 0x08| Physical CounterNumber of scripts
|-
| 0x0A| Magical Counter|-| 0x0C2| Battle End|-| 0x0E| Pre-Action Setup|-|style="background:rgb(255,255,204)" | 0x10|style="background:rgb(255,255,204)" | Custom Event 1|-|style="background:rgb(255,255,204)" | 0x12|style="background:rgb(255,255,204)" | Custom Event nbScripts * 2bytes|-|style="background:rgb(255,255,204)" | 0x14|style="background:rgb(255,255,204)" | Custom Event 3|-|style="background:rgb(255,255,204)" | 0x16|style="background:rgb(255,255,204)" | Custom Event 4|-|style="background:rgb(255,255,204)" | 0x18|style="background:rgb(255,255,204)" | Custom Event 5|-|style="background:rgb(255,255,204)" | 0x1A|style="background:rgb(255,255,204)" | Custom Event 6|-|style="background:rgb(255,255,204)" | 0x1C|style="background:rgb(255,255,204)" | Custom Event 7|-| 0x1E| Custom Event 8Scripts Positions
|}
==== Binary "Cover Flags" ==Section 7: Informations & stats ==
== Useful downloads Section 8: Battle scripts ==