Proposal: taller and larger tracks (TXV formatVersion 6)

mtm2 and other sensible chat
Post Reply
User avatar
Kmaster
Member
Posts: 1610
Joined: Fri Oct 10, 2003 6:19 pm
Location: Valparaíso, Chile.
Contact:

Proposal: taller and larger tracks (TXV formatVersion 6)

Post by Kmaster »

I would like to propose an open addition to the MTM2 track format, so tracks can be smooth, tall, and larger than today's map. It is written as an open specification: OpenMTM2 will implement it, and any other game build or tool is welcome to. I would also like to hear what the rest of the community thinks.

The problems, in plain words

1. Height. Every MTM2 track has a height limit: from its lowest point to its highest it can only be about 512 ft tall.

The new 16-bit heightmaps are a great step: slopes are now smooth instead of looking spiked. But they add more steps, not more height. The ceiling is still 512 ft.

Take Pikes Peak from 4x4 Evolution 2. The road climbs from 12 ft to 1,821 ft, about 1,800 ft of climb. That's more than three times what an MTM2 track can hold, in the original game and in CommPatch 4 beta. To bring it over today you'd have to squash the mountain to a third of its height (this is what JSMTM2Converter has been doing with Evo conversions), and that is not the real Pikes Peak.

Evo 2 shows this doesn't have to be a trade-off. Its height steps are coarser than CP4 beta's, yet its tracks look smooth and can be four times taller. The smoothness comes from blending between the grid points (which CP4's spline mode already does), not from extra precision.

2. Size. Every MTM2 track is the same size: a square of 8,192 ft a side that wraps around at the edges.

I am converting Midtown Madness's Chicago. At real scale the drivable city is about 9,500 ft long, and everything the game has collision for (the lake shore, the edges) is about 12,500 ft. It doesn't fit, so today the whole city has to be shrunk to 0.83 of its size: buildings, bridges, ramps and the gaps between jumps all 17% smaller than they should be.

The idea

Taller: let each track choose its own height step. A short track keeps CommPatch4's tiny 2.4 mm steps. A mountain uses slightly bigger steps (still under 1 cm, too small to see) and gets thousands of feet of height. Same file, same size, same tools.

Code: Select all

Step per foot   Smallest change   Track can be
128             2.4 mm            512 ft    (every CP4 track today)
 64             4.8 mm            1,024 ft
 32             9.5 mm            2,048 ft  (Evo 2, Pikes Peak)
 16             1.9 cm            4,096 ft
  8             3.8 cm            8,192 ft
Larger: let a track choose a world of 512 x 512 cells instead of 256 x 256. A cell stays 32 ft and the fine terrain stays 8 ft; there are just twice as many cells each way.

Code: Select all

worldCells   World            Area
256          8,192 ft a side  as today
512          16,384 ft a side 4 x
The details

A track that needs either writes this in its .TXV:

Code: Select all

formatVersion=6
worldCells=512
terrainHeightMap=DATA\PIKES_H.PNG
terrainHeightStep=32
terrainHeightBase=12
terrainGrid=spline
  • terrainHeightMap: the heights, as a normal 16-bit greyscale PNG (or a raw 16-bit file), exactly like CP4's terrainHeights= today. 256 or 1024 square in a normal world, 512 or 2048 in a large one.
  • terrainHeightStep: steps per foot, a power of two from 1 to 128. Default 128, which is CP4's scale.
  • terrainHeightBase: whole feet added to every height, so the range can start anywhere (even below zero).
  • Height in feet = base + sample / step.
  • terrainGrid works as it does in CP4 (classic, spline or fine).
  • worldCells: 256 (default) or 512. In a 512 world the grid files (.CLR, .LTE, ground boxes) keep their layout and are four times larger, and the game wraps at 16,384 ft instead of 8,192.
  • Ground boxes (.RA0/.RA1) can optionally be 16-bit too, with the same step and base, so they can sit high on a mountain.
  • Lakes (.WTR) get a version 2: a 512 tile map, wider bounding boxes, and heights anywhere in the track's range.
  • Editors pick step and base automatically from the lowest and highest point. For Pikes Peak: base 12, step 32. Chicago at true scale: worldCells=512.
A new situation file: .SI3

A version 6 track's situation file is WORLD\<name>.SI3 instead of .SI2. For now it is the same text as a .SI2; it may get its own additions in later versions.

Why a new extension? From what I see in Traxx 1.7, formatVersion is information only: an older game still loads a track with a number it doesn't know. A tall or large track loaded by an older build would come out wrong without any warning: the wrong mountain, or half a world it can't reach. The original game only lists .SIT tracks, and CP3 and CP4 add .SI2, so none of them lists a .SI3. Older builds simply never see the track. A .SI2 in the same POD is just a different track; it can't stand in for the large one.

What a game would need to change:
  • Read the new keys, and list .SI3 tracks.
  • Keep heights in 32-bit numbers instead of 16-bit (the 16-bit store is where the 512 ft ceiling comes from).
  • Take the world size from worldCells instead of the fixed 256 cells and 8,192 ft: the cell masks, the wrap, the grid sizes. The cell shifts don't change, since a cell is still 32 ft.
  • Read .WTR version 2.
Why this is a good approach
  • It's still a normal image. 16-bit greyscale PNG opens in Photoshop, GIMP, Krita, World Machine, Gaea and map tools.
  • It's how Unity and Unreal do it: a 16-bit heightmap plus a height scale per terrain.
  • The precision goes where you can see it. Nobody can see a step smaller than about 1 cm. Smoothness comes from the spline, not from extra bits. A fixed scale either wastes precision on tall tracks or wastes height on short ones.
  • Every game gets exactly the same heights. Because the steps are powers of two, any engine converts them with simple integer math and gets the same result to the last bit. That's important for online play, where every player's machine must agree on where the ground is.
  • Same cells, more of them. Every rule about a cell stays the same, so a game changes a few constants, not its code, and authors keep their sense of scale.
  • Should be a small change. Same file layouts, same PNG reader, same spline. Existing tracks don't change at all.
  • Older builds stay safe. They never list a track they don't understand.
One open question, where help from anyone who knows a game build is welcome: what else in the engine assumes 256 cells, 8,192 ft or 512 ft? Renderer, sky, AI, replays...

The full specification, with the exact rules, byte layouts and file sizes, is here: MTM2 track format version 6: taller tracks and larger worlds
Last edited by Kmaster on Fri Nov 13, 2026 1:03 am, edited 1 time in total.
User avatar
Fila
Member
Posts: 2268
Joined: Mon Jul 02, 2001 2:01 pm
Location: Lost in Translation
Contact:

Re: Proposal: taller tracks with smooth heights (TXV formatVersion 6)

Post by Fila »

Oof. This would have to stay after AI work because if I am to do this, this changes a lot of values in the engine, arrays and the view matrices too. The engine silently only supports up to 2048ft, everything past that has to be significantly modified and touches everything you see in the engine (world wrap around, ai driving, water, shadows etc etc)
User avatar
Kmaster
Member
Posts: 1610
Joined: Fri Oct 10, 2003 6:19 pm
Location: Valparaíso, Chile.
Contact:

Re: Proposal: taller tracks with smooth heights (TXV formatVersion 6)

Post by Kmaster »

I think it's OK as long as you keep the Version 6 for these changes, so i can implement em on OMTM2. Any change you want to make to TXV please post it here,
More to come...
User avatar
Kmaster
Member
Posts: 1610
Joined: Fri Oct 10, 2003 6:19 pm
Location: Valparaíso, Chile.
Contact:

Re: Proposal: taller and larger tracks (TXV formatVersion 6)

Post by Kmaster »

Update: the proposal has been revised

I have edited the original post. The proposal now covers more than the height limit, and the documentation has a new revision.

Why it changed

While converting Midtown Madness's Chicago, I ran into a second limit besides height: map size. Every MTM2 track is a square of 8,192 ft a side, and Chicago at real scale doesn't fit. It has to be shrunk to 0.83 of its size. Both limits come from the same place (the fixed terrain grid), so it made sense to solve them together in one format version instead of two.

What's new in this revision
  • Larger worlds. A new .TXV key, worldCells=512, gives a world of 16,384 ft a side, four times the area. Cells stay 32 ft and the fine terrain stays 8 ft.
  • A new situation file, .SI3. A version 6 track uses WORLD\<name>.SI3 instead of .SI2. Older builds only list .SIT and .SI2, so they never see a track they would load wrongly. This replaces the earlier idea of an old-style fallback: a .SI2 in the same POD is just a different track, since you can't recreate a quarter of a map or a squashed mountain and call it the same track.
  • Lakes (.WTR) version 2: room for the larger map, and lake heights anywhere in the track's range.
  • Written as an open specification. It is meant for any game build, editor or converter. It includes exact rules, byte layouts and file sizes, so it can be implemented from the document alone.
  • It is still formatVersion 6, since version 6 was never released. The height step and base from the first post are unchanged.
The one open question remains: what else in the engine assumes 256 cells, 8,192 ft or 512 ft?

The new revision is here, and replaces the old page: MTM2 track format version 6: taller tracks and larger worlds
User avatar
Fila
Member
Posts: 2268
Joined: Mon Jul 02, 2001 2:01 pm
Location: Lost in Translation
Contact:

Re: Proposal: taller and larger tracks (TXV formatVersion 6)

Post by Fila »

Pretty much everything assumes 256x256, lol. This one is more restrictive than the height which silently supported 2048ft.
User avatar
Kmaster
Member
Posts: 1610
Joined: Fri Oct 10, 2003 6:19 pm
Location: Valparaíso, Chile.
Contact:

Re: Proposal: taller and larger tracks (TXV formatVersion 6)

Post by Kmaster »

Track format version 6: update (waterfalls, lake and waterfall versions, .TXX)

Here is what changed since the last post.

1. Waterfalls in 512-cell worlds: .WFL version 2 (section 9.3)
The earlier draft said waterfalls "do not change". In practice, Community Patch 4's .WFL and its waterfall build only work in a 256-cell world:
  • the header must say 256 x 256;
  • crest points stop at 8,192 ft;
  • the wrap is at 8,192 ft;
  • the lake map is 256 wide;
  • the walk runs on heights from 0 to 512 ft.
Version 2 fixes that:
  • a 512 x 512 header;
  • signed crest heights over the terrain's whole range;
  • crest points anywhere in the 16,384 ft world.
Readers build the falls with the world's own constants: the wrap, the lake map and the full-precision heights. Everything else in a fall record is the same as version 1.

2. The world's size picks the lake and waterfall file version (sections 9.1 and 9.3)
  • A 256-cell track (.SIT, .SI2, or a .SI3 of 256 cells) uses version 1 .WTR and .WFL.
  • A 512-cell track uses version 2.
  • A reader refuses any other pairing.
A version 1 file in a 512-cell world could hold only a quarter of the data the world needs. A version 2 file in a 256-cell world would make a lake or waterfall a reason for the track to stop loading in CP4. One rule, no choice per file.

The consequence: a 256-cell track can't have a lake or waterfall above 2,048 ft. Editors report it as an error instead of quietly switching to version 2.

3. Clarifications (sections 5.1, 6 and 10)
  • A lake or a waterfall never makes a track version 6. Only worldCells, terrainHeightMap, terrainHeightStep and terrainHeightBase require a .SI3.
  • terrainGrid stays allowed in .SI2 tracks: it is CP4's own key.
  • A .SIT or .SI2 with the same name as a .SI3 is listed as its own track, never as a fallback.
4. The editor's working file: .TXX generation TRAXXV19 (new section 15)
Traxx saves a track being edited as a .TXX. Its 10-byte header names a generation, TRAXXV1 to TRAXXV18, and each generation adds fields to the one before. V18 keeps the terrain at 256 x 256 and ground box heights as single bytes, so it can't hold a version 6 track.

TRAXXV19 is a new generation. It is written only for version 6 tracks; every other track keeps the generation and bytes Traxx 1.7.1 writes. It is V18's record in the same order, with these changes:
  • the world size (worldCells) is stored before the terrain;
  • the terrain planes are N x N;
  • ground box bottom and top are stored as 8-byte floats instead of single bytes;
  • heights are stored as 16-bit or 32-bit samples;
  • lake seeds can be anywhere in the world;
  • a closing V19 block holds the "opened from a .SI3" flag, terrainHeightStep and terrainHeightBase.
Traxx 1.7.1 recognises only TRAXXV1 to TRAXXV18 and aborts on any other header, so it refuses a V19 file instead of misreading it. The full record order is in section 15.3.

5. Open questions (section 17)
The first implementations met a few points the document doesn't settle yet:
  • grid file names when there's no .RAW;
  • step and base on a track without a height map;
  • .RA2/.RA3;
  • what to do with a bad .WTR, .WFL or .VEG;
  • 8-bit ground boxes with an odd base;
  • ground boxes below the base.
Section 17 says what the implementations do today for each. Comments and findings from other engines are welcome, especially on anything else that assumes 256 cells, 8,192 ft or 512 ft.

MTM2 track format version 6: taller tracks and larger worlds
User avatar
Kmaster
Member
Posts: 1610
Joined: Fri Oct 10, 2003 6:19 pm
Location: Valparaíso, Chile.
Contact:

Re: Proposal: taller and larger tracks (TXV formatVersion 6)

Post by Kmaster »

I have created a monster (zoom in to see the grid size}
crazy4x (1).jpg
Spline terrain, 1/32 height steps, 512-cell (4 times the size of Crazy 8 ), mountains up to about 2000 ft, four lakes and two waterfalls. 268,4 million square feet, around 25km2. 5 klicks per side. Made with a nAI generated script (build-crazy4x) using openphotex.
still on the works!


Download CRAZY4X (TXX and POD)

https://juanputrerasm.github.io/JSTraxx/ TXV6 track editor
You do not have the required permissions to view the files attached to this post.
Last edited by Kmaster on Mon Nov 16, 2026 8:51 pm, edited 1 time in total.
User avatar
Kmaster
Member
Posts: 1610
Joined: Fri Oct 10, 2003 6:19 pm
Location: Valparaíso, Chile.
Contact:

Re: Proposal: taller and larger tracks (TXV formatVersion 6)

Post by Kmaster »

Track format version 6: changelog of the documents (13 to 16 November 2026)

Documents:
Revision of 16 November (first)
  • The .TXX generation is renamed TRAXXV99 (15): Traxx 1.7.2 already uses TRAXXV19 for its water detail and mask maps. 99 is a temporary number: the final draft will use whatever number Traxx itself takes next for version 6 tracks.
  • The generations table (15.1) now lists TRAXXV18 (Traxx 1.7.1, waterfalls) and TRAXXV19 (Traxx 1.7.2, water maps). It also covers Traxx 1.7.3's waterfalls block version 3, which adds roughFrom.
  • TRAXXV99 always carries the water detail and water mask maps, empty when there are none, and the waterfalls as block version 3.
  • .WTR (9.1): version 2 keeps the header that Traxx 1.7.3 added: minor 1, and a flags word whose bit 0 means the lakes were filled with the edge rule. Water crosses to a neighbouring tile only through an edge whose lowest point is at or below the lake's height.
  • .WFL (9.3): version 2 keeps the 132-byte records (minor 1): mist depth, mist height, and roughFrom at byte 130. roughFrom values:
    • 0 means 25 ft/s;
    • 1 to 250 is a speed in ft/s;
    • 255 turns rough water off;
    • 251 to 254 are invalid.
  • Traxx (16): what Traxx would have to change now has a document of its own (below).
Revision of 16 November (second)
  • Masks and detail normals (new 9.5):
    • masks (_MASK, _WMSK and the vegetation _V and _G masks) are maps of the world. On a version 6 track a mask covers the track's own world once, with pixel = floor(x * size / W);
    • on a 256-cell track nothing changes;
    • detail normals (_DTL, _WDTL) are tiles repeated over the ground, so they don't change with the world's size.
  • The track's own water (10, item 7): the .LVL !waterHeight keeps its units. On a taller version 6 terrain it may go past 1,020, up to the top of the terrain.
  • Engine checklist (10, item 8 ): a new item asks engines to map world-space masks over W.
Revision of 16 November (third)
  • Traxx 1.8.0 (15): it is released with TRAXXV20, an i32 allWx at the end of every box record: the .SIT light line's 13th field.
  • TRAXXV99 builds on TRAXXV20: allWx is always present, 0 for a box that is not a light.
  • Compatibility (15.5): Traxx 1.7.3 and 1.8.0 both refuse a TRAXXV99 file.
Revision of 16 November (fourth)
  • Placed objects (new 5.3):
    • a .SI3 track MAY place up to 16,384 objects, counted as Traxx counts them: objects, ramps and top-crush cars together;
    • a writer MUST NOT write more;
    • a reader MUST keep all 16,384. If a file holds more, it keeps the first 16,384 and SHOULD warn;
    • the caps on particular kinds of object (checkpoints, ramps, lights, fog volumes and the rest) are unchanged;
    • .SIT and .SI2 tracks keep today's limits.
  • Engine checklist and limits (10, item 10; 14): 16,384 is four times 4,096 for four times the area, and a power of two. Whole-city Chicago at true scale already places 6,553 objects.
New document: Version 6 tracks in Traxx: what would have to change
A companion for the Traxx maintainers, based on a reading of the Traxx 1.7.3 source (commit 4364111). It is not part of the format, and nothing in it is required of Traxx. It covers:
  • how a track reaches Traxx today;
  • 13 areas, each with the functions, files and constants involved:
    • world size and the terrain grids;
    • .CLR and .LTE planes;
    • the height store, step and base;
    • ground boxes;
    • the .SI3 and the .TXV keys;
    • .WTR version 2;
    • .WFL version 2;
    • vegetation;
    • the .TXX generation;
    • views, tools and dialogs;
    • height map import and export;
    • Write POD;
    • placed objects.
  • a suggested order of work;
  • what JSTraxx did;
  • questions for the proposal.
As always, this is an open specification. Anyone may implement it, in any engine or tool.
Post Reply