Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scorched Earth - Python Port

A faithful Python and pygame reimplementation of Scorched Earth v1.5 (1995, DOS), the turn-based artillery game written by Wendell Hicken. It runs the original's tank combat on modern hardware, reconstructed from a static reverse-engineering of the original DOS binary.

Credit: the original game and its author

Scorched Earth, subtitled "The Mother of All Games," was created by Wendell Hicken and distributed as shareware for DOS. The original game is Copyright (c) 1991-1995 Wendell Hicken. All rights to Scorched Earth, including its name, artwork, sound, and original source code, belong to him. His site is whicken.com.

This project is an independent, non-commercial tribute. It is not affiliated with, endorsed by, or supported by Wendell Hicken. It contains none of the original game's code, sprites, sound files, or data; it reimplements the game's behavior from analysis of how the original works. The game design is entirely his. This port only re-expresses it in Python so the game can run natively today.

If you want the genuine article, seek out Wendell Hicken's original.

What this port is

A function-for-function reconstruction. The program flow, physics force model, damage rules, terrain model, weapon table, economy, scoring, and AI follow the recovered originals. Modules carry the FUN_<seg>_<off> and DAT_<seg>_<off> provenance of the routines they reverse in their comments, and an equivalence test suite (tests/test_re_equivalence.py) cross-checks the port against the recovered reference for the core systems.

The original binary is never executed. The port was built entirely from static analysis (decompiles and byte reads). Nothing in this repository runs the DOS program.

Screenshots

The title screen:

Main menu

A round in progress, with destructible terrain, two tanks, the wind indicator, and the HUD:

Gameplay

The between-rounds weapons shop:

Weapons shop

End-of-round rankings, and the game-over screen with one of the original's war quotes:

Round rankings

Game over

Requirements

  • Python 3
  • pygame >= 2.6
  • numpy >= 1.26
pip install -r requirements.txt

macOS

On CPython 3.9 through 3.13, pip installs a prebuilt pygame wheel and no extra steps are needed. On newer interpreters (3.14+) PyPI has no pygame wheel yet, so pip builds pygame from source, which needs the SDL2 headers first (roughly 450 to 600 MB, per the official build guide):

brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf pkg-config

Thanks to @js-compilatrum for reporting this (#1).

Running

python play.py                # windowed
python play.py --fullscreen   # full screen

play.py re-execs into the project virtual environment (../.venv) automatically if pygame and numpy are not present on the current interpreter. The ./scorch.sh launcher does the same.

Controls

Input Action
Left / Right arrows aim the turret (0 = east, 90 = up, 180 = west)
Up / Down arrows adjust firing power
Tab cycle to the next weapon
Space or Enter fire
Number keys select a tank by number
F11 or Alt+Enter toggle full screen
Esc back out of a screen / dismiss a panel
Mouse menus, the shop, and the in-game control panel (battery, parachute, shield)

Menus: Up/Down to select, Left/Right to change a value, Enter to start. The shop (between rounds, when starting cash is enabled) buys and sells with the mouse or the keyboard.

How the code is organized

Module Reverses
constants.py byte-verified constants (physics, damage, scoring, color bands)
config.py the scorch.cfg keys and the enum orderings
terrain.py the pixel framebuffer, terrain generation, and carve / deposit / settle
physics.py the projectile integrator (gravity, wind, viscosity, speed clamp)
weapons.py the 48-item equipment table (costs, bundles, blast values)
weapon_behaviors.py rollers, diggers, sandhogs, MIRV split, laser, funky, dirt, riot
damage.py the radial damage law, direct-hit kill, shield gate, fall damage
ai.py the seven computer types, the aiming oracle, and the buyers
economy.py the shop, the free-market pricing, sell-back, interest, and annuity
scoring.py the scoring modes and the end-of-round rankings
game.py the round loop, turn loop, fire / impact pipeline, and win test
render.py, ui.py, screens.py, ingame.py rendering, HUD, menus, shop, dialogs
sprites.py, palette.py, sound.py the recovered art, color tables, and PC-speaker audio
main.py the application state machine and input handling

Fidelity

Most systems are reconstructed from byte-level analysis and confirmed against the original's behavior: the physics force model and integration order, the linear damage falloff and fall damage, the destructible pixel terrain, the 48-item weapon table, the free-market economy and scoring, the AI type bindings, the per-tier shield values, the .MTN terrain decoder, and the per-design tank sprites. The equivalence suite reports 12 of 12 core systems matching the recovered reference.

Values that do not appear anywhere in the binary or the original manual are reconstructed and flagged as such in the code comments. A few effect handlers sit in the original's floating-point-emulator regions, where the decompile is unreliable; those are noted at their call sites and reconstructed from the surrounding code.

License and use

The Python code in this repository is the authors' own work and does not grant any rights to Scorched Earth itself. Game mechanics and rules, as distinct from a specific implementation, artwork, and audio, are generally understood not to be protected by copyright in the US; this port reimplements only the mechanics and ships none of the original's protected assets. Scorched Earth and all of its assets remain the property of Wendell Hicken. Please treat this as a personal, non-commercial tribute for play and study.

About

Python/pygame reimplementation of Wendell Hicken's Scorched Earth v1.5, reconstructed from reverse-engineering. A non-commercial tribute.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages