MCM1 National Track File Formats

Version 1.0 (Beta) - 7/9/26

This document describes National-style track-side files used by Motocross Madness 1:

These National formats are different from the Supercross / TrackEdit formats described in docs/MCM1_TRACK_FILE_FORMATS.md. In particular, National .dat files are spline paths, while Supercross .dat files are fixed 16 x 16 per-cell navigation fields.

The formats below are intended for programmers implementing readers, writers, validators, or conversion tools.

Other links:

Format Map

Use these links to jump directly to the file format you need:

FormatRoleExample file
.ascHeight mesh sourcetracks/national_test.asc
.datNational track-path splinetracks/national_test.dat
.scnGame scene descriptor and lightingtracks/national_test.scn
.terMakeTerr terrain compile inputtracks/national_test.ter
.trnCompiled National terraintracks/national_test.trn

General Rules

All binary integer and floating-point fields described here are little-endian.

The .scn and .ter files are INI-like text:

The .asc file is a text mesh export. Height readers normally need only the vertex lines, while exporters commonly write both vertex and face lists.

The .dat and .trn files are binary.

Coordinate Systems

The National world is a 5 x 5 terrain centered in Direct3D space. The following constants are used by common National tooling:

WO is the Direct3D world-center offset for National tracks:

Authoring tools often store path points in scene coordinates as x and z. National .dat and .scn files use MCM / Direct3D coordinates.

Editor path point to .dat Direct3D coordinate:

Inverse conversion used by the .dat importer:

For .scn sun lights, 3ds Max-style sun coordinates can be used as an intermediate:

Then it writes the Direct3D light position as:

A reader can use DefaultStartPosition as the source for WO when it is present, then apply the inverse:


.ASC Format - National Height Mesh Source

FORMAT BANNER: .ASC

3ds Max / Charityware Grid mesh export used as the National terrain height source. Example: tracks/national_test.asc.

National authoring workflows use .asc files as real-height terrain sources. A square grid can be imported from an existing .asc, edited, and exported as an .asc that MakeTerr can consume through a .ter file.

Readers should expect a text mesh with a vertex list. Exporters commonly write both a vertex list and a face list.

Generated Structure

The blank first line appears in common generated files.

Grid Size

N is the terrain source resolution. National .trn compilers ultimately use a 257 x 257 center height grid.

ASC readers should accept any square grid with at least 4 vertices:

Vertex Coordinates

The writer emits vertices in row-major order:

Vertex index:

Readers can identify vertex lines with this pattern:

Only the numeric X, Y, and Z values are used. The vertex number is not used to reorder vertices; order in the file is the source of truth.

Height Export

For a raster-derived heightmap, an exporter can convert authoring units back to ASC / Max units with:

For an imported .asc, an exporter can preserve imported scale metadata:

Some importers set ascEdge = 0, keeping imported heights exactly apart from uniform scale into authoring units.

Row Orientation

The .asc file lists rows from Y = -128 to Y = 128. Authoring tools may flip rows north/south into their internal height arrays:

On export, the row order should be flipped back consistently if the internal height array uses the opposite north/south orientation.

Import Scale

When importing, a reader can compute one uniform scale from the X span:

That same scale is applied to X/Y/Z semantics by storing:

Importers may retain X/Y bounds as metadata. Common exporters emit the standard -128..128 grid.

Face List

ASC exporters commonly emit two triangles for each grid cell:

Terrain importers may ignore the face list and reconstruct terrain from the ordered vertex grid only.

.ASC Reader Behavior

A typical .asc terrain reader:


.TER Format - National MakeTerr Input

FORMAT BANNER: .TER

National MakeTerr terrain compile input. Example: tracks/national_test.ter.

The .ter file tells National MakeTerr how to assemble ASC height sources and TGA texture maps into a compiled .trn.

The National 5 x 5 template writes:

Header Keys

GridResolutionInFeet

Often 3.0. Other values are valid. For example, 4.0 makes a 256 x 256 center section cover 1024 ft x 1024 ft instead of 768 ft x 768 ft.

Compiled National .trn files store the corresponding scale as:

This value controls horizontal terrain scale. It does not change the vertical Tga2Asc.exe maxheight value.

TerrainType

Use NATIONAL for National tracks. STUNTQUARRY and BAJA are separate terrain types and use different world layouts.

