*.CMP |
Files |
Fil_CMP.html |
nyc.cmp, sanb.cmp, miami.cmp - contains city map layout
gtadata\*.cmp
This file contains the layout of the city map. Since GTA is a 3D-game, the map consists of 256x256x6 cubes (see Coordinates). The cubes have textures from the style*.* files pasted on the sides and contain some game logic, too. Up to 6 cubes make up a stack. Stacks are then placed on the 256x256 map grid.
The first 28 bytes in the file contain 7 Integers (32-bit). I call them h0 through h6. They set the lengths of different parts of the file (see below) or something comletely different.
Example (nyc.cmp): 331, 1, 2423, 42210, 117694, 42544, 980.
|
Example: nyc.cmp |
|||
---|---|---|---|---|
Section |
Position |
Length |
Position |
Length |
0 |
28 |
0 |
28 |
|
28 |
262144 |
28 |
262144 |
|
262172 |
h4 |
262172 |
117694 |
|
??? 5318 8-byte(?) records |
262172+h4 |
h5 |
379866 |
42544 |
??? 3015 14-byte records |
262172+h4+h5 |
h3 |
422410 |
42210 |
|
464620 |
|
||
??? unidentified |
|
h0 |
|
331 |
??? unidentified |
|
h1 |
|
1 |
??? unidentified |
|
h2 |
|
2423 |
EOF-h6 |
h6 |
467151 |
980 |
|
File Size |
EOF |
0 |
468131 |
0 |
The Map Grid section contains 256x256 32-bit integers corresponding to map (x,y) locations.
(0,0)(1,0)(2,0)...(255,0)(0,1)(1,1)(2,1)... ...(253,255)(254,255)(255,255) The integers point to the Cube Stack Table. Usage: You can edit the map by copying entries from one spot to another; e.g. if you know the (x,y) coordinates of a building, you can copy its Map Grid entries to another location and find a copy of that building there. You should not change the Map Grid values randomly because then you may not be pointing to a valid Cube Stack Table Entry. |
Example 2154 is the most common entry in nyc.cmp; it appears in 7357 locations and stands for light water. 2148 and 2142 stand for medium and dark shaded water. Common sidewalk values are 2386, 2982 and 2370. More than half of the 10062 different values in nyc.cmp are used only once. |
A cube stack is a stack of up to 6 cubes that can be placed on the map by pointing to its entry from the map grid. A stack entry has 4 to 7 16-bit integers. The first one stands for a number of "nothing" cubes on the top of the stack, the others stand for the remaining cubes. Illustration: 0 z0 z1 z2 z3 z4 z5 1 z1 z2 z3 z4 z5 2 z2 z3 z4 z5 3 z3 z4 z5 4 z4 z5 5 z5 z0-z5 stand for cube integers; the cubes are placed in the stack at the corresponding z values (see Coordinates). A totally empty stack (single 6) has not been observed yet. Where the cube data is located is currently unknown; tell me if you find out! |
4 183 182 4 183 184 4 183 185 This means that the water stacks for dark(2142),medium (2148)
and light(2152) water each consist of two cubes topped with 4
cubes of nothing. The top cube in each is 183; it can be
surmised that this cube contains the logic for drowning while
182, 183 and 185 contain the water textures. You can view GIFs of the three cities' stack heights (3x10KB). |
I have no clue what is in this section, or if it even exists. Some must not exist, because when you add 28+262144+h0+...h6, (for nyc.cmp) you get 468355, yet the file is only 468131 bytes long.
This section contains the names and locations of the districts on the map. Each district has a 35-byte-record: byte 0 and 1: x and y coordinate of top left corner Unused records are all 0 and reside at the front of this section. The last record in this section (the last 35 bytes in the file!) holds information on the city area. |
Examples from nyc.cmp:
Kings is District number 13 and extends from (165,154) to (154,255). |
Information contributed by Ian Howson and Michael Mendelsohn.
Large parts of this file are still uncharted territory. The connection to style00x.gry is still missing.
*.CMP |
Last change: 5 Jan 1998 |
unofficial GTA Reference |