Page 2 of 2

Posted: Thu May 26, 2005 1:20 am
by KorNet
Roller Coaster Tycoon 1 TD4 , TP4 file format
http://www.strategyplanet.com/rctuk/tid/TD4.html
http://www.strategyplanet.com/rctuk/tid/TP4.html

Roller Coaster Tycoon 2 TD6 file format
http://www.strategyplanet.com/rctuk/tid/TD6.html

Roller Coaster Tycoon 3 TPK file format
http://www.strategyplanet.com/rctuk/tid/TRK.html


:P

Posted: Thu May 26, 2005 1:25 am
by KorNet
Lord of the Ring: War of thr Ring H2O file format

This format was designed by Liquid Entertainment, hence the name H2O. The games
resources and settings are maintained in a relational database. And this format
is used for backing storage of BLOB's. Each table that contains a column marked
as BLOB has an H2O archive. Each row of the table matches an entry in the
archive, and since whole rows can be null (unused) in the tables so can entries
in an archive. These have their index_file and index_dir set to -1.

The format is composed of 6 areas:
* Header
* Entries
* File names
* Directory names
* Directory structure
* Data area

The format uses PKWARE's Data Compression Library, compressed data is prefixed
with the following structure:

uint32 size_compressed
uint32 size
uint32 checksum generated with CRC32

Mark Adler, author of zlib has written source to decompress DCL compressed
data and made it available for download at:
http://www.alumni.caltech.edu/~madler/blast10.tar.gz


Header
------

char[8] ident 'LIQDLH2O'
float version 6.0
char[] comment ends with 0x1A
uint32 version 6
uint32 num_entries
uint64 datasize_archived
uint64 datasize_raw


Entries
-------

An array of structures, as depicted below, that describes each entry

uint32 unknown 0 for uncompressed entries, varies for
compressed, reason unknown
int32 index_dir -1 if there there is no associated directory
int32 index_file -1 if the entry is unused
uint32 index_entry increases from zero
uint32 size
uint32 size_compressed same as size for uncompressed entries
uint64 offset offset in the file to where the raw or
compressed data is stored
uint32 checksum generated with CRC32
uint32 unknown always 1239288 or 1239252


File names
----------

This area is compressed, so it starts with the compressed data descriptor
descbribed above. The strings are in unicode. You'll have to search the
array looking for 0x0000 to find out where each string starts and ends.

uint32 numstrings
uint32 size size in bytes of the array and the two
uint32's numstrings and size
(array of strings)


Directory names
---------------

Stored in the same way as the file names.


Directory structure
-------------------

This is an array of int32's with one entry for each directory. The value of an
entry is the index into the same array of the parent directory, or -1 if it
has no parent directory.

uint32 numdirs
int32[numdirs] parentindex


Data Area
---------

Contains the actual content, the offset value of entries point into this area.
Compressed entries start with the structure described in the introduction.


Remarks
-------

The directory names are complete paths, i.e. textures/balrog/front.tga is
textures/balrog, not just balrog, so the directory structure area isnt really
needed.

Posted: Thu May 26, 2005 8:38 am
by Mr.Mouse
I have split the thread, as it should not be in the Game Request Rules thread.

Nice work though! How many websites did you have to visit to find all of these? :D

Thanks for all the information!

Posted: Thu May 26, 2005 3:46 pm
by KorNet
Yes has visited likely sites 100 :D

Re:

Posted: Mon Jan 17, 2022 6:53 pm
by AxelNoir
KorNet wrote: Thu May 26, 2005 12:38 am James Bond NightFire 007 (Delphi - Pascal code)

type N007Header = packed record
Magic: Integer; // Always 1 ?
Version: Integer; // 1 = Used in Nightfire Demo
// 3 = Used in Nightfire Retail
Magic2: Integer;
ID: array[0..3] of char;
NumRootDirs: Integer;
end;
// If version = 3 then following the header is an integer giving the number of entries
// Get32 filename
N007Entry = packed record
Compressed: byte;
Size: integer;
CompSize: integer;
end;
// If version = 1 then follows Size bytes of data (if Compressed = 0) or CompSize (if Compressed = 1)[/b]
For someone uneducated like me, what exactly is this? A script to unpack files or something?

Re: Kornet's Format Information

Posted: Tue Jan 18, 2022 12:19 am
by Dinoguy1000
Based on the description, it's Delphi Pascal code, though I couldn't tell you how to actually use it (presumably you'd have to use the Delphi interpreter, though after almost two decades, who knows if the code would be usable without updating it some).