Total Annihilation Web Remake
Next.js-based RTS game with Three.js 3D rendering, seeded map generation, and spatial unit controls.
An in-browser Real-Time Strategy remake inspired by the classic Total Annihilation. Built on Next.js with Three.js 3D rendering, it demonstrates core RTS mechanics including procedural map generation, multi-unit selection, pathfinding commands, and camera controls.
- Next.js 15
- React 19
- Three.js 0.173
- react-three-fiber 9.0-rc
- @react-three/drei
- seedrandom
- Tailwind CSS
- Socket.IO 4.8 (installed; not yet used)
This is a working prototype toward recreating the Total Annihilation experience in the browser, with 100x100 tile maps procedurally generated using seeded randomness, 3D terrain rendering, and live unit movement. The project prioritizes performance-conscious architecture: a single-commit foundation focused on getting the core gameplay loop runnable quickly rather than pursuing a large polished codebase.
The engine uses react-three-fiber to drive Three.js rendering tied to React state. The map is generated with seedrandom for reproducible terrain, each tile type (grass, metal, etc.) colorized and positioned with per-vertex height variation. Units are cubes with automatic pathfinding: selected groups respond to movement commands via right-click target points or curved stroke-drawn routes, spreading automatically to avoid overlap.
Notable technical choices include instanced rendering for tile performance, raycasted mouse input for reliable 3D hit detection, and a throttled update loop for drawing paths. The selection system projects 3D unit positions into 2D screen space to perform drag-box selections, accounting for canvas offset and viewport transforms. This is a deliberate prototype, not a polished game: it validates that large unit counts and real-time 3D rendering are feasible in a modern browser.
- Procedurally generated 100x100 tile maps with seeded randomness (seedrandom) and per-tile height variation
- Multi-unit selection with box-drag and individual click-to-select; Shift+click for additive selection
- Curved movement commands: draw curves with right-click-drag to send selected units along a splined path, auto-distributed along the curve length
- Full camera control: mouse-wheel zoom (1–50 units), middle-drag pan, arrow keys with Shift speedup, all zoom-aware for consistent pan speed
- Raycasted mouse input with per-frame throttling for reliable 3D selection and ground interaction (30 Hz update rate)