TRE:TRE Breakdown

From SWGANH Wiki
Revision as of 11:12, 28 August 2008 by Lloydyboy (Talk | contribs) (IFF - '''Interchange Format File''')

Jump to: navigation, search

Welcome to SWGANH Tre Sub-Files Documentation

TreFiles History TreFile Template

ANS

File Type: ANS format




APT - Appearance File

File Type: APT format




ASH

File Type: ASH format




CDF - Client Data File

File Type: CDF format




CEF - Client Effect file

File Type: CEF format




CFG - Configuration file

File Type: CFG format




CMP - Component File

File Type: CMP format




DDS - DirectDraw Surface File (Texture)

File Type: DDS format
DirectDraw Surface File (texture)

Download plugin for photoshop here: 
http://download.nvidia.com/developer/NVTextureSuite/Photoshop_Plugins_7.83.0629.1500.exe

MSDN article on file format here: 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/dx9_graphics_reference_dds_file.asp


EFT - Effect

Eft.jpg


File Type: EFT format
 - The first DATA record contains 2-bytes.  The first byte is an unsigned char that represents
the number of IMPL Forms in the file.  The 2nd byte is currently unknown.

 - The PVSH form contains a record of 0000 which contains the full path of an HLSL vertex shader
program.

 - The PPSH form contain a 0001 form which contains 1 DATA record and a variable number of PTXM
forms.  The DATA record is made up of 1 unsigned char (which indicates the number of PTXM records)
followed by the full path of an HLSL pixel shader program.

 - Each PTXM form contains one 0002 record.  The first byte of which is an unsigned char followed
by a 4 char texture tag name.


FFE - Force Feedback File

File Type: FFE format




FLR

File Type: FLR format




IFF - Interchange Format File

File Type: IFF format
http://www.szonye.com/bradd/iff.html - Overview of File Format
http://www.ibm.com/developerworks/power/library/pa-spec16/ - alternative Overview

IFF Files are made up of Chunk(s). Each Chunk follows the format:

Type (4 x Char)
Size (32 Bit Int Big-Endian)
Data (Length determined by Size)

(NOTE: Data lengths which are odd numbers are padded by a '0' which is not included in the Size (for 2 byte alignment) 
however, SOE *seems* to have ignored this requirement)

Chunks can contain other (child) Chunks, or even complete .IFF Files.

IFF Files must start with types of either: 'FORM' (0x464F524D), 'LIST' (0x4C495354) or 'CAT ' (0x43415420).

Strictly speaking, IFF Files must have a single Root Chunk in the file to keep to the Standard,
however it is expected that Top Level Chunk may potentially co-exist in SOEs IFFs.

It is currently believed that all SOE IFFs start with FORM (LIST and CAT not required).

FORM Types are basically storage (Record) for other proprietary Chunks.

Every SOE FORM has an additional 32bit Sub Type taking up offsets 8-11 ie:
Type (4 x Char)
Size (32 Bit Int Big-Endian)
Sub-Type (4x Char)
Data (Length determined by Size)

This means, for SOE FORMs, the data starts at offset 12, and is Size-4 long.

~ Known SOE Proprietary Chunks ~
CRCT - List of 32bit SOE CRCs, no delimeter
STNG - List of Strings, delimited by 0x00
DATA - Some sort of Value. In Lists it appears to be an item count
STRT - Hash Table IDs, 32bit, no delimeter
EMAP - List of 3 No. Strings, delimited by 0x00. Appear to be Event Related. "EventSource\0EventDestination\0ClientEffect"
0000 - List of Strings (generally Filenames), delimited by 0x00

~ Example ~
An Example SOE .IFF (Misc\planet_crc_string_table.iff)
FORM (Length 524, Subtype CSTB [0x43535442])
*FORM (Length 512, Subtype 0000 [0x30303030])
**DATA (Length, 4)
**CRCT (Length 100)
**STRT (Length 100)
**STNG (Length 272)


ILF - Interior Layout File

File Type: ILF format




INC - Include File

File Type: INC format




LAT

File Type: LAT format

possible relation to MAYA Lattices


LAY - Layout File

File Type: LAY format




LMG

File Type: LMG format

[FORM]   
[uint32]           //formsize
[MLOD]

[FORM]
[uint32]           //formsize
[0000]

[INFO]
[uint32]           //infosize(2)
[uint16]           //name elements count

