APM

The  APocalypse Model (APM) file format is used by Apocalypse to store models since pre-alpha version 0.3, replacing the Wavefront OBJ file format used in 0.1 and 0.2. There were many reasons for making this new format, such as standardization of geometry, space for future updates, and integration of model data, textures and maps into a single file. The Wavefront format was also lacking support for important features such as bone animation, which Apocalypse will implement.

APM Header
The very beginning of any APM file is the APM Header, which is a structure storing information about how to read the rest of the file. Its format is as follows:

Object Definitions
The object definition table is located at the offset specified the APM Header. All entries may be a different size, and they begin with the object name, plus the NUL byte. This is followed by the object definition header which is structured as follows:

This is followed by a packed array of vertex structures, whose size is specified by the APM header.

Textures
Textures are stored in the texture table, which is a list of entries whose number and offset in the file is specified by the APM Header. Each entry in this table is prefixed with a Texture Header:

The texture flags must all be clear except the following defined flags:

The Texture Header is followed by a 2D arrays of pixels defining the texture. The pixels are ordered left-to-right, bottom-to-top, and each is 4 bytes representing RGBA.