One Hour: a low-resource skirmish RTS for Linux in the spirit of Zero Hour
One Hour is a compact real-time strategy game for Linux in the spirit of Command & Conquer: Generals – Zero Hour. You command one of two armies, Cyber or Clanker, on a single map against one to three AI opponents. There is no campaign, tutorial or multiplayer. It is written in C++17 with SDL2 only, and every sprite, the terrain, the font and every sound effect is generated at startup, so the game ships no asset files.
- Platform
- Linux
- Language
- C++
- Licence
- Not stated in the repository
- Requires
- g++ and make
- SDL2 runtime (libsdl2-2.0-0); SDL2 headers are vendored
- Run
./run.shfrom the repository folder
How do I run One Hour?
./run.sh # builds (first run only) and starts the game
./run.sh --scale 2 # force a UI scale (default: automatic)
./run.sh --size 1600x900 # initial window size
./run.sh --software # software renderer instead of the GPU
It needs g++, make and the SDL2 runtime (libsdl2-2.0-0). The SDL2 headers are vendored under third_party/, so no -dev package is needed, and Ubuntu 24.04 or later works out of the box.
What are the two armies?
| Army | Style | Tech structure and elite units |
|---|---|---|
| Cyber | Electric and optical: pulse rifles, laser and shock troopers, Photon Tanks, Volt Walkers, Railgun Tanks, Wraith Drones, Laser Turrets, Patriot Batteries. | Data Center: EMP Strike, Orbital Scan, and the Overclock Program that unlocks the Ion Lancer sniper and the Aegis Titan walker. |
| Clanker | Diesel and gunpowder: riflemen, RPG troopers, heavy gunners, Brute and Gatling Tanks, Rocket Launchers, Vulture Gunships, Gun Nests, Rocket Batteries. | Arms Lab: Shell Storm, Recon Flight, and Heavy Ordnance that unlocks the Grenadier and the Behemoth. |
Running out of power halves production and switches powered defences off, the same pressure that Zero Hour puts on a player.
How does the AI opponent decide what to do?
Each opponent runs a utility-driven commander: economy and power management, base layout that respects prerequisites, defences placed toward the enemy, threat assessment, army composition weighted against the observed enemy mix, and wave attacks that launch only when they outweigh the local defence. Two parts are learned online (src/brain.cpp): a logistic model that predicts whether an attack wave will trade favourably (the launch-or-hold decision), and per-unit-type regressions of value destroyed per credit given the enemy's infantry, vehicle and air mix (the production choice).
What it learns persists in ~/.local/share/onehour/brain.txt (override with ONEHOUR_BRAIN). --train N self-plays N games to train the brain, and --eval N pits the learned AI against the plain heuristic AI. Difficulty changes reaction time, aggression and starting cash.
How light is it on the CPU?
The README reports its own benchmark: ./build/onehour --bench renders 300 frames of an eight-minute four-army battle with the CPU-only software renderer in about 5 ms per frame and 65 MB resident memory, with startup under a second. The simulation runs at a fixed 20 Hz with interpolated 60 fps rendering, and the whole 80×80 terrain is baked once into a single 2560×2560 texture. These are the author's figures for one machine, not a measurement made for this page.
What are the main controls?
| Input | Action |
|---|---|
| Left click or drag | Select; double-click selects every unit of that type on screen |
| Right click | Move, attack, gather, repair or continue construction, set a rally point |
| A + click | Attack-move (S stops) |
| G, then click or drag | Guard an area, or gather supplies in an area |
| X, V, R | Strike power, map scan, Advanced Program (with a tech structure selected) |
| Space, F1, F11, F12 | Pause, help, fullscreen, screenshot |
Quick answers
- Does One Hour have multiplayer or a campaign?
- No. It is a single-map skirmish against one to three AI opponents, with no campaign, no tutorial and no multiplayer.
- Do I need a graphics card to play it?
- No. ./run.sh --software selects a software renderer instead of the GPU, and the README benchmarks that CPU-only path at about 5 ms per frame.
- Where does the AI keep what it learned?
- In ~/.local/share/onehour/brain.txt. Set ONEHOUR_BRAIN to use another file.
- Is One Hour a copy of Zero Hour?
- The README describes it as being in the spirit of Zero Hour, not as a port. It has no asset files at all, because every sprite and sound is generated by code at startup.