Skip to the content.

Alamo Object Model File Format

Introduction

Alamo Object Files (extension: .ALO) in Petroglyph's games describe a 3D model. It is a collection of bones, meshes with effects, proxies and dazzles. Alamo Object Files are an instance of Chunked Files.

Note that .ALO files can also describe a particle, but here we describe the format when they contain a 3D model.

Conceptually, an Alamo model consists of:

Format

Each ALO model file contains several top-level chunks:

Skeleton

A skeleton is a top-level chunk (type 0x200) and contains:

Meshes

A mesh is a top-level chunk (type 0x400) and defines a named collection of sub-meshes that create a cohesive whole. Each mesh chunk contains:

Mesh Materials

The data in a mesh is stored as a collection of "sub-meshes", one per material. For each, two chunks are stored: the 'sub-mesh material' chunk (type 0x10100) and the 'sub-mesh data' chunk (type 0x10000).

Sub-mesh material

Sub-mesh material chunks (type 0x10100) are chunks that identify the material's shader file and its parameters to be used when rendering this mesh and its parameters.

Shader parameters have a name, type and data and should be used with the GetParameterByName and SetInt, SetFloat, SetFloatArray, SetTexture, etc. functions.

These chunks contain:

Sub-mesh data

Sub-mesh data chunks (type 0x10000) contain the core sub-mesh data: vertices, indices, animation mappings and collision tree. These chunks contain:

Lights

A light is a top-level chunk (type 0x1300) and contains:

Connections

The connections chunk is a top-level chunk (type 0x600) and defines which bones the meshes, lights and proxies are connected to. This chunk contains:

Mesh LODs and Alternatives

An Alamo object can contain the same mesh in different levels of details (LOD) or level-of-damage "alternatives" ("ALTs").

These are stored as separate meshes (0x400 chunks) with the same base name, but suffixed with "_LOD<n>" and/or "_ALT<n>". For instance, "Unit_LOD0" (low-poly version), "Unit_LOD1" (medium-poly version) and "Unit_LOD2" (high-poly version). Or "Building_LOD2_ALT0" (high-poly, healthy), "Building_LOD2_ALT1" (high-poly, damaged).

Meshes with higher LOD numbers are more detailed. Meshes with higher ALTs are more damaged. There can be any number of LODs and ALTs for a base mesh name. Care must be taken (for relevant applications) to only render one of the multiple meshes with the same base name, based on the current LOD and object health.

Proxy alternatives

Like meshes, proxy objects can also be defined for different ALTs. For instance, two proxies, named "p_explosion01_ALT1" and "p_explosion02_ALT2" can be defined to show "p_explosion01" when the object becomes lightly damaged and "p_explosion02" when the object becomes heavily damaged.

These proxy objects are shown when the object's ALT level (based on its health) becomes the ALT level specified in the name. For effects like explosions, this should be avoided when the object "heals" (i.e. going from ALT2 to ALT1). For these cases, proxy connections have their "Alt Decrease Stay Hidden" property set to true: in this case, those proxy objects are not shown if the ALT level decreases instead of increases.

Colorization

Objects can be colorized. This means that part of the object's texture are "colored" with the mesh's object's owning faction's color. This is how two identical objects owned by different factions can be told apart.

For meshes, depending on the game, there's several ways to do this:

Dazzles can also be colorized. This should be done if their name starts with "FC_". Colorization of dazzles happens in HSV space: the dazzle's color is converted to HSV and its hue is replaced with the colorization's hue. The result is then converted back to RGB for rendering.

Game support notes

Star Wars: Empire at War and its expansion, Forces of Corruption, do not understand dazzles.