The RTS — StarCraft-Lite With a Real AI Opponent
Top-down strategy. Drag-select units. Build workers, soldiers, towers. The AI opponent runs a real build-order FSM and attacks at the 90s mark with escalating raids.
What this is
A top-down strategy game with orthographic camera, slight 30-degree tilt for depth. Procedural island map (value-noise heightfield, water mask, grass/sand/rock vertex coloring) with mineral patches scattered around two opposed bases. Drag-select units with mouse. Right-click ground to move, right-click enemy to attack. B opens build menu — workers (harvest minerals), soldiers (combat), towers (defense). The AI opponent follows a real build-order FSM: 7 workers → barracks → tower → 2nd barracks → soldier production, launches a 5-unit raid at the 90-second mark, then escalates by +2 every 60 seconds. When your units enter a 26-unit perimeter of its CC, it diverts soldiers to defend.
Why this is mind-blowing
StarCraft cost millions and shipped on three platforms. The core loop — economy, build orders, unit production, AI raids — is here in 1187 lines from one paragraph. The build-order FSM is the entire genre's brain.
Top-down RTS in three.js with orthographic camera. Procedural island
with mineral deposits, two starting bases. Drag-select units, right-
click to move/attack. Build workers, soldiers, towers. AI opponent
runs build orders and attacks waves. Destroy enemy command center
to win.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- AI build-order FSMs (7 workers → barracks → tower → 2nd barracks → soldier production) are how you make a one-paragraph RTS feel like a real game. The AI follows a strategy, not a script.
- The resource-supply-tech triangle is the entire genre's design. The model knew to build it from one paragraph.
- Drag-select with a screen-space rectangle + raycast for unit hits is the single mechanic that separates 'top-down game' from 'RTS.' Everything else flows from it.