# Mission world and lighting selection

Reference: September 1994 TFX 2.05, `TFX.DAT` SHA-256 `2cc41a39fa95a2c9fd883c4220d7bdd9cca00c543c89b019eb270763f59d1d9a`.

A mission’s **`world` chooses regional geometry**, while **`type` chooses weather and lighting configuration**. Matching the `type` string to a similarly named terrain grid is not how the original selects its map.

| Mission world | Geometry files | Example lighting configuration |
| --- | --- | --- |
| `yugoslavia` | `lev/yugoslav.dat`, `.lev`, `.le2` | `lev/yugos_n.txt` |
| `columbia` | `lev/columbia.dat`, `.lev`, `.le2` | `lev/colum_d.txt` |
| `somalia` | `lev/somalia.dat`, `.lev`, `.le2` | `lev/somal_st.txt` |
| `libya` | `lev/libya.dat`, `.lev`, `.le2` | `lev/libya_tw.txt` |
| `seaworld` | `lev/seaworld.dat`, `.lev`, `.le2` | `lev/seastorm.txt` |

## Original-code evidence

The `world` handler at executable file `0x79878` writes the name at relocated data offset `0x11974`. The `type` handler at `0x799b8` uses a different buffer, `0x11960`. Immediately before mission initialisation, `0x7280f` builds the terrain path from `world`; the separate environment parser at `0x747fc` receives `type`.

The terrain loader at `0xb0a18` splits the path into DOS components. At `0xb0a80`, it explicitly terminates the basename after eight characters. Consequently, the mission spelling `yugoslavia` resolves to the stored `yugoslav` files. The common extension builder at `0xb0284` constructs the `.dat`, `.lev` and `.le2` filenames.

The C++ reconstruction’s `tools/check_world_selection.py` executes both original command handlers, the caller’s pathname construction and the native DOS basename/extension code for all five regions. Token input, allocation and unrelated world setup are stubbed explicitly; resource loading is stopped after the filename has been constructed. This proves name selection, rather than claiming a full mission execution.

## Retained grids and viewer scope

The archive contains 39 stored grid pairs, including names that resemble weather configurations. These remain useful authoring/reference data, but they should not all be described as independent playable environments. In particular, the out-of-table indices in the retained `colum_d` and `somal_st` grids do **not** establish a defect in the retail missions: those missions load the valid `columbia` and `somalia` regional grids.

The map and waypoint browsers now select regional geometry from a mission’s `world` and take lighting and schematic artwork from its `type`. The map browser offers separate Terrain and Lighting selectors. Its five game maps appear first; the remaining grids are explicitly labelled as archived inspection data. Old weather-named map links retain their position and lighting but select the corresponding regional terrain; `?retained=1` requests the archived grid explicitly. The C++ scene loader keeps the two selections independent and offers a developer `--grid` override for inspecting the retained variants.

All 128 retail mission scene declarations have also been checked against the extracted source metadata and rendered through the C++ startup path. Their numeric start Y values are already signed native coordinates; they must not be negated as positive altitudes. `landed` is a distinct state, and an omitted `plane` field remains unspecified for later mission-state inheritance.

## Floating motorway slopes in the old map preview

At cell `(137,113)`, the retained `yugos_n` grid selects tile 105, whose variants are `m_ways1`, `m_ways4` and `m_ways5`. The latter two SSDs bind model indices 562 and 564, which resolve through `ssinfo.fn` to the mountain slopes `mt3_s2` and `mt3_s4`. Their vertices are entirely above ground, so they appear as floating diagonal surfaces among the city blocks. The deterministic inspection selection picks `m_ways5` at this cell.

The retail `yugoslav` grid selects tile 59 at the same coordinates, with the flat motorway variants `m_ways1`, `m_ways2` and `m_ways3`. Neither of the suspect SSD names occurs in that regional tile table. The fault was the viewer presenting an archived grid as the playable night map; it was not a projection or polygon-depth fault. The archived bytes and slope models are left intact for inspection. The C++ game already separates world and type and needs no corresponding change.

[The browser selection checks](../tools/check_map_selection.js) cover every stored mission declaration, all five regional grids, separate lighting/schematic selection, and both the retail and archived geometry at this cell. Native world/type selection and DOS path truncation are independently checked by the C++ reconstruction’s `tools/check_world_selection.py`.
