This utility opens a Motocross Madness 2 .env archive,
extracts its embedded terrain, and reconstructs editable center and
perimeter displacement maps and terrain textures.
Quick start
- Drop one MCM2
.envfile onto the extractor. - Review the center and perimeter displacement and texture previews.
- Leave Darkest Gray at
0and Max Gray at255for a full-range starting point. - Use the displayed Calculated Displacement Strength when rebuilding from the extracted image.
- Download individual files or use Download All (.zip).
Loading a new ENV resets the gray range to 0–255. Changes to
the gray controls immediately rebuild both displacement outputs and update
the calculated Strength.
Controls
| Control | Purpose |
|---|---|
| Darkest Gray | Gray assigned to the lowest elevation in the shared center/perimeter range. Defaults to 0. |
| Max Gray | Gray assigned to the highest elevation in the shared range. Defaults to 255. |
| Calculated Displacement Strength | Read-only equivalent Strength for the selected output gray range. |
Output files
| Output | Contents |
|---|---|
-main-displacement.tga | 257×257 center displacement normalized to the selected 8-bit gray range. |
-main-displacement-povray.tga | 257×257 center displacement in POV-Ray 16-bit TGA channel form. |
-perimeter-displacement.tga | 257×257 perimeter displacement using the same elevation mapping as the center. |
-perimeter-displacement-povray.tga | 257×257 perimeter displacement in POV-Ray 16-bit channel form. |
-main-texture.tga | 960×960 center terrain texture reconstructed from 16 cropped tiles. |
-perimeter-texture.tga | 960×960 perimeter terrain texture reconstructed from 16 cropped tiles. |
Original .trn | The unmodified terrain file extracted from the ENV. |
-extraction-info.txt | Source details, elevation ranges, calculated Strength, output ranges, and format notes. |
-mcm2-terrain-extracted.zip | The decoded ENV files and all generated terrain outputs. |
Compiled terrain data
MCM2 terrain elevations are stored as unsigned 16-bit values. For Strength
reconstruction, the extractor treats the complete stored range
0–65535 as 250 feet. A compiled elevation span is:
compiled_span_feet = (raw_max − raw_min) × 250 / 65535
The raw minimum and maximum are reported for inspection. They are not gray values and should not be entered directly into an image editor.
Gray-range normalization
The original editable image range is not recoverable from the TRN, so the extractor creates a new linear mapping:
- The lowest shared compiled elevation maps to Darkest Gray.
- The highest shared compiled elevation maps to Max Gray.
- Intermediate elevations retain their proportional position.
- The same mapping is applied to center and perimeter terrain.
A 0–255 range uses all available 8-bit grayscale levels.
Narrowing the range leaves room for later editing below or above the
extracted terrain, but requires a larger Displacement Strength.
Calculated Displacement Strength
Equivalent Strength:
Strength = compiled_span_feet × 255 / (max_gray − darkest_gray)
At 0–255, Strength equals the compiled elevation span. If Max
Gray is reduced, or Darkest Gray is increased, Strength rises so the
narrower image range still produces the same vertical relief.
3.0,
4.0, 5.0, or another supported value without
changing the meaning of the calculated vertical Strength.
POV-Ray TGA output
POV-Ray height-field TGAs use two color channels to carry a 16-bit value:
R = high byte G = low byte B = 0
Each 8-bit gray endpoint is converted to its exact 16-bit equivalent:
POV_value = gray × 257
| Gray | POV-Ray value |
|---|---|
0 | 0 |
225 | 57825 |
255 | 65535 |
Values between the endpoints retain normalized 16-bit precision. The POV-Ray file is therefore not simply the rounded grayscale output copied into two channels.
Center and perimeter terrain
The extractor identifies two 16×16 patch blocks in the TRN. One reconstructs the center terrain and the other reconstructs the surrounding perimeter terrain. Each becomes a 257×257 displacement map.
Both maps use one shared raw minimum and maximum. This keeps matching center and perimeter elevations at matching output values. A flat perimeter will therefore remain the same color as the corresponding center edge.
Orientation and textures
Terrain patches are reconstructed, rotated 90 degrees, and then flipped vertically to match the displayed MCM2 terrain textures. The same corrected orientation is used by the previews and downloaded TGAs.
Terrain textures are assembled from a 4×4 tile group. The eight-pixel guard
apron around each 256×256 source tile is removed, producing a seamless
960×960 output.
Valley Ride example
The compiled Valley Ride center terrain has a raw elevation range of
4377–65534. Its equivalent compiled relief is approximately
233.299 feet.
| Output gray range | Calculated Strength |
|---|---|
0–255 | 233.299 |
18–255 | 251.018 |
The surviving Valley Ride project records the original Strength as
250.0. The small difference from 251.018 is
consistent with compilation and quantization; the extractor reports the
equivalent value represented by the compiled terrain.
What cannot be recovered
- The exact original Armadillo Strength is not stored as an authoring setting in the compiled TRN.
- The original displacement image and its chosen darkest and brightest pixels are not preserved.
- Filtering, resampling, and 16-bit quantization may slightly change the reconstructed equivalent Strength.
- The extractor currently targets the known MCM2 National terrain and texture layouts.
Troubleshooting
The displacement is too dark or too bright
Return to 0–255 first. Then choose a narrower range only when you need editing room below or above the terrain.
The rebuilt terrain is too tall or too flat
Use the Calculated Displacement Strength shown for the current gray range. Changing either gray endpoint changes the required Strength.
The center and perimeter do not meet
Export both maps with the same gray settings. Do not normalize them separately in an image editor.
A texture or displacement is incorrectly oriented
Keep the original extracted files and note the affected track. Different MCM2 terrain variants may require an additional decoder-specific correction.
The ENV will not load
Confirm that it is an MCM2 FAOE/RS2 ENV archive containing a supported TRN terrain file.