External Links
GitHub organization
Engine source code
Website source code
Downloads
Engine
Required files
Linux x86 64-bit
Linux x86 32-bit
Windows x86
Xbox (NXDK)
Dedicated server
Required files
Linux x86 64-bit
Windows x86
Editor
Required files
Linux x86 64-bit
Windows x86
Tools
Platform agnostic
Linux x86 64-bit
Windows x86
Documentation
Editor PBASIC
The BASICs
Reference
Engine File formats
P3M
PAF
PKD
PMF
PMP/PMT
PTF
PTM
Other Pages
Online Demo
Propaganda
News
| Table of contents
- Current version is
0.0 - File extension is
.pmf - Data is little endian
- LZ4F is used for compression
Type | Value | Description |
---|
char[3] | {'P', 'M', 'F'} | Header magic | u8 | 0 | Major version | u64 | – | Creation time as a UTC Unix timestamp | char[1...] | {..., 0} | Name | char[1...] | {..., 0} | Description | char[1...] | {..., 0} | Authors | char[1...] | {..., 0} | Compiler info | u8 | 0..32 | Gamemode count | char[1..16] × “Gamemode count” | {..., 0} | Gamemode names |
DataType | Value | Description |
---|
u32 | – | String table size | char × “String table size” | – | String table | u32 | – | Embedded resource archive size | u8 × “Embedded resource archive size” | PAF archive | Embedded resources | u16 | – | Extension count | u32 × “Extension count” | – | Extension sizes | Extension × “Extension count” | – | Extensions | u8 | – | Level count | u32 × “Level count” | – | Level data sizes | Level data × “Level count” | – | Levels | u32 | – | Global entity count | Entity × “Global entity count” | – | Global entities |
Level dataType | Value | Description |
---|
u8 | Level flags | Flags | u32 | – | Size of compressed common data | u32 | – | Size of compressed client data | u32 | – | Size of compressed server data | u32 | – | Size of decompressed common data | u32 | – | Size of decompressed client data | u32 | – | Size of decompressed server data | u8 × “Size of decompressed common data” | Common level data | Common data | u8 × “Size of decompressed client data” | Client level data | Client data | u8 × “Size of decompressed server data” | Server level data | Server data | u8 | – | Sector size (2n) | u32 | Level sector count | Sector count | Sector index | – | Center sector | Level sector sizes × 1… | – | Sector data sizes (ordered by [Y][X][Z] ) | Level sector data × 1… | – | Sector data (ordered by [Y][X][Z] ) |
Level flagsBits (MSB to LSB) | Value | Description |
---|
7..3 | 0 | Reserved | 2 | – | Keep players’ velocity | 1 | – | Keep players’ sector offset | 0 | – | Keep players’ in-sector offset |
Level sector countBits (MSB to LSB) | Description |
---|
31..24 | Sector Y count minus 1 | 23..12 | Sector X count minus 1 | 11..0 | Sector Z count minus 1 |
Level sector sizesType | Description |
---|
u32 | Size of compressed common sector data | u32 | Size of compressed client sector data | u32 | Size of compressed server sector data | u32 | Size of decompressed common sector data | u32 | Size of decompressed client sector data | u32 | Size of decompressed server sector data |
Level sector data
Sector indexSector index bitsBits (MSB to LSB) | Description |
---|
31..24 | Y | 23..12 | X | 11..0 | Z |
Common level dataType | Description |
---|
u32 | String table size | char × “String table size” | String table | u16 | Material count | Material × “Material count” | Materials | u16 | Physics material count | Physics material × “Physics material count” | Physics materials | String | Air physics material | u8 | Weather environment count | Weather environment × “Weather environment count” | Weather environments | u8 | Gravity environment count | Gravity environment × “Gravity environment count” | Gravity environments | String | Default weather environment | String | Default gravity environment |
Client level dataServer level dataType | Description |
---|
u32 | String table size | char × “String table size” | String table | u32 | Level-wide entity count | Entity × “Level-wide entity count” | Level-wide entities |
Sound environmentType | Description |
---|
String | Name | float | Low pass filter amount | float | High pass filter amount | float | Reverb delay | float | Reverb feedback | float | Reverb mix | float | Reverb low pass filter amount | float | Reverb high pass filter ammount |
Weather environmentType | Description |
---|
String | Name | float[3] | XYZ wind direction and velocity | u32 | Wind direction random seed | float[3] | XYZ wind direction randomness | float | Wind direction noise speed | u32 | Wind velocity random seed | float | Wind velocity randomness | float | Wind velocity noise speed |
Sky environmentSky environment flagsBits (MSB to LSB) | Value | Description |
---|
7..1 | 0 | Reserved | 0 | – | 3D skybox |
Gravity environmentType | Description |
---|
String | Name | float[3] | XYZ gravity |
Common sector dataType | Value | Description |
---|
u32 | – | String table size | char × “String table size” | – | String table | u8 | – | Used material count | String × “Used material count” | – | Used material names | u8 | – | Used physics material count | String × “Used physics material count” | – | Used physics material names | u8 | – | Weather environment region count | Environment region × “Weather environment region count” | – | Weather environment regions | u8 | – | Gravity environment region count | Environment region × “Gravity environment region count” | – | Gravity environment regions | u8 | – | Dynamic light count | Dynamic light × “Dynamic light count” | – | Dynamic lights | u8 | – | Fast light count | Fast light × “Fast light count” | – | Fast lights | u32 | 1… | Cube count | Cube × “Cube count” | – | Cubes |
Client sector dataServer sector dataType | Description |
---|
u32 | String table size | char × “String table size” | String table | u8 | Load region count | Region × “Region count” | Load region data | Server-side cube × “Cube count” in respective Common sector data | Server-side cube data | u32 | Sector entity count | Entity × “Sector entity count” | Sector entities |
RegionType | Description |
---|
float[3] | (+X, +Y, +Z) corner | float[3] | (-X, -Y, -Z) corner | u32 | Other active sector count | Sector index × “Other active sector count” | Sector indices |
Environment regionType | Description |
---|
float[3] | (+X, +Y, +Z) corner | float[3] | (-X, +Y, +Z) corner | float[3] | (+X, +Y, -Z) corner | float[3] | (-X, +Y, -Z) corner | float[3] | (+X, -Y, +Z) corner | float[3] | (-X, -Y, +Z) corner | float[3] | (+X, -Y, -Z) corner | float[3] | (-X, -Y, -Z) corner | String | Environment name |
MaterialMaterial flagsBits (MSB to LSB) | Value | Description |
---|
7..2 | 0 | Reserved | 1 | – | Is liquid | 0 | – | Is transparent |
Material render modeName | Value |
---|
ENTMAT_RENDMODE_NORMAL | 0 | ENTMAT_RENDMODE_ADD | 1 |
Client-side materialType | Description |
---|
String | Texture (untextured if empty) | u8 | Extra texture count | String × “Extra texture count” | Extra textures | u32 | Texture advance time in microseconds | float[2] | Texture UV scroll | u8[3] | RGB color | u8 | Alpha (ignored unless ‘Is transparent’ flag is set) | u8[3] | RGB emission | u8 | Shading | Client-side material wave info | Wave info (ignored unless ‘Is liquid’ flag is set) |
Client-side material wave infoType | Description |
---|
float[3] | XYZ velocity | float | Wind influence | float | Offset | float | Scale |
Physics materialType | Value | Description |
---|
String | – | Name | u8 | Physics material flags | Flags | float | – | Friction (if ‘not solid’ flag is not set) or max speed (if ‘not solid’ flag is set) | float | – | Traction (ignored if ‘not solid’ flag is set) | float | – | Bounce (ignored if ‘not solid’ flag is set) | float | – | Minimum speed to cause damage | float | – | Base damage | float | – | Extra damage per meter per second |
Physics material flagsBits (MSB to LSB) | Value | Description |
---|
7..1 | 0 | Reserved | 0 | – | Not solid |
LightmapType | Description |
---|
u8 | Size (2n) | u8[3] × 2“Size” | RGB luxels |
VertexType | Description |
---|
float[3] | XYZ | float[2] | Texture UV | float[2] | Lightmap UV |
Dynamic lightDynamic light flagsBits (MSB to LSB) | Value | Description |
---|
7..2 | 0 | Reserved | 1 | – | Preserve | 0 | – | Enable |
Client-side dynamic lightClient-side dynamic light lightmap layerType | Description |
---|
u8 | Target lightmap | u8[3] × 2“Size” in respective Lightmap | RGB luxels |
Fast lightFast light flagsBits (MSB to LSB) | Value | Description |
---|
7..2 | 0 | Reserved | 1 | – | Preserve | 0 | – | Enable |
Client-side fast lightClient-side fast light vertex rangeType | Description |
---|
u32 | Vertices to skip | u32 | Multiplier count | u8 × “Multiplier count” | Multipliers |
CubeCube flags and typeBits (MSB to LSB) | Value | Description |
---|
7 | 0 | Reserved | 6 | – | Has pathfinding data | 5 | – | Has lighting data | 4 | – | Has chunk data | 3 | – | Is extended client-side | 2 | – | Is extended | 1..0 | Cube type | Type |
Cube typeName | Value |
---|
PMF_CUBE_EMPTY | 0 | PMF_CUBE_PARENT | 1 | PMF_CUBE_GEOMETRY | 2 | PMF_CUBE_EXTGEOMETRY | 3 |
Client-side cubeServer-side cubeType | Description |
---|
Cube pathfinding data × 0..1 | Pathfinding data (only present if ‘has pathfinding data’ flag is set) |
Parent cube dataType | Value | Description |
---|
u8 | Parent cube flags | Flags | u32 × 0..1 | – | (+X, +Y, +Z) child index (only present if ‘has (+X, +Y, +Z) child’ flag is set) | u32 × 0..1 | – | (-X, +Y, +Z) child index (only present if ‘has (-X, +Y, +Z) child’ flag is set) | u32 × 0..1 | – | (+X, +Y, -Z) child index (only present if ‘has (+X, +Y, -Z) child’ flag is set) | u32 × 0..1 | – | (-X, +Y, -Z) child index (only present if ‘has (-X, +Y, -Z) child’ flag is set) | u32 × 0..1 | – | (+X, -Y, +Z) child index (only present if ‘has (+X, -Y, +Z) child’ flag is set) | u32 × 0..1 | – | (-X, -Y, +Z) child index (only present if ‘has (-X, -Y, +Z) child’ flag is set) | u32 × 0..1 | – | (+X, -Y, -Z) child index (only present if ‘has (+X, -Y, -Z) child’ flag is set) | u32 × 0..1 | – | (-X, -Y, -Z) child index (only present if ‘has (-X, -Y, -Z) child’ flag is set) |
Parent cube flagsBits (MSB to LSB) | Description |
---|
7 | Has (-X, -Y, -Z) child | 6 | Has (+X, -Y, -Z) child | 5 | Has (-X, -Y, +Z) child | 4 | Has (+X, -Y, +Z) child | 3 | Has (-X, +Y, -Z) child | 2 | Has (+X, +Y, -Z) child | 1 | Has (-X, +Y, +Z) child | 0 | Has (+X, +Y, +Z) child |
Geometry cube dataType | Description |
---|
u8 | Material | u8 | Physics material |
Client-side geometry cube dataClient-side geometry cube face bitsBits (MSB to LSB) | Value | Description |
---|
7..6 | 0 | Reserved | 5 | – | -Z has face | 4 | – | -Y has face | 3 | – | -X has face | 2 | – | +Z has face | 1 | – | +Y has face | 0 | – | +X has face |
Extended geometry cube dataType | Value | Description |
---|
u8 | – | +X material | u8 | – | +Y material | u8 | – | +Z material | u8 | – | -X material | u8 | – | -Y material | u8 | – | -Z material | u8 | – | +X physics material | u8 | – | +Y physics material | u8 | – | +Z physics material | u8 | – | -X physics material | u8 | – | -Y physics material | u8 | – | -Z physics material | u8 | Extended geometry cube point bits | ‘Point moved’ bits | float[3] × 0..1 | – | (+X, +Y, +Z) XYZ (only present if ‘(+X, +Y, +Z) point moved’ flag is set) | float[3] × 0..1 | – | (-X, +Y, +Z) XYZ (only present if ‘(-X, +Y, +Z) point moved’ flag is set) | float[3] × 0..1 | – | (+X, +Y, -Z) XYZ (only present if ‘(+X, +Y, -Z) point moved’ flag is set) | float[3] × 0..1 | – | (-X, +Y, -Z) XYZ (only present if ‘(-X, +Y, -Z) point moved’ flag is set) | float[3] × 0..1 | – | (+X, -Y, +Z) XYZ (only present if ‘(+X, -Y, +Z) point moved’ flag is set) | float[3] × 0..1 | – | (-X, -Y, +Z) XYZ (only present if ‘(-X, -Y, +Z) point moved’ flag is set) | float[3] × 0..1 | – | (+X, -Y, -Z) XYZ (only present if ‘(+X, -Y, -Z) point moved’ flag is set) | float[3] × 0..1 | – | (-X, -Y, -Z) XYZ (only present if ‘(-X, -Y, -Z) point moved’ flag is set) |
Extended geometry cube point bitsBits (MSB to LSB) | Description |
---|
7 | (-X, -Y, -Z) point moved | 6 | (+X, -Y, -Z) point moved | 5 | (-X, -Y, +Z) point moved | 4 | (+X, -Y, +Z) point moved | 3 | (-X, +Y, -Z) point moved | 2 | (+X, +Y, -Z) point moved | 1 | (-X, +Y, +Z) point moved | 0 | (+X, +Y, +Z) point moved |
Client-side extended geometry cube dataType | Description |
---|
u8 | +X lightmap | u8 | +Y lightmap | u8 | +Z lightmap | u8 | -X lightmap | u8 | -Y lightmap | u8 | -Z lightmap | u8 | +X triangle count | u8 | +Y triangle count | u8 | +Z triangle count | u8 | -X triangle count | u8 | -Y triangle count | u8 | -Z triangle count | u32 | Index of first triangle’s first vertex |
Cube chunk dataType | Description |
---|
u32 | Other visible cube count | u32 × “Other visible cube count” | Visible cube indices | u32 | Other visible sector count | Cube chunk data visibility data × “Other visible sector count” | Cube chunk data visibility data |
Cube chunk data visibility dataType | Description |
---|
Sector index | Sector | u32 | Visible cube count (0 means all) | u32 × “Visible cube count” | Cube indices |
Cube lighting dataCube lighting data light referenceType | Description |
---|
u8 | Index | u8 | Amount |
Cube pathfinding dataCube pathfinding data attributeType | Description |
---|
String | Name | float[3] | XYZ direction to face |
StringType | Description |
---|
u32 | Offset in respective string table |
| | |
|