MCM2 ENV Terrain Extractor Help

Back to Extractor

This utility opens a Motocross Madness 2 .env archive, extracts its embedded terrain, and reconstructs editable center and perimeter displacement maps and terrain textures.

The calculated Displacement Strength is an equivalent value for the newly normalized output image. The compiled TRN does not preserve the original Armadillo project Strength or the original displacement image endpoints.

Quick start

  1. Drop one MCM2 .env file onto the extractor.
  2. Review the center and perimeter displacement and texture previews.
  3. Leave Darkest Gray at 0 and Max Gray at 255 for a full-range starting point.
  4. Use the displayed Calculated Displacement Strength when rebuilding from the extracted image.
  5. 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

ControlPurpose
Darkest GrayGray assigned to the lowest elevation in the shared center/perimeter range. Defaults to 0.
Max GrayGray assigned to the highest elevation in the shared range. Defaults to 255.
Calculated Displacement StrengthRead-only equivalent Strength for the selected output gray range.

Output files

OutputContents
-main-displacement.tga257×257 center displacement normalized to the selected 8-bit gray range.
-main-displacement-povray.tga257×257 center displacement in POV-Ray 16-bit TGA channel form.
-perimeter-displacement.tga257×257 perimeter displacement using the same elevation mapping as the center.
-perimeter-displacement-povray.tga257×257 perimeter displacement in POV-Ray 16-bit channel form.
-main-texture.tga960×960 center terrain texture reconstructed from 16 cropped tiles.
-perimeter-texture.tga960×960 perimeter terrain texture reconstructed from 16 cropped tiles.
Original .trnThe unmodified terrain file extracted from the ENV.
-extraction-info.txtSource details, elevation ranges, calculated Strength, output ranges, and format notes.
-mcm2-terrain-extracted.zipThe 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:

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.

Strength controls the vertical range. Grid Size is a separate horizontal scale setting. A project can use Grid Size 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
GrayPOV-Ray value
00
22557825
25565535

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 rangeCalculated Strength
0–255233.299
18–255251.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

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.