Earthsiege Research archive

Hangar repair and construction

The service screens operate on GO's shell HERC records, distinct from the live simulator damage arrays. Their prices come from CFG/DAMAGE.DAT and the eight chassis price/duration entries. Original-code comparisons are retained alongside the C++ fixtures; the comparison installation and its saves are never modified.

Detailed repair (MENU1920)

GO 0x2f1aa saves all 33 condition words and the current material budget. The 0x2f8d4 handler edits nine internal components, six armour groups, or the chassis's equipment mounts. Armour groups average their constituent surfaces when read and set all those surfaces together when changed.

Condition bands begin at 91, 75, 52, 1 and 0. Plus charges the difference to the next threshold (or 100) with integer truncation. Equal available material is sufficient here; the separate Repair All routine uses a strict greater-than test. Minus reverses increases only as far as the state when this dialog opened, including its band-dependent refund rules. Cancel restores every condition and the budget, including the selected pilot's share.

Two peculiarities are confirmed by running the original handler:

The allocated counter and quote are signed 16-bit values. The transaction captures retain them after every event rather than deriving them from a final condition alone.

Unassigned-HERC corruption

Original 0x29bf3 locates the pilot assigned to the selected HERC, then writes its remaining repair share at crew_state + 0x35 + pilot * 0x25. A missing assignment returns -1, so this writes four bytes at crew_state + 0x10: the crew-count and crew-cursor words. The detailed editor also updates shares using the current cursor without a negative-index guard.

The capture tool includes a direct original-code demonstration of this write. The C++ port performs the repair and budget transaction but skips the pilot-share write when there is no assigned pilot. It does not reproduce header corruption. This is a deliberate bounded-memory departure, not an alternate repair economy.

Repair policy

The three original button labels describe the player's responsibility: REPAIRS ALL selects policy 0 (no automatic repairs); REPAIR MINE selects policy 1 (wingmates are repaired automatically); AUTO REPAIR selects policy 2 (all active, assigned pilots are repaired automatically). Choosing a policy returns directly to the repair screen. Escape does not dismiss the original preference selector.

Construction and scrap

The eight chassis cost 50, 60, 80, 100, 120, 140, 170 and 200 thousand material units. Construction takes 1, 1, 2, 2, 2, 3, 3 and 3 mission returns respectively. The reserved construction slot is excluded from ordinary HERC cycling.

A freshly constructed record has empty mounts, zero missile-value words, condition 100 except the unused pilot condition at zero, and extra word 2. The construction timer prevents assignment before completion.

Scrapping returns mounted equipment with condition at least 80 to the inventory head. Worse equipment instead yields its condition-scaled price. Chassis material comes from the six armour and nine internal component groups. A build cancellation supplies its construction-value credit instead. The scrap warning quotes chassis material only; it does not include damaged-weapon credit. Cancellation can leave the empty construction slot reserved. Original 0x29e01 checks whether a HERC actually occupies it and otherwise does nothing. The port now does the same, rather than rejecting this valid empty reservation.

MENU2000 cycles only through unlocked chassis. While a HERC is being built, the cycle controls are disabled and BUILD becomes SCRAP. Cancellation re-enables cycling but does not recompute whether the refunded material covers another build. Pressing BUILD immediately can therefore overdraw material after a partially completed build was scrapped. The original unsigned budget checks then see that wrapped balance. This sequence is captured and retained.

The BLUEHERX.DBA blueprint and the mass/speed/mount tables at 0x808a8, 0x808c8 and 0x803c8 drive the construction panel. Its text and progress presentation is 0x2845c. The separate registered SALVAGE layout 2010 is not the ordinary build allocation step: the retained build-click capture remains in screen 2000.

Verification boundary

UI control drawing, final bay-art refresh, and object deallocation are explicit capture boundaries. These tests compare service state. SHELL.md describes the separate artwork and resident-animation comparisons.