Joined: Jan 18, 2008 Posts: 1170 Location: Memphis TN
Status: Offline
Posted: Tue Feb 16, 2010 5:35 pm Post subject: Freelancer Sur File Format
SUR File Format
Compiled By Lancer Solurus with Adoxa's help
All values in HEX unless otherwise noted (Size in decimal)
*****************************************
Size(d) Type Comment
** Header
4 string 'vers' - Version
4 float 2.0
** Section header
4 ULONG CRC
4 ULONG Surface Type Count (!fxd, exts, surf & hpid)
4 string '!fxd' - Part header
4 string 'exts' - Tag
12 XYZ Box minimum
12 XYZ Box maximum
** Surface tag
4 string 'surf' - Surface
** Surface header 0x00000034
4 ULONG Surface offset, bytes to next HPID or section (this addr + offset)
** Surface base pointer 0x00000038
12 XYZ Center
12 XYZ Inertial damping
4 float Radius for visibility (set this large enough to surround entire object to keep it from 'popping', 1.5*radius is good)
1 byte Scaler 0 - 250
3 byte Duplicate of surface offset above
4 ULONG Bits section offset (surface header start addr + offset)
4 ULONG 0 unused
4 ULONG 0 unused
4 ULONG 0 unused
** Face list header (size = 16*face lists)
4 ULONG Vertex list offset (this addr + offset)
4 ULONG Cmpnd/HP CRC or bits offset if 'last face group flag' is set
1 byte Type 4-normal face, 5-face linkage (final face list entry)
3 byte Referenced vertex count, unused by FL, simply set to 0
4 ULONG Face count
** Face list (size = 16*Face count)
12 bits Face number nn xn xx xx (4 bytes) max 16,384 faces
12 bits Opposite face xx nx nn xx
1 byte Flag xx xx xx nn
2 WORD Vertex index 1 nn nn xx xx
15 bits Opposite offset xx xx nn nn (bits 0-14)
1 bit Last Face Group Flag xx xx xx nx (bit 15) (only set if more than 1 face group)
2 WORD Vertex index 2
15 bits Opposite offset
1 bit Last Face Group Flag
2 WORD Vertex index 3
15 bits Opposite offset
1 bit Last Face Group Flag
** Vertex list (size = 16*Vertex count)
12 XYZ Vertex position
4 ULONG Cmpnd/HP CRC
** Bits section (as in 24 bit bitmap)
4 ULONG Sibling offset {Bits base addr + offset)
4 ULONG Triangle offset (this bits base addr - face base offset (0-fbo)) (if sibling offset is not 0, this is 0)
12 XYZ Center
4 float Radius
4 ULONG Scaler 0 - 250 (XX YY ZZ xx) - xx is always 00 since it's unused
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum