Difference between revisions of "Format Reference"

From Mm2kiwi
Jump to: navigation, search
(Cities: Added CPVS section)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
File formats used by MM2 are described under this section.
 
File formats used by MM2 are described under this section.
 +
 +
==Common formats==
 +
Several file formats are used for many things. For example, the [[PKG]] format is used for vehicle models, props, monuments, facades and even the hud map. This section describes several of these common formats.
 +
 +
===3D Object models (PKG)===
 +
The geometry of small 3D objects are defined by PKG files. These files are divided into several sections, or chunks.
 +
 +
The PKG-files define the objects using triangle or quad facets, each facet is grouped into a facet group that is assigned a shader. The shader defines colour attributes and, if needed, a texture map name.
 +
[[PKG|More...]]
 +
 +
===Texture maps (TEX)===
 +
Texture mapping is the most commonly used method to apply colour to an MM2 city and the objects within it. It has been shown that MM2 can use some variants of the Targa (TGA) file format. Because this format is a public one, it has been the preferred texture format for new cars and cities.
 +
 +
Still, most original textures are encoded in a custom file format, known as TEX. This file format has many features, but the most significant one is the possibility to store mip-maps for the texture. Mip-maps are scaled copies of the original texture map. When surfaces are distant, a smaller scale is used and the surface looks less cluttered.
 +
[[TEX|More...]]
  
 
==Cities==
 
==Cities==
===PSDL===
+
===Terrain (PSDL)===
Each city has one PSDL-file. This file defines roads, ground surface and buildings. In addition, the PSDL-file also provides an easy way to automatically place props along roads etc. This is particularly good for placing street lights, parking meters and similar objects.
+
Each city has one PSDL file. This file defines roads, ground surface and buildings. In addition, the PSDL file also provides an easy way to automatically place props along roads etc. This is particularly good for placing street lights, parking meters and similar objects.
  
 
The geometry of a city is divided into blocks. A block is a small section of the city, similar to the regular definition of a city block. One difference, though, is that roads and intersections are also placed in their own blocks.
 
The geometry of a city is divided into blocks. A block is a small section of the city, similar to the regular definition of a city block. One difference, though, is that roads and intersections are also placed in their own blocks.
Line 9: Line 24:
 
The block structure is used for all kinds of things in the game. Most obvious are visible surface identification, collision detection, ambient "intelligence", etc. All of these are calculated with respect of the block structure.
 
The block structure is used for all kinds of things in the game. Most obvious are visible surface identification, collision detection, ambient "intelligence", etc. All of these are calculated with respect of the block structure.
 
[[PSDL|More...]]
 
[[PSDL|More...]]
 +
 +
===Block culling, performance (CPVS)===
 +
Each city may also have a CPVS file, this file informs MM2 of which blocks might be visible from every other block.
 +
[[CPVS|More...]]
 +
 +
===Monuments (INST)===
 +
Each city can have one INST file, the INST file describes where to place monuments and other objects modeled in a [[PKG]] model file. Each placement allows a selection of paint job, scale and orientation as well as location of a PKG.
 +
[[INST|More...]]
 +
 +
===Ambient paths (BAI)===
 +
Each city can have one BAI file to define paths for controlling ambients such as pedestrians and automated traffic.
 +
[[BAI|More...]]
 +
 +
===Props (Pathset)===
 +
A city can have any number of pathset files. These place series of props or decals around a city. A prop is a [[PKG]] object that usually can be knocked down or even broken, such as small trees, cones, park benches, et.c.
 +
[[Pathset|More...]]
 +
 +
===Audio===
 +
Each city has ambient sound sources placed all around. The files controlling this are mostly unexplored.
 +
[[City audio|More...]]
 +
 +
===Hud map===
 +
Each city can have one special [[PKG]] containing a map of the city, this PKG will be shown when the player turns on his hud map.
 +
[[Hud map|More...]]
 +
 +
==Vehicles==
 +
The vehicles in MM2 are [[PKG]] objects with some specifics.
 +
 +
===Player vehicles===
 +
[[Player vehicles|More...]]
 +
 +
===Ambient vehicles===
 +
[[Ambient vehicles|More...]]
 +
 +
==Pedestrians==
 +
The file formats for pedestrians are mostly ASCII based, this implies that Angel Studios were rushed when completing the game - there was no time to create a binary, more efficient format for the information.
 +
 +
===Pedestrian skeleton (.skel)===
 +
All the parts of a pedestrian model are bound to a skeleton. A skeleton is constructed by a number of bones that are attached with joints. In MM2 the skeletons are defined using a tree structure.
 +
[[Pedestrian skeleton|More...]]
 +
 +
===Model (.mod)===
 +
The pedmodel_*.mod files define the actual 3D model of a pedestrian. It defines vertices, some material attributes and the surfaces of the model.
 +
[[Pedestrian model|More...]]
 +
 +
===Pedestrian shaders (.shaders)===
 +
The shaders are defined in exactly the same way as for PKG objects. The pedmodel_*.shaders files follow the specification of the PKGFileData in the PKG file format.
 +
[[PKG#Shaders|More...]]
 +
 +
===Pedestrian remap (.remap)===
 +
[[Pedestrian remap|More...]]
 +
 +
===Pedestrian rays (.rays)===
 +
[[Pedestrian rays|More...]]
 +
 +
===Pedestrian state models (.csv)===
 +
The animation of a pedestrian is based on a state model. A pedestrian is always in a specific state and each state is connected to an animation sequence. For example, if the pedestrian is in the state "WALK", the animation named pedanim_womwalk.anim is looping over and over again. When something happens, the pedestrian might make a transition from one state to another.
 +
[[Pedestrian state models|More...]]
 +
 +
===Pedestrian animations (.anim)===
 +
Each animation sequence, associated with a state, is made up by a number of key frames. Each key frame has several parameters that should be applied to each bone in the skeleton. By moving the skeleton, the entire model will move.
 +
[[Pedestrian animations|More...]]

Latest revision as of 12:05, 26 May 2006

File formats used by MM2 are described under this section.

Common formats

Several file formats are used for many things. For example, the PKG format is used for vehicle models, props, monuments, facades and even the hud map. This section describes several of these common formats.

3D Object models (PKG)

The geometry of small 3D objects are defined by PKG files. These files are divided into several sections, or chunks.

The PKG-files define the objects using triangle or quad facets, each facet is grouped into a facet group that is assigned a shader. The shader defines colour attributes and, if needed, a texture map name. More...

Texture maps (TEX)

Texture mapping is the most commonly used method to apply colour to an MM2 city and the objects within it. It has been shown that MM2 can use some variants of the Targa (TGA) file format. Because this format is a public one, it has been the preferred texture format for new cars and cities.

Still, most original textures are encoded in a custom file format, known as TEX. This file format has many features, but the most significant one is the possibility to store mip-maps for the texture. Mip-maps are scaled copies of the original texture map. When surfaces are distant, a smaller scale is used and the surface looks less cluttered. More...

Cities

Terrain (PSDL)

Each city has one PSDL file. This file defines roads, ground surface and buildings. In addition, the PSDL file also provides an easy way to automatically place props along roads etc. This is particularly good for placing street lights, parking meters and similar objects.

The geometry of a city is divided into blocks. A block is a small section of the city, similar to the regular definition of a city block. One difference, though, is that roads and intersections are also placed in their own blocks.

The block structure is used for all kinds of things in the game. Most obvious are visible surface identification, collision detection, ambient "intelligence", etc. All of these are calculated with respect of the block structure. More...

Block culling, performance (CPVS)

Each city may also have a CPVS file, this file informs MM2 of which blocks might be visible from every other block. More...

Monuments (INST)

Each city can have one INST file, the INST file describes where to place monuments and other objects modeled in a PKG model file. Each placement allows a selection of paint job, scale and orientation as well as location of a PKG. More...

Ambient paths (BAI)

Each city can have one BAI file to define paths for controlling ambients such as pedestrians and automated traffic. More...

Props (Pathset)

A city can have any number of pathset files. These place series of props or decals around a city. A prop is a PKG object that usually can be knocked down or even broken, such as small trees, cones, park benches, et.c. More...

Audio

Each city has ambient sound sources placed all around. The files controlling this are mostly unexplored. More...

Hud map

Each city can have one special PKG containing a map of the city, this PKG will be shown when the player turns on his hud map. More...

Vehicles

The vehicles in MM2 are PKG objects with some specifics.

Player vehicles

More...

Ambient vehicles

More...

Pedestrians

The file formats for pedestrians are mostly ASCII based, this implies that Angel Studios were rushed when completing the game - there was no time to create a binary, more efficient format for the information.

Pedestrian skeleton (.skel)

All the parts of a pedestrian model are bound to a skeleton. A skeleton is constructed by a number of bones that are attached with joints. In MM2 the skeletons are defined using a tree structure. More...

Model (.mod)

The pedmodel_*.mod files define the actual 3D model of a pedestrian. It defines vertices, some material attributes and the surfaces of the model. More...

Pedestrian shaders (.shaders)

The shaders are defined in exactly the same way as for PKG objects. The pedmodel_*.shaders files follow the specification of the PKGFileData in the PKG file format. More...

Pedestrian remap (.remap)

More...

Pedestrian rays (.rays)

More...

Pedestrian state models (.csv)

The animation of a pedestrian is based on a state model. A pedestrian is always in a specific state and each state is connected to an animation sequence. For example, if the pedestrian is in the state "WALK", the animation named pedanim_womwalk.anim is looping over and over again. When something happens, the pedestrian might make a transition from one state to another. More...

Pedestrian animations (.anim)

Each animation sequence, associated with a state, is made up by a number of key frames. Each key frame has several parameters that should be applied to each bone in the skeleton. By moving the skeleton, the entire model will move. More...