Talk:Project Gotham Racing 2
Reverse engineering notes for file formats
--Zaykho (talk) 10:34, 22 September 2017 (PDT)
Project Gotham Racing 2 use a .PAK container for storing 3D elements, textures and 3D configurations files.
Multiple types of .PAK name can be seen in PGR2, their names are related to their functions and indicate what type of elements are stored:
.PAK for objects ( Cache\Objects & Cache\Cars )
.pak
.PAK for cars ( Cache\Cars )
.pak_cth
.pak_hrd
.pak_opn ( only for roadster : open mode)
.pak_sft ( only for roadster : closed mode for rain)
.PAK for maps ( Game\Areas )
.pak_common
.pak_day
.pak_night
.pak_overcast
.pak_stream
To extract those .PAK files, a tool called quickbms and a PGR2 bms script ( both made by Luigi Auriemma ) can be used to get most of the contents stored in the archive.
When extracted, the content stored in the archive is sliced in sections, creating a folder for each of them and joining a file with the actual contents in it, mostly with a .dat suffix.
Here an example for objects:
.PAK for objects : red_cone.pak
WMSH \ 00000000.dat
MAT \ 00000001.dat
GPUD \ 00000002.dat
TEXT \ 00000003.nfc
VB \ 00000004.dat
END ( nothing, no folder, no files )
WMSH or sometime MESH
The 00000000.dat file contain the faces indices, and supposedly, the strip and the how the vertices are read ( float, word ? ).
MAT
The 00000001.dat file contain the material properties : diffuse, specular, ambient etc... of each material applied to the 3D file.
GPUD
The 00000002.dat file contain all the textures, each of them followed by a small part of data ( texture configuration ? mimaps ? ). Finally, after all the textures, the vertices and UV position are stored in one chunk of data.
TEXT
The 00000003.dat file contain all the text and name related to the texture, it also indicate where each textures are located inside GPUD.