TotalElevationFiles

Usually 73 for National 5 x 5 terrain.

TotalTextureMapFiles

Usually 2:

TotalTexturePlacements

Usually 1 for National 5 x 5 terrain. Only the main 1016 x 1016 texture is placed explicitly; the perimeter tile is referenced as a texture map file for MakeTerr's edge handling.

TotalTargetWidth, TotalTargetBreadth

Usually 1280 and 1280. This is the 5 x 5 National target measured in terrain grid units:

ElevationAtEdge

Elevation value at the terrain edge. Some exporters use the mean elevation around the current terrain edge; others use a manual National edge elevation value.

ElevationPath, TextureMapPath

Often local folder paths:

Terrain Palette

The embedded template includes historical absolute paths, but buildTerFile strips those down to local file names:

Some exporters normalize texture names to lowercase texturea.tga, texture.tga, tilea.tga, and tile.tga.

Texture Map Files

TextureMapFile_1 is the main exported terrain texture. The export bundle also includes texturea.tga, the smaller palette source named by [TerrainPalette].

TextureMapFile_2 is the National perimeter tile. The export bundle also includes tilea.tga, the smaller palette source named by [TerrainPalette].

Texture Placement

The National 5 x 5 template contains one texture placement:

This places the main terrain texture over the center 256 x 256 grid area of the 1280 x 1280 target.

Elevation File Layout

The National template contains 73 elevation sections:

All elevation sections use INI keys:

Outer Surround Sections

The outer surround references stock quarry ASC files that must be available next to the .ter when using external MakeTerr:

Most outer sections are 128 x 128:

Side transition strips include ForceEdges:

Center Terrain Sections

The 3 x 3 center terrain sections reference the exported terrain ASC. Template files often use grid.asc as a placeholder, which should be replaced with:

The center sections are:

Each center section is 256 x 256 and uses ForceEdges=NSEW:

ElevationFile_69 is the actual center 1 x 1 chunk where the track resides. Its VerticalMultiplier remains 1.0.

The surrounding eight center references reuse the same ASC with different VerticalMultiplier values from the template. These provide blended terrain around the playable center:

Base Elevation Patching

An exporter may compute an ASC edge base:

If no separate edge metadata is available, this is commonly 0.00000.

For National 5 x 5 .ter output, replace the template center base value:

This changes the nine center ASC references while leaving the stock outer quarry/surround base values intact.

Base, Tga2Asc maxheight, and Editable TGA Gray

Tga2Asc.exe converts a grayscale TGA to ASC heights using a maxheight argument. From the FireRoad sample:

The sample FireRoadNatDispMap257g.tga and .asc were created with:

MakeTerr then compiles ASC heights into TRN raw heights using the center section Base value:

The original TGA's darkest usable gray is not stored directly in the .trn. Many combinations of TGA gray range, Tga2Asc.exe maxheight, and .ter Base can compile to the same raw TRN heights.

For extraction tools, a practical workflow is to choose an editable darkest gray target, commonly around 50..58, then solve for a matching Base and maxheight. Using a target gray of 55 on FireRoad gives:

This is close to FireRoad's known center Base=5.41 and keeps the extracted TGA out of the too-dark-to-edit range.

.TER Reader Behavior

.ter readers should treat the file as MakeTerr source data: parse the [ElevationData] header, terrain palette, texture map files, texture placements, and elevation file sections. A .ter alone is not enough to reconstruct all game-side data; referenced ASC and TGA assets are required.


.SCN Format

FORMAT BANNER: .SCN

National scene descriptor that tells MCM1 which compiled terrain file to load and configures the lighting, sky cube, and start gate scale. Example: tracks/national_test.scn.

The .scn file is INI-like text. National scene files normally use a fuller scene descriptor than the minimal Supercross form.

Generated Structure

Keys

SceneName

Human-readable track name. Exporters commonly use either the authoring UI track name or the sanitized file base name.

DefaultStartPosition

Direct3D world start position. For National tracks the generated value is:

Readers can use the first component as the world-center offset when converting imported light positions back to authoring controls.

DefaultStartDirection

Generated as:

TerrainFile

Compiled terrain file loaded by the game:

CubeFile

