|
| 1 | +# The "Cape Cod" Patch — X-COM: Terror from the Deep |
| 2 | + |
| 3 | +> *Cape Cod is where lobsters go to die.* |
| 4 | +
|
| 5 | +An unofficial, reversible balance micro-patch for the GOG/DOSBox release of |
| 6 | +**X-COM: Terror from the Deep** (1995). It edits the game's two DOS4GW |
| 7 | +executables and one data file **in place** (file sizes never change), so the |
| 8 | +game runs rebalanced through whatever launcher you already use. Every change is |
| 9 | +backed up and can be undone with a single command. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## The problems it fixes |
| 14 | + |
| 15 | +1. **Damage variance was narrowed.** TftD rolls all damage at 50–150% of weapon |
| 16 | + power (the original *UFO Defense* rolled firearms 0–200%). This inflates the |
| 17 | + value of armor and means even the weakest alien weapon (power 80) deals a |
| 18 | + *guaranteed* 40 on its minimum roll — instantly killing a fresh 40-HP rookie. |
| 19 | +2. **Lobster Men are near-unkillable** — heavy armor plus 100+ health let them |
| 20 | + shrug off almost anything and reaction-fire with impunity. |
| 21 | +3. **Lobster Men have a hidden, undocumented damage discount** applied *before* |
| 22 | + armor. It is shown nowhere in the game, not even on an M.C. scan. A "Heavy |
| 23 | + Gauss" reading 75 power was secretly doing ~22 before armor against a Lobster. |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## What the patch changes |
| 28 | + |
| 29 | +The patch is **phased** so you apply only as much as you need. **Fixing the |
| 30 | +hidden resistances (Phase 1) alone is a 2×–5× increase in damage dealt to |
| 31 | +Lobsters and resolves most of the problem** — so it is the default, and the |
| 32 | +health/armor and weapon-power tweaks are opt-in. |
| 33 | + |
| 34 | +### Phase 1 (default) — Hidden resistance normalization · `TACTICAL.EXE` |
| 35 | + |
| 36 | +The Lobster Man's secret pre-armor damage multipliers, restored to a flat 100%: |
| 37 | + |
| 38 | +| Damage type | Vanilla | Cape Cod | |
| 39 | +|--------------------|:-------:|:--------:| |
| 40 | +| Armor-Piercing (guns) | 20% | **100%** | |
| 41 | +| Incendiary | 30% | **100%** | |
| 42 | +| High Explosive | 30% | **100%** | |
| 43 | +| Gauss | 30% | **100%** | |
| 44 | +| Sonic | 50% | **100%** | |
| 45 | +| Stun | 110% | unchanged | |
| 46 | +| Melee | 200% | unchanged | |
| 47 | +| Electric | 0% | unchanged | |
| 48 | + |
| 49 | +Natural weaknesses (Stun, Melee) and the Electric immunity are deliberately left |
| 50 | +alone — they don't make Lobsters tankier. |
| 51 | + |
| 52 | +**Effect, before armor:** |
| 53 | + |
| 54 | +| Weapon (power) | vs. Lobster, vanilla | vs. Lobster, patched | |
| 55 | +|-----------------------|:--------------------:|:--------------------:| |
| 56 | +| Gauss Rifle Clip (60) | ×0.30 → ~18 | ×1.00 → ~60 | |
| 57 | +| Heavy Gauss Clip (75) | ×0.30 → ~22 | ×1.00 → ~75 | |
| 58 | +| Sonic Clip (80) | ×0.50 → ~40 | ×1.00 → ~80 | |
| 59 | +| S. Cannon Clip (130) | ×0.50 → ~65 | ×1.00 → ~130 | |
| 60 | + |
| 61 | +Your weapons now do what their stats say they do. |
| 62 | + |
| 63 | +### Phase 2 (opt-in: `--with-armor-hp`) — Modest toughness trim · `GEOSCAPE.EXE` |
| 64 | + |
| 65 | +Applied across all six Lobster Man ranks: |
| 66 | + |
| 67 | +- **Front & side armor** trimmed (20 → 14; the toughest rank 22 → 16). Rear and |
| 68 | + under armor left as-is. |
| 69 | +- **Health** reduced by 20 per rank (e.g. 110 → 90, …, 135 → 115). |
| 70 | + |
| 71 | +This is a secondary tuning knob. With Phase 1 already multiplying your damage, |
| 72 | +you may not need it at all — try Phase 1 first. |
| 73 | + |
| 74 | +### Phase 3 (opt-in: `--with-weapon-power`) — Weakest-weapon power · `OBDATA.DAT` |
| 75 | + |
| 76 | +- **Sonic Clip** (the ammo for the Sonic Pistol, the weakest alien sonic weapon) |
| 77 | + power **80 → 66**. Its minimum 50% roll drops from 40 to 33, so a glancing hit |
| 78 | + no longer auto-kills a 40-HP rookie. |
| 79 | + |
| 80 | +> **Trade-off:** weapon stats in `OBDATA.DAT` apply to *everyone*, so a Sonic |
| 81 | +> Pistol the player later captures also reads power 66. This is an accepted cost |
| 82 | +> of fixing early-game lethality without touching the hardcoded damage formula. |
| 83 | +> (Per design choice, the 50–150% variance formula itself is **not** patched.) |
| 84 | +
|
| 85 | +--- |
| 86 | + |
| 87 | +## Usage |
| 88 | + |
| 89 | +Run from the `cape-cod` folder (the one containing this file): |
| 90 | + |
| 91 | +```bash |
| 92 | +python3 cape_cod_patch.py # Phase 1 only (recommended v1.0) |
| 93 | +python3 cape_cod_patch.py --with-armor-hp # Phase 1 + 2 |
| 94 | +python3 cape_cod_patch.py --with-weapon-power # Phase 1 + 3 |
| 95 | +python3 cape_cod_patch.py --full # all phases |
| 96 | + |
| 97 | +python3 cape_cod_patch.py --dry-run # preview the diff, write nothing |
| 98 | +python3 cape_cod_patch.py --verify # report what's currently applied |
| 99 | +python3 cape_cod_patch.py --revert # restore originals from backup |
| 100 | +``` |
| 101 | + |
| 102 | +No dependencies — just Python 3. |
| 103 | + |
| 104 | +### Safety |
| 105 | + |
| 106 | +- **Backups:** on first write, each file is copied to `*.capecod.bak` (e.g. |
| 107 | + `TACTICAL.EXE.capecod.bak`). Backups are created once and never overwritten. |
| 108 | +- **Verify-before-write:** every edit is checked against a wide window of |
| 109 | + surrounding bytes. If they don't match (a different game build, a fan patch, |
| 110 | + offset drift), the patcher prints exactly what it expected vs. found and exits |
| 111 | + **without writing anything**. |
| 112 | +- **Idempotent:** re-running is safe — already-applied edits are detected and |
| 113 | + skipped. |
| 114 | +- **Reversible:** `--revert` restores the originals byte-for-byte (verified: |
| 115 | + post-revert checksums match the untouched files exactly). |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +## Verifying it works |
| 120 | + |
| 121 | +The patcher self-verifies structurally after every run (re-reads each offset, |
| 122 | +confirms the new values, and confirms file sizes are unchanged). |
| 123 | + |
| 124 | +For an in-game check, launch the game the way you normally do — the patched |
| 125 | +executables are already in place — start a tactical mission with Lobster Men, |
| 126 | +and confirm: |
| 127 | + |
| 128 | +- **Phase 1:** Gauss / conventional fire now visibly wounds Lobsters instead of |
| 129 | + registering a string of near-zeros; a Lobster falls in a sensible number of |
| 130 | + solid hits. |
| 131 | +- **Phase 3 (if applied):** a fresh rookie can survive a glancing hit from the |
| 132 | + weakest alien Sonic weapon instead of dying to the minimum roll. |
| 133 | + |
| 134 | +If after a mission or two Lobsters still feel oppressive, add `--with-armor-hp`. |
| 135 | +If early rookie deaths are still rough, add `--with-weapon-power`. |
| 136 | + |
| 137 | +--- |
| 138 | + |
| 139 | +## Files |
| 140 | + |
| 141 | +| File | Role | Touched by | |
| 142 | +|------|------|-----------| |
| 143 | +| `cape_cod_patch.py` | the patcher | — | |
| 144 | +| `tftd/UFO2EXE/TACTICAL.EXE` | battlescape (damage math) | Phase 1 | |
| 145 | +| `tftd/UFOEXE/GEOSCAPE.EXE` | strategy layer (unit stats) | Phase 2 | |
| 146 | +| `tftd/GEODATA/OBDATA.DAT` | item/weapon stats | Phase 3 | |
| 147 | +| `*.capecod.bak` | automatic backups | created on first write | |
| 148 | + |
| 149 | +## Technical notes (for the curious) |
| 150 | + |
| 151 | +- Lobster resistances live in a damage-modifier table in `TACTICAL.EXE` at file |
| 152 | + offset `0x61478` (just past a `26` marker). It is row-major: each row is one |
| 153 | + damage type, 14 columns are unit types, and **Lobster Man is column 10**. |
| 154 | +- Lobster per-rank stats live in `GEOSCAPE.EXE` from `0x770dc` as six 39-byte |
| 155 | + records: armor (front/side/rear/under) at the start, **health at offset +31**. |
| 156 | +- `OBDATA.DAT` is 80 records × 54 bytes; **weapon power is at record-relative |
| 157 | + offset 22**. The Sonic Clip is record 39. |
0 commit comments