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
Code: Select all
worldCells World Area
256 8,192 ft a side as today
512 16,384 ft a side 4 x
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 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.
- 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.
The full specification, with the exact rules, byte layouts and file sizes, is here: MTM2 track format version 6: taller tracks and larger worlds