Sky / horizon cube. Readers can normalize this value to a known sky-cube list when a case-insensitive match exists. Otherwise, keep the imported string.

ParticleTextureMapName

Generated as:

StartGateScale

Floating-point start gate scale.

Light1

Ambient light. Readers can find the first [LightN] where Type=Ambient and read ColorRGB.

Light2

Sun / key light. Readers can use the first non-ambient [LightN] with a Position key, reading Position and ColorRGB.

Fog

Common generated files use this fog color:

Sounds

Common generated files use:

.SCN Reader Behavior

A typical .scn reader:


.DAT Format - National Track-Path Spline

FORMAT BANNER: .DAT

Binary National track-path spline. Example: tracks/national_test.dat.

The National .dat file is a variable-length list of path control points. It is not the Supercross 16 x 16 navigation field.

Total Size

Readers should require the file size to match exactly.

Header

point_count must be at least 2. Readers should reject unreasonable values such as counts greater than 100000 as a sanity guard.

Point Records

After the 4-byte header, there are point_count records. Each record is 20 bytes:

D3D_X, D3D_Y, D3D_Z

Direct3D-space control point position. National path writers commonly emit D3D_Y = 0.

width

Full track/path width in Direct3D units. If an authoring tool stores each node width as a half-width, export doubles it:

A reader can convert the full width back to authoring half-width:

type

Common writers emit:

Readers may ignore this field beyond validating the record size.

Writer Pseudocode

Reader Pseudocode

National spline paths are usually treated as closed loops by authoring tools.


.TRN Format - National Terrain

FORMAT BANNER: .TRN

Compiled National terrain. Example: tracks/national_test.trn.

National .trn files contain terrain patches, palette and lookup data, texture tiles, and a tail / quadtree used for culling and LOD.

Header

When texture_format == 1, a color-mapper section follows the 12-byte header.

Color Mapper Section

Common National writers emit:

Each color-mapper block uses this framing:

The payload may be raw or MCM LZW-compressed.

Canonical raw payload sizes:

LZW Stream

LZW payloads begin with a 4-byte little-endian subheader equal to the compressed payload length. The bitstream uses these control codes:

The initial code width is 9 bits. LZW_INC increases the code width. LZW_CLR clears the dictionary and resets the width to 9 bits. LZW_END terminates the stream.

Patch Table

After the color mapper, the parser expects a patch-list header:

The parser then walks patch data sequentially. Each patch contains three spans:

Compression is detected per span:

If compressed, the payload is decoded as an MCM LZW stream. If not compressed, the raw payload bytes are used directly.

Center Terrain Patches

Known National terrain files use these height-grid constants:

The playable center terrain is a 257 x 257 height grid divided into 256 patches:

For the embedded Nation24 scaffold, the center patch indexes are:

However, arbitrary compiled National .trn files do not have to use those fixed patch indexes. Observed examples:

Readers should locate the center terrain through the tail / quadtree leaf patch references instead of assuming MAIN0=594.

When fixed MAIN0 indexing is known to apply, patch grid mapping is:

Span 2 of each center patch contains the height and normal records used to reconstruct or modify the center terrain.

Center Patch Discovery from Quadtree

The tail / quadtree contains leaf records with world-grid coordinates and patch references. For extraction tools:

  1. locate tailStart after the texture section

  2. recursively walk quadtree nodes from the root node at tailStart

  3. follow child-table offsets when present

  4. collect leaves with their ox, oy, and patch index fields

  5. find the 16 x 16 block of leaves covering a 256 x 256 center section

  6. sort the selected leaves by oy, then ox, to rebuild the 16 x 16 patch grid

The quadtree leaf fields needed for center-patch discovery are:

The selected center block can be offset by one 16-cell patch from the logical center. Observed examples:

This matters for extraction orientation. A display/export tool may need to apply a cyclic 16-pixel patch-edge wrap derived from the block origin rather than applying the same wrap to every track.

Center Patch Vertex Records

Decoded span 2 for a center patch contains 17 x 17 vertex records. Each record is 16 bytes:

Terrain writers update encoded_height and the three normal fields.

Height Encoding

Terrain writers resample source terrain to 257 x 257. One common encoding strategy finds the minimum height and uses the floor of that value as the terrain base:

Each height is encoded as:

