Changes

Jump to navigation Jump to search

FF8/FileFormat magfiles

1,775 bytes added, 05:25, 23 May 2019
m
19 revisions imported
There is no unified format for MAG files. Every file has their own naming, even extension. You can't really distinguish them.
Files starting with 10 00 00 00 09 00 00 00 are obviously TIM texture. What we know so far is how to extract GF sequence and GF environment geometry Files starting with null 4 bytes are in most cases "Packed magic file" ==Packed magic file=={| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204,204,204)" | Offset! style="background:rgb(ifrit ball204, Leviathan's rock204, Cerberus gate...204)" | Description|-| 0x00| Probably always null|-| 0x04| Probably bones/animation data|-| 0x08| Unknown (used to determinate texture size*)|-| 0x0C| Geometry pointer|-| 0x10| SCOT pointer|-| 0x14| Texture pointer|} 
==G.F. Sequence==
==Environment objects==
'''I'm aware it's chaotic''', like no tables and etc. but it's '''up-to-date''' information and I'll '''update it after I crack the face indices''' (triangles/quads)
First, recognize file:
1.Header must be 8 bytes null!!  2.Jump to pointer at 0xC [Global]
32.This int indicates pointer count. Example: 10 00 00 00 is 16 pointers
3a3. If pointer is 00 00 00 00, just ignore it and move forward
4.After noting all pointers that are not 00 00 00 00 (therefore inspecting Count*4 bytes) just jump to selected one [Relative jump from count int]
Example: 09 00 9f 01 means there's 9f 01 (415) polygons of type 0x9. Therefore: 28*415=11620 bytes to next polygon type or vertices if FF FF FF FF.
==Magic.fs and Battle.fs MAG environment GF objects==
GF Environment (stages like Cerberus gate; Alexander backdrop and etc.) geometry contains many polygon types (sic!). Every single polygon type is different than other.
short y
short w //rarely used, for skeleton weighting
 
==Textures==
1. See 0x08, it points almost always to null data, but also indicates where to stop watching texture pointers
 
2. Jump to pointer 0x14 (almost always 0x30)
 
3. Note all pointers if not zero until streamPosition==*(0x08)
 
4. If no pointers, file has no texture.
 
5. Jump to texture (pointer+*(0x14)) e.g. 48+21675
 
6. There's no sizes, so if there's another texture after the one you're getting, then subdivide next texture position from current position to get size and determine texture resolution. If it's the last texture, then it gets a bit tricky, as in many ways the file is not ending with texture but SCOT for example..
 
Texture is '''8BPP''' (does not contain palette/monochromatic) (one byte is all three channels in 24RGB manner)
 
'''Texture resolution is based on size:'''
 
 
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" | Texture byte size
! style="background:rgb(204,204,204)" | Texture final resolution
|-
| 0x2000
| 64x64 (or 32x32)*
|-
| 0x4000
| 128x128 (or 64x64)*
|-
| 0x8000
| 256x256 (or 128x128)*
|-
| 0x10000
| 256x256
|}
GFs uses higher texture resolution, for example 0x2000 is 64x64 instead of 32x32, but many magic texture like fire effect animation atlas texture is using the lower resolution (the one with asterisk *, for example 0x2000 for fire atlas animation texture it's 32x32 instead of 64x64)
 
==SCOT==
Related to sound transition effect. Structure is completely unknown.

Navigation menu