Sid Meier's Pirates

From NifTools
Jump to: navigation, search

Contents

Tools

  • FPKPacker for (un)packing Pirates!' fpkfiles.
  • DXTBmp for editing/converting DDS/BMP (sails, flags, etc.).

Tutorials

Feel free to add tutorials here.

FPK

FPK File Analysis

Sid Meier's Pirates! Analysis of Update1020.FPK

each numbered line represents 1 byte.

00 02 File header: first 4 bytes seem to be always the same
01 00
02 00
03 00
04 01 Number of Files in Archive: in this example only 1 file
05 00 --"--                       (equals number of header entries of course)
06 00 --"--
07 00 --"--


//    the following segment (08 - 2f) is repeated for each file in the archive
//    please note: the variable length of the filename changes of course each individual segments length!

08 14 Length of FileNAME (14h means 20 chars long filename in this case)
09 00 --"--
0a 00 --"--
0b 00 --"--
0c u  t Filename of first item in archive. the filename is 'encrypted'.
0d j  i 
0e u  t The 'encryption' is a joke. It just increases each byte by 01!
0f m  l
10 f  e (eg. 'e' is stored as 'f')
11 t  s
12 d  c
13 s  r
14 f  e
15 f  e
16 o  n
17 `  _
18 f  e
19 v  u
1a s  r
1b p  o
1c /  .
1d e  d
1e e  d
1f t  s
20 63 }\
21 99 } \ some checksum or filetype/datagroup designation?...
22 92 } /
23 ea }/
24 30 }\
25 6d } \ some checksum or filetype/datagroup designation?...
26 c5 } /
27 01 }/
28  80 Length of first file: 00080080
29  00
2a  08
2b  00
2c  30 Offset to start of first file
2d  00 in this case: 00000030
2e  00
2f  00

30     The actual (first) file!... in this case starts at 30h.


Format Specifications

uint32 {4}   - Header or Version
uint32 {4}   - Number Of Files in Archive

// for each file

uint32 {4}   - Filename Length
char {X}     - Filename (each char -= 1 to get real Filename)
uint32 {4}   - Checksum or filetype/datagroup designation? (1)
uint32 {4}   - Checksum or filetype/datagroup designation? (2)
uint32 {4}   - Length of file
uint32 {4}   - Offset to start of file

// actual File Data Area (continuous)
byte {X}     - File Data Area

Problems and Solutions

As long as we don't know how to calculate the 'checksum area' (the 8 bytes following the filename), we can only unpack the archive, but not create one that the game will accept to load from!
If somebody can figure out how to calculate the correct numbers or what they represent, please write it down here!
These bytes could of course also represent some kind of designation of the file, like "this is a DDS, belongs to category "sails". Who knows...
Maybe somebody can figure out those bytes by looking at the FPK files, or by running the game though a monitor program like softice to see what it does when it loads (eg. the title screen 'titlescreen_euro.dds' from Update1020.FPK).

Personal tools