Writers must keep patch-grid orientation consistent with their source height array. Existing files may require orientation correction when extracting a TGA for image editing.

For tools reading an existing .trn, the raw height values can be converted back to feet with:

The .trn does not store the original .ter Base plainly. If the original .ter is unavailable, extraction tools must choose a reconstruction Base. One practical approach is to target a darkest editable TGA gray value, such as 55, then solve for a matching Base and suggested Tga2Asc.exe maxheight.

Extracted Displacement Orientation

Decoded TRN patch order is not always the same orientation as a TGA shown in a normal image editor. For FireRoad-style extraction, a useful default is:

Then it applies a quadtree-derived cyclic patch wrap when the selected center block is offset from 512,512:

Observed examples:

The wrap is an extraction/display correction. It should be derived per track; applying FireRoad's wrap to every National TRN misaligns tracks such as BaatKips.

Normals

Normals are computed from the 257 x 257 height grid using neighbor samples:

Edges clamp to the nearest valid grid coordinate.

Texture Data

After the patch data, the texture block has this observed National layout:

The parser names the inherited third texture-header fields g3 and k3. Their values are read from the template and written back unchanged.

For extraction/display, the reconstructed 4 x 4 1024 x 1024 texture needs a vertical flip to match the source texture orientation shown by common image viewers.

Texture Pipeline

A common texture build pipeline is:

  1. quantizes the main terrain RGB image to the requested color count

  2. builds the 768-byte RGB palette

  3. builds both shade lookup tables

  4. resamples the main terrain texture to 1024 x 1024

  5. flips the main texture vertically

  6. palette-maps it to 8-bit indices

  7. splits it into 16 256 x 256 tiles in a 4 x 4 layout

  8. creates one 128 x 128 mip for each main tile

  9. resamples the perimeter texture to 64 x 64

  10. palette-maps the perimeter texture

  11. creates one 32 x 32 perimeter mip

Tail / Quadtree Offsets

After replacing color-mapper, patch, and texture data, the tail section may move to a new byte offset. Writers must relocate affected tail pointer locations by the same delta.

The tail walk starts at tailStart. Each node is treated as a 15-field little-endian u32/i32 structure for the fields relevant to patch discovery and bounds repair:

When field 14 is non-zero, it points to a 256-entry child table of u32 offsets. Non-zero child offsets are recursively walked and relocated.

Bounds Patching

The embedded Nation24 scaffold includes quadtree / LOD bounds for the original terrain. If the new terrain is taller or shorter, stale bounds can cull polygons incorrectly. Writers can repair bounds after recompiling:

This operation only expands ancestor bounds. It is intended to reduce incorrect culling without changing the template's LOD behavior.

.TRN Reader Behavior

A .trn reader should:

Fields not used by known readers or writers remain undocumented here.


National Track File Set

A complete National track project may contain:

The game-file subset is:

The .asc, .ter, texture*.tga, and tile*.tga files are MakeTerr source assets. The game-file subset is what MCM1 needs at runtime.

Relationship to MakeTerr

National terrain can be built through the National MakeTerr workflow using a National .ter file and referenced ASC/TGA assets:

The National .trn format is not interchangeable with the Supercross / TrackEdit .trn format. Supercross uses a different terrain type, different height encoding, different patch counts, and a different .dat format.

National Toolchain

The historical National track workflow used several small tools and 3D Studio Max plug-ins. These tools are useful when rebuilding terrain externally or working with original National authoring assets.

ToolRole
MakeTerr.exeTerrain compiler. Consumes .ter plus referenced .asc and .tga assets and produces .trn. This is the same program that ships with MCM 1.0 in the ...\trakedit directory.
MakeCub.exeCreates sky .cub files referenced by .scn CubeFile=.
TerGen.exeCreates skeleton .ter files.
Tga2Asc.exeCreates an .asc height mesh from a .tga image.
TrackConvert.exeCreates National .dat spline path files from .txt files.
TrackBastard.dlo3D Studio Max plug-in for making spline paths. Place the .dlo in ...\3dsMax2\plugins.
msvcrtd.dllMicrosoft runtime DLL required by TrackBastard.dlo. Historically placed in ...\windows\system.
Grid.zipCharityware Grid plug-in for 3D Studio Max, used for grid terrain authoring/export.