Talk:Project Gotham Racing 2

From xboxdevwiki
Revision as of 18:08, 22 September 2017 by Zaykho (talk | contribs) (Reverse engineering notes for file formats)
Jump to: navigation, search

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 object : 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 ? mipmaps ? ). 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.


VB


The 00000004.dat file contain the start address offset of the vertices and UV section in GPUD. If the 3D mesh have multiples groups/sections, the VB file will store each address.