[NAME]
[uint32]           //namesize
[namestring]       //0 terminated 


LOD - level of detail

File Type: LOD format




LSB

LSB? File

LTN

LTN? File Something to do with lighting

MGN

MGN? File 3d model information


File Type: MGN format
rollout SWG_roll "Model importer" (
fn readInvLong f = (
  t1 = readbyte f #unsigned
  t2 = readbyte f #unsigned
  t3 = readbyte f #unsigned
  t4 = readbyte f #unsigned
  return (t4+t3*0x100+t2*0x10000+t1*0x1000000)
)

fn readFORM f = (
  ofsForm = readInvLong f
  hdr = readlong f
  return hdr
)

fn readPoint3 f sc = (
  datasize = readInvLong f
  PT3Ary = #()
  testbyte = readlong f
  fseek f -4 #seek_cur
  if (testbyte<65536)AND(testbyte>=0) then (
   for i = 1 to (datasize/16) do (
    idx = 1 + (readlong f)
    vx = (readfloat f) * sc
    vy = (readfloat f) * sc
    vz = (readfloat f) * sc
    PT3Ary[idx] = [vx,-vz,vy]   
   )
   for i = 1 to PT3Ary.count do
    if PT3Ary[i] == undefined then PT3Ary[i] = [0,0,0]
  ) else (
   for i = 1 to (datasize/12) do (
    vx = (readfloat f) * sc
    vy = (readfloat f) * sc
    vz = (readfloat f) * sc
    append PT3Ary [vx,-vz,vy]   
   )
  )
  return PT3Ary
)

fn readTCSD f = (
  datasize = readInvLong f
  PT2Ary = #()
  for i = 1 to (datasize/8) do (
   vx = readfloat f
   vy = 1- (readfloat f)
   append PT2Ary [vx,vy,0]   
  )
  return PT2Ary
)

fn readPIDX f = (
  IndexAry = #()
  datasize = readInvLong f
  numIndex = readlong f
  for i = 1 to numIndex do append IndexAry (1+(readlong f))
  return IndexAry
)

fn readNIDX f = (
  IndexAry = #()
  datasize = readInvLong f
  for i = 1 to (datasize/4) do append IndexAry (1+(readlong f))
  return IndexAry
)

fn readOITL f = (
  IdxAry = #()
  Int3Ary = #()
  datasize = readInvLong f
  numdata = readlong f
  for i = 1 to numdata do (
   append IdxAry (1+(readshort f))
   f1 = 1 + (readlong f)
   f2 = 1 + (readlong f)
   f3 = 1 + (readlong f)
   append Int3Ary [f1,f2,f3]
  )
  return #(IdxAry,Int3Ary)
)

fn readITL f = (
  Int3Ary = #()
  datasize = readInvLong f
  numdata = readlong f
  for i = 1 to numdata do (
   f1 = 1 + (readlong f)
   f2 = 1 + (readlong f)
   f3 = 1 + (readlong f)
   append Int3Ary [f1,f2,f3]
  )
  return #(undefined,Int3Ary)
)

fn buildmesh VTary FCary NLary UVary PIDXary NIDXary = (
  for i = 1 to PIDXary.count do PIDXary[i] = VTary[(PIDXary[i])]
  for i = 1 to NIDXary.count do NIDXary[i] = NLary[(NIDXary[i])]
  if FCary[1] == undefined then  msh = mesh vertices:PIDXary faces:FCary[2]
  else msh = mesh vertices:PIDXary faces:FCary[2] materialIDs:FCary[1]
  msh.numTVerts = UVary.count
  buildTVFaces msh
  for j = 1 to UVary.count do setTVert  msh j UVary[j]
  for j = 1 to FCary[2].count do setTVFace msh j FCary[2][j]
  for j = 1 to NIDXary.count do setNormal msh j NIDXary[j]
  return msh
)
  ----------------------------------------------------------------------------
fn readDATA f numData sc = (
  datasize = readInvLong f
  if datasize < 8 then (
   fseek f datasize #seek_cur
   return undefined
  )
  VTary = #()
  NLary = #()
  UVary = #()
  sizeElement = datasize/numData
  --format "V:% @[%]\n" sizeElement (ftell f)
  for i = 1 to numData do (
   vx = (readfloat f)*sc;    vy = (readfloat f)*sc;    vz = (readfloat f)*sc
   nx = readfloat f;    ny = readfloat f;    nz = readfloat f
   --
   byteRead = 32
   case sizeElement of (
    36: ( readlong f ; byteRead = 36 )
    52: ( readlong f ; byteRead = 36 )
    56: ( fseek f 16 #seek_cur ; byteRead = 48 )
    default: byteRead = 32
   )
   vu = readfloat f;    vv = 1-(readfloat f)
   fseek f (sizeElement-byteRead) #seek_cur
   --
   append VTary [vx,-vz,vy]
   append NLary [nx,-nz,ny]
   append UVary [vu,vv,0]
  )
  return #(VTary,NLary,UVary)
)
fn readINDX f = (
  FCary = #()
  datasize = readInvLong f
  numIndex = readlong f
  sizeElement = datasize / numIndex
  for i = 1 to (numIndex/3) do (
   if sizeElement == 2 then (
    f1 = 1 + (readshort f #unsigned)
    f2 = 1 + (readshort f #unsigned)
    f3 = 1 + (readshort f #unsigned)
   ) else if sizeElement == 4 then (
    f1 = 1 + (readlong f #unsigned)
    f2 = 1 + (readlong f #unsigned)
    f3 = 1 + (readlong f #unsigned)
   ) else messagebox "error in face index"
   append FCary [f1,f2,f3]
  )
  return FCary
)
fn buildmesh2 VTary FCary NLary UVary = (
  msh = mesh vertices:VTary faces:FCary
  msh.numTVerts = UVary.count
  buildTVFaces msh
  for j = 1 to UVary.count do setTVert  msh j UVary[j]
  for j = 1 to FCary.count do setTVFace msh j FCary[j]
  for j = 1 to NLary.count do setNormal msh j NLary[j]
  return msh
)

--GUI--
spinner fscale "Scale : " fieldwidth:60 range:[0.001, 1000, 1]
button impMGN "Import   MGN / MSH" width:150 Height:25 align:#center
label lbl1 ""
label lbl2 "by Fatduck" align:#right

on impMGN pressed do (
  fname = getOpenFileName caption:"Select Star Wars Galaxies Model file" types:"MGN File (*.mgn)|*.mgn|MSH File (*.msh)|*.msh|All Files (*.*)|*.*|"
  if fname != undefined then (
   f = fopen fname "rb"
   fseek f 0 #seek_end
   ofsEOF = ftell f
   fseek f 0 #seek_set
   VTary = #()
   UVary = #()
   NLary = #()
   FCary = #()
   PIDXary = #()
   NIDXary = #()
   meshFlag = undefined
   infoFlag = undefined
   mshVert = 0
   do (
    header = readlong f
    case header of (
     0x58444E49:
       (
        FCary = readINDX f
        msh = buildmesh2 VTary FCary NLary UVary
       )
     0x41544144:
       (
        rslt = readDATA f mshVert fscale.value
        if rslt != undefined then (
         VTary = rslt[1]
         NLary = rslt[2]
         UVary = rslt[3]
        )
        infoFlag = false
       )
     0x4D524F46:
       (
        flg = readFORM f
        if flg == 0x474D4B53 then meshFlag = true --SKMG
        else if flg == 0x20544C42 then meshFlag = false --BLT
        if flg == 0x41585456 then infoFlag = true --VTXA
       )   
     0x4F464E49:
       (
        if infoFlag == true then (
         fseek f 8 #seek_cur
         mshVert = readlong f
        ) else fseek f (readInvLong f) #seek_cur
       ) 
     0x4E534F50:
       (
        if meshFlag == true then VTary = readPoint3 f fscale.value
        else readPoint3 f fscale.value
       )
     0x4D524F4E:
       (
        if meshFlag == true then NLary = readPoint3 f 1
        else readPoint3 f 1
       )
     0x58444950: PIDXary = readPIDX f
     0x5844494E: NIDXary = readNIDX f
     0x44534354: UVary = readTCSD f
     0x4C54494F:
       (
        FCary = readOITL f
        msh = buildmesh VTary FCary NLary UVary PIDXary NIDXary
       )
     0x204C5449:
       (
        FCary = readITL f
        msh = buildmesh VTary FCary NLary UVary PIDXary NIDXary
       )
     default:
       (
        datasize = readInvLong f
        fseek f datasize #seek_cur
       )
    )--end case
   ) while (ftell f) != ofsEOF
   fclose f
  )--end if fname
)--end on impMGN

)--end rollout SWG_roll

if Fatduck_SWG != undefined then closeRolloutFloater Fatduck_SWG
Fatduck_SWG = newRolloutFloater "Star Wars Galaxies" 200 175 10 70
addRollout SWG_roll Fatduck_SWG


MKR

Marker File

MP3

MP3 Audio File

MSH - mesh

File Type: MSH format
rollout SWG_roll "Model importer" (
fn readInvLong f = (
  t1 = readbyte f #unsigned
  t2 = readbyte f #unsigned
  t3 = readbyte f #unsigned
  t4 = readbyte f #unsigned
  return (t4+t3*0x100+t2*0x10000+t1*0x1000000)
)

fn readFORM f = (
  ofsForm = readInvLong f
  hdr = readlong f
  return hdr
)

fn readPoint3 f sc = (
  datasize = readInvLong f
  PT3Ary = #()
  testbyte = readlong f
  fseek f -4 #seek_cur
  if (testbyte<65536)AND(testbyte>=0) then (
   for i = 1 to (datasize/16) do (
    idx = 1 + (readlong f)
    vx = (readfloat f) * sc
    vy = (readfloat f) * sc
    vz = (readfloat f) * sc
    PT3Ary[idx] = [vx,-vz,vy]   
   )
   for i = 1 to PT3Ary.count do
    if PT3Ary[i] == undefined then PT3Ary[i] = [0,0,0]
  ) else (
   for i = 1 to (datasize/12) do (
    vx = (readfloat f) * sc
    vy = (readfloat f) * sc
    vz = (readfloat f) * sc
    append PT3Ary [vx,-vz,vy]   
   )
  )
  return PT3Ary
)

fn readTCSD f = (
  datasize = readInvLong f
  PT2Ary = #()
  for i = 1 to (datasize/8) do (
   vx = readfloat f
   vy = 1- (readfloat f)
   append PT2Ary [vx,vy,0]   
  )
  return PT2Ary
)

fn readPIDX f = (
  IndexAry = #()
  datasize = readInvLong f
  numIndex = readlong f
  for i = 1 to numIndex do append IndexAry (1+(readlong f))
  return IndexAry
)

fn readNIDX f = (
  IndexAry = #()
  datasize = readInvLong f
  for i = 1 to (datasize/4) do append IndexAry (1+(readlong f))
  return IndexAry
)

fn readOITL f = (
  IdxAry = #()
  Int3Ary = #()
  datasize = readInvLong f
  numdata = readlong f
  for i = 1 to numdata do (
   append IdxAry (1+(readshort f))
   f1 = 1 + (readlong f)
   f2 = 1 + (readlong f)
   f3 = 1 + (readlong f)
   append Int3Ary [f1,f2,f3]
  )
  return #(IdxAry,Int3Ary)
)

fn readITL f = (
  Int3Ary = #()
  datasize = readInvLong f
  numdata = readlong f
  for i = 1 to numdata do (
   f1 = 1 + (readlong f)
   f2 = 1 + (readlong f)
   f3 = 1 + (readlong f)
   append Int3Ary [f1,f2,f3]
  )
  return #(undefined,Int3Ary)
)

fn buildmesh VTary FCary NLary UVary PIDXary NIDXary = (
  for i = 1 to PIDXary.count do PIDXary[i] = VTary[(PIDXary[i])]
  for i = 1 to NIDXary.count do NIDXary[i] = NLary[(NIDXary[i])]
  if FCary[1] == undefined then  msh = mesh vertices:PIDXary faces:FCary[2]
  else msh = mesh vertices:PIDXary faces:FCary[2] materialIDs:FCary[1]
  msh.numTVerts = UVary.count
  buildTVFaces msh
  for j = 1 to UVary.count do setTVert  msh j UVary[j]
  for j = 1 to FCary[2].count do setTVFace msh j FCary[2][j]
  for j = 1 to NIDXary.count do setNormal msh j NIDXary[j]
  return msh
)
  ----------------------------------------------------------------------------
fn readDATA f numData sc = (
  datasize = readInvLong f
  if datasize < 8 then (
   fseek f datasize #seek_cur
   return undefined
  )
  VTary = #()
  NLary = #()
  UVary = #()
  sizeElement = datasize/numData
  --format "V:% @[%]\n" sizeElement (ftell f)
  for i = 1 to numData do (
   vx = (readfloat f)*sc;    vy = (readfloat f)*sc;    vz = (readfloat f)*sc
   nx = readfloat f;    ny = readfloat f;    nz = readfloat f
   --
   byteRead = 32
   case sizeElement of (
    36: ( readlong f ; byteRead = 36 )
    52: ( readlong f ; byteRead = 36 )
    56: ( fseek f 16 #seek_cur ; byteRead = 48 )
    default: byteRead = 32
   )
   vu = readfloat f;    vv = 1-(readfloat f)
   fseek f (sizeElement-byteRead) #seek_cur
   --
   append VTary [vx,-vz,vy]
   append NLary [nx,-nz,ny]
   append UVary [vu,vv,0]
  )
  return #(VTary,NLary,UVary)
)
fn readINDX f = (
  FCary = #()
  datasize = readInvLong f
  numIndex = readlong f
  sizeElement = datasize / numIndex
  for i = 1 to (numIndex/3) do (
   if sizeElement == 2 then (
    f1 = 1 + (readshort f #unsigned)
    f2 = 1 + (readshort f #unsigned)
    f3 = 1 + (readshort f #unsigned)
   ) else if sizeElement == 4 then (
    f1 = 1 + (readlong f #unsigned)
    f2 = 1 + (readlong f #unsigned)
    f3 = 1 + (readlong f #unsigned)
   ) else messagebox "error in face index"
   append FCary [f1,f2,f3]
  )
  return FCary
)
fn buildmesh2 VTary FCary NLary UVary = (
  msh = mesh vertices:VTary faces:FCary
  msh.numTVerts = UVary.count
  buildTVFaces msh
  for j = 1 to UVary.count do setTVert  msh j UVary[j]
  for j = 1 to FCary.count do setTVFace msh j FCary[j]
  for j = 1 to NLary.count do setNormal msh j NLary[j]
  return msh
)

--GUI--
spinner fscale "Scale : " fieldwidth:60 range:[0.001, 1000, 1]
button impMGN "Import   MGN / MSH" width:150 Height:25 align:#center
label lbl1 ""
label lbl2 "by Fatduck" align:#right

on impMGN pressed do (
  fname = getOpenFileName caption:"Select Star Wars Galaxies Model file" types:"MGN File (*.mgn)|*.mgn|MSH File (*.msh)|*.msh|All Files (*.*)|*.*|"
  if fname != undefined then (
   f = fopen fname "rb"
   fseek f 0 #seek_end
   ofsEOF = ftell f
   fseek f 0 #seek_set
   VTary = #()
   UVary = #()
   NLary = #()
   FCary = #()
   PIDXary = #()
   NIDXary = #()
   meshFlag = undefined
   infoFlag = undefined
   mshVert = 0
   do (
    header = readlong f
    case header of (
     0x58444E49:
       (
        FCary = readINDX f
        msh = buildmesh2 VTary FCary NLary UVary
       )
     0x41544144:
       (
        rslt = readDATA f mshVert fscale.value
        if rslt != undefined then (
         VTary = rslt[1]
         NLary = rslt[2]
         UVary = rslt[3]
        )
        infoFlag = false
       )
     0x4D524F46:
       (
        flg = readFORM f
        if flg == 0x474D4B53 then meshFlag = true --SKMG
        else if flg == 0x20544C42 then meshFlag = false --BLT
        if flg == 0x41585456 then infoFlag = true --VTXA
       )   
     0x4F464E49:
       (
        if infoFlag == true then (
         fseek f 8 #seek_cur
         mshVert = readlong f
        ) else fseek f (readInvLong f) #seek_cur
       ) 
     0x4E534F50:
       (
        if meshFlag == true then VTary = readPoint3 f fscale.value
        else readPoint3 f fscale.value
       )
     0x4D524F4E:
       (
        if meshFlag == true then NLary = readPoint3 f 1
        else readPoint3 f 1
       )
     0x58444950: PIDXary = readPIDX f
     0x5844494E: NIDXary = readNIDX f
     0x44534354: UVary = readTCSD f
     0x4C54494F:
       (
        FCary = readOITL f
        msh = buildmesh VTary FCary NLary UVary PIDXary NIDXary
       )
     0x204C5449:
       (
        FCary = readITL f
        msh = buildmesh VTary FCary NLary UVary PIDXary NIDXary
       )
     default:
       (
        datasize = readInvLong f
        fseek f datasize #seek_cur
       )
    )--end case
   ) while (ftell f) != ofsEOF
   fclose f
  )--end if fname
)--end on impMGN

)--end rollout SWG_roll

if Fatduck_SWG != undefined then closeRolloutFloater Fatduck_SWG
Fatduck_SWG = newRolloutFloater "Star Wars Galaxies" 200 175 10 70
addRollout SWG_roll Fatduck_SWG


PAL - palette

Palette File

PAL Editor can be downloaded here -> http://mods.mandalorians.de/system/infusions/pro_download_panel/download.php?did=16


File Type: PAL format


52 49 46 46  // RIFF

10 01 00 00  // size (int 32)

50 40 4c 20  // Pal

64 61 74 61  // Data

40 00 00 00  // size (int 32)

// Here starts the color pallate


00 03  // uint16 version

40 00  // uint16 pallette colors count(64)

// This is were the swg pallet editor start's showing were the colors are

cc cc cc 00   // uint32 (RGBA)

b7 b7 b7 00 //

a3 a3 a3 00  //

8e 8e 8e 00  //

92 23 23 00  //

84 1f 1f 00  //

77 1b 1b 00 //

69 17 17 00 //

65 61 82 00 //

54 50 85 00 //

44 3e 89 00 //

33 2d 8c 00  //

d4 d6 47 00 //

b8 ba 36 00  //

9d 9f 26 00  //

81 83 15 00  //

58 a5 64 00  //

45 91 51 00  //

31 7c 3d 00  //

df b4 3e 00 //

b9 94 2f 00  //

92 73 1f 00 //

6c 53 10 00  //

71 a5 a5 00  //

5b 95 95 00  //

44 86 86 00  //

2e 76 76 00  //

75 61 76 00  //

72 4d 78 00 //

6e 38 7b 00  //

6b 24 7d 00 //

7d b0 c0 00 //

69 95 a3 00 //

54 7b 87 00 //

40 60 6a 00 //

cd 7a 37 00  //

a9 64 2c 00 //

84 4d 21 00  //

60 37 16 00  //

d4 83 83 00 //

a5 5e 5e 00  //

87 42 42 00  //

5f 2d 2d 00  //

93 73 1b 00 //

7c 60 18 00  //

5a 45 0e 00  //

dd d8 c0 00 //

bd b9 a4 00  //

9e 9a 88 00  //

7e 7b 6c 00  //

91 6d 6d 00  //

76 59 59 00  //

5c 44 44 00 //

41 30 30 00  //

75 61 76 00  //

6b 4d 6c 00  //

60 39 62 00  //

56 25 58 00 //

a6 c1 71 00  //

8e a6 61 00  //

77 8a 50 00  //

5f 6f 40 00  //



PLN

Planet File

POB

46 4f 52 4d             // FORM
00 00 02 d3             // 723 Form Count
43 45 4c 4c 46 4f 52 4d // CELLFORM
00 00 02 c7             // 711 count to end of form
30 30 30 35 44 41 54 41 // 0005DATA
00 00 00 a9 
04 00 00 00 
00 
6d 61 69 6e 68 61 6e 67 61 72 // mainhangar
00
61 70 70 65 61 72 61 6e 63 65 2f 6d 65 73 68 2f  // appearance/mesh/
74 68 6d 5f 73 70 63 5f 73 74 61 72 5f 64 65 73  // thm_spc_star_des
74 72 6f 79 65 72 5f 73 30 31 5f 72 31 5f 6d 61  // troyer_s01_r1_ma
69 6e 68 61 6e 67 61 72 5f 6d 65 73 68 5f 72 31  // inhangar_mesh_r1
2e 6d 73 68                                      // .msh
00 01 
61 70 70 65 61 72 61 6e 63 65                    // appearance
2f 63 6f 6c 6c 69 73 69 6f 6e 2f 74 68 6d 5f 73  // /collision/thm_s
70 63 5f 73 74 61 72 5f 64 65 73 74 72 6f 79 65  // pc_star_destroye
72 5f 73 30 31 5f 72 31 5f 6d 61 69 6e 68 61 6e  // r_s01_r1_mainhan
67 61 72 5f 63 6f 6c 6c 69 73 69 6f 6e 5f 66 6c  // gar_collision_fl
6f 6f 72 30 2e 66 6c 72                          // oor0.flr
00 
46 4f 52 4d // FORM
00 00 00 04 
4e 55 4c 4c 46 4f 52 4d    // NULLFORM
00 00 00 
48 50 52 54 4c 30 30 30 34 // HPRTL0004
00 00 00 3c 
01 02 00 00 
00 01 0c 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
46 4f 52 4d // FROM
00 00 00 
48 50 52 54 4c 30 30 30 34 // HPRTL0004
00 00 00 3c 
01 03 00 00 
00 01 0a 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
46 4f 52 4d // FORM
00 00 00 
48 50 52 54 4c 30 30 30 34 // HPRTL0004
00 00 00 3c 
01 04 00 00 
00 01 09 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
46 4f 52 4d // FORM
00 00 00 
48 50 52 54 4c 30 30 30 34 // HPRTL0004
00 00 00 3c 
01 05 00 00 
00 01 02 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 00 00 
00 00 80 3f // 1
00 00 00 00 
4c 47 48 54               // LGHT
00 00 00 be  // 190
02 00 00 00 
01 00 00 00 
00 
01 45 b3 3f   // 1.40   R Lighting Color Like sun light but only shows on toon
0a d7 b3 3f   // 1.40   B Lighting Color
fe cf a5 3f   // 1.30   G Lighting Color
00 00 00 00 
01 45 b3 3f   // 1.40   R Lighting Color
0a d7 b3 3f   // 1.40   B Lighting Color
fe cf a5 3f   // 1.30   G Lighting Color
00 00 80 3f   // 1
00 00 00 00 
00 00 00 00 
00 00 00 80 
00 00 00 80 
00 f6 f3 be  // -0.48
11 12 61 3f  //  0.88
78 a0 51 43  //  209.63
00 00 00 00 
11 12 61 bf  //  0.88
00 f6 f3 be  // -0.48
67 08 a8 c2  // -84.02
00 00 80 3f  //  1
00 00 00 00 
00 00 00 00 
01 00 00 00 
00 
d5 3e 97 3f  // 1.18   R Lighting Color Like sun light but only shows on toon
9e fb ad 3f  // 1.36   B Lighting Color
0a d7 b3 3f  // 1.40   G Lighting Color
00 00 00 00 
d5 3e 97 3f  // 1.18   R Lighting Color
9e fb ad 3f  // 1.36   B Lighting Color
0a d7 b3 3f  // 1.40   G Lighting Color
00 00 80 3f  // 1
00 00 00 00 
00 00 00 00 
00 00 00 80 
00 00 00 00 
c2 19 f4 3e  // 0.48
60 08 61 3f  // 0.88
78 a0 51 43  // 209.63
00 00 00 00
60 08 61 bf  // -0.88
c2 19 f4 3e  //  0.48
67 43 a3 c2  // -81.63
00 00 80 3f  // 1
00 00 00 00 
00 00 00                         

PRT

Particle File

PSH

Pixel Shader? File

PST

Playback File

QST - QueST files

QueST files are XML files describing journal quests. Let's examine them here.

SAT

File Type: SAT format

'WSNP' FORM (ws file)

- FORM
- NODS
- size
- offset to stringtable

----------------------------------------------------

46 4F 52 4D     //FORM

00 00 04 E4     //formsize

53 4D 41 54     //SMAT

46 4F 52 4D     //FORM

00 00 04 D8     //formsize 
 
30 30 30 30     //0000

44 41 54 41     //DATA

00 00 00 34     //datasize

01 A7 15 00     //id

00 00 00 00     //parentid

70 00 00 00     //strtable index

00 00 00 00     //ox

D4 15 1E BE     //oY

00 00 00 00     //oz

51 EE 7C 3F     //ow

00 00 00 00     //scale??

38 CA A0 45     //x

00 00 AF 43     //y

EE DE B2 C4     //z


00 00 00 44     //type?

7B D6 12 E7     //?? 


SFK

SFK? File

SFP

This file contains the info on building Footprints the below breakdown is from shared_player_house_tatooine_small_style_01.sfp a Small Tatooine style 1 house. Still needs further breakdown!

46 4f 52 4d // FORM
00 00 00 48 
46 4f 4f 54 46 4f 52 4d // FOOTFORM
00 00 00 3c 
30 30 30 30 
49 4e 46 4f // INFO
00 00 00 18
03 00 00 00 
04 00 00 00 
01 00 00 00 
01 00 00 00
00 00 00 41 
00 00 00 41 
50 52 4e 54 // PRNT
00 00 00 10 
48 48 48 00 
46 46 46 00 
46 46 46 00 
46 46 46 00

SHT - shader

File Type: SHT format




SKT

Skeleton File

SND

File Type: SND format

46 4f 52 4d              // FORM (Element)

00 00 00 a7              // Length Of Data that Follows (Count starts after this byte) (a7 = 167)

53 44 32 44              // SD2D (Element)

30 30 30 33              // 0003 (Version ?)

00 00 00 9b              // string length

73 61 6d 70
6c 65 2f 61
6d 62 5f 63
6c 6f 6e 69
6e 67 5f 66
61 63 69 6c
69 74 79 5f
69 6e 74 5f
6c 70 2e 77
61 76 00 00              // sample/amb_cloning_facility_int_lp.wav

00 00 00 00              // ?
00 00 00 00
00 

C0                       // Bitrate (192)

3F                       // Volume ?

00 00 

C0                       // Bitrate (192) (Again?)

3F                       // Volume ?

FF FF FF FF
FF FF FF FF              // ?

00
00 00 00 00
00 00 00 00

00

C0                       // Bitrate (192) (Again?)

3F                       // Volume ?

00 00

C0                       // Bitrate (192) (Again?)

3F                       // Volume ?

00
00 00 00 00
00 00 00 00

00 00 00 00
00 00 00 01
00 00 00 01
00 00 00 00

00 00 00 00
00 00 00 00
00 80 3F 00
00 80 3F 00

00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00

00 00 00 00
00 00 00 02
00 00 00 CD
CC CC 3D



SPR

Sprite File

SSA

SSA? File

STF - Strings Table File (Language)

File Type: STF format

It contains all the game's strings. During network communications the strings are identificated with: filename without extension + code + ansi string id.

Header:
[int]      // STF file type header id (sequence: 0xCD 0xAB 0x00 0x00, value: 0x0000ABCD = 43981)
[byte]     // useless? flag (might be a boolean, seen so far: 0x01 and 0x00)
[int]      // next free index in file to add an item, always > items count (useless for us)
[int]      // items count

Then items list, for each:
[int]      // item index in the file (eg: 1, 2, 9, 3, 7, ...) 
[int]      // code (gesture?)
[int]      // unicode digits count of the sentence (eg: 11)
[u_string] // 2 bytes per char (eg: "hello world" is 11 digits long, 22 bytes total)

Then item's string ids, for each:
[int]      // item index in the file matching one in previous list (eg: 1, 2, 9, 3, 7, ...)
[int]      // ascii digits count of the string id (eg: 12)
[a_string] // 1 byte per char (eg: "basic_answer" is 12 digits long, 12 bytes total)

Understood at 80%.

SWH

File Type: SWHformat




TGA - Targa Texture

File Type: TGA format




Terrain files Are divided in 2 main sections. The terrain generator and the maps


TRN - Terrain File

Trn layers.jpg


File Type: TRN format





TRT - Texture Renderer File

File Type: TRT format




TRT - Texture Renderer File

File Type: TRT format




TXT - Text File

File Type: TXT format




UI - User Interface File

File Type: UI format




VSH - Vertex Shader Script

File Type: VSH format

(Shader City - Possible App to open the Vertex Shader Scripts)


WAV - WAV Audio File

File Type: WAV format




WS - world structures

File Type: WS format
'WSNP' FORM (ws file)

- FORM
- NODS
- size
- offset to stringtable

----------------------------------------------------

46 4F 52 4D     //FORM

00 00 04 E4     //formsize

4E 4F 44 45     //NODE

46 4F 52 4D     //FORM

00 00 04 D8     //formsize 
 
30 30 30 30     //0000

44 41 54 41     //DATA

00 00 00 34     //datasize

01 A7 15 00     //id

00 00 00 00     //parentid

70 00 00 00     //strtable index

00 00 00 00     //ox

D4 15 1E BE     //oY

00 00 00 00     //oz

51 EE 7C 3F     //ow

00 00 00 00     //scale??

38 CA A0 45     //x

00 00 AF 43     //y

EE DE B2 C4     //z


00 00 00 44     //type?

7B D6 12 E7     //?? 



World Structures

There is one .ws file per planet (none for space that I have found yet although it would seem applicable), containing a list of items found outdoors on each planets. This includes buildings, terminals, streetlights, fog/special effects, ruins, and so forth. Trees/plants/rocks are not included unless they are somehow unique or special.