PUBLIC REPOSITORY
By Batty 251 (@batty-251) · Licence: MIT · 1 published version · 28 files · 2.2 MB of source · Last published 2026-09-27
A public project on CodeRook. Browse it at https://coderook.com/batty-251/outpost-command.
A 3D sci-fi colony management RTS that runs in the browser. You are the administrator
of a stranded outpost on the alien world of Arcadia Minor: mine crystal deposits,
feed your colonists, keep the power grid alive, and finish the Orbital Uplink to
call for rescue.
Built with Three.js, no build step, no external assets — every building and the whole
terrain are generated procedurally in code.
Windows: double-click start.bat.
Any platform, from a terminal:
node server.jsthen open <http://localhost:5173>.
Use a local server rather than opening index.html directly — the game uses ES modules,
which browsers block over the file:// protocol.
Three.js is vendored in vendor/three/, so the game runs completely offline.
Installing packages (npm install) is only needed if you want to refresh that copy.
| Action | Control |
|---|---|
| Pan the camera | W A S D / arrow keys, right- or middle-drag, or push the screen edge |
| Zoom | Mouse wheel |
| Rotate / tilt the view | Q / E |
| Focus on a selection | F |
| Open the build bar | B |
| Pick a structure | 1 – 7, or click it in the build bar |
| Place | Left-click · Esc or right-click cancels |
| Select a structure | Left-click it |
| Demolish the selection | X |
| Pause | Space · fast forward with Shift+1/2/3 |
| Save / load | Buttons at the bottom (saved in this browser) |
Win: complete the Orbital Uplink (1400 credits, 700 metal, 55s build, 25kW).
Lose: run out of food and let the colony starve out.
The opening is tight on purpose. You have 210 food for six colonists (about 13 minutes
of eating) and the hub alone will not earn the 170 credits for a farm quickly, so the
extractor comes first. Do nothing and the colony is lost in about 13 minutes.
index.html markup + import map for Three.js
styles.css the whole interface
server.js zero-dependency static server
start.bat double-click launcher
src/
main.js bootstrap, game loop, input wiring
core/
config.js ALL balance numbers and building definitions
gameState.js the simulation: resources, power, staffing, win/lose, save/load
world/
terrain.js noise heightmap, vertex-coloured ground, crystal deposits, queries
scene.js renderer, twin-sun lighting, sky dome, starfield
cameraRig.js RTS camera: focus point + yaw/pitch/distance
render/
buildingMesh.js procedural mesh for each structure type
buildingView.js keeps meshes in sync with the simulation, animation
systems/
placement.js grid snapping, validity rules, ghost preview, build range
input.js keyboard, mouse, drag, zoom
ui/
hud.js resource bar, colony panel, inspector, toasts, float labels
buildBar.js the construction catalogue
minimap.js terrain relief + live overlays
tests/
economy.test.js headless simulation tests (npm test)Nearly every number worth adjusting is in src/core/config.js: costs, power draw,
yields, population rates, camera feel, terrain size and palette, and the wholeBUILDINGS catalogue. Adding a new structure means adding an entry there and a mesh
factory in src/render/buildingMesh.js.
npm testRuns the headless colony simulation tests — starting state, power and staffing
shortfalls, population growth limits, starvation and defeat, victory, demolition
refunds, save/load round-tripping, metal consumption throttling and storage caps.
These do not need a browser.
There is also a balance probe you can point at your own build orders:
node tests/balanceProbe.mjsIt plays several scripted orders to completion and prints when the colony is lost or
the Uplink finishes, which is how the current numbers were tuned. Edit the probe([...])
calls at the bottom of the file to try your own strategy.
This project is backed up to CodeRook as the projectoutpost-command (private), using its cbx command line. CodeRook is not git —
it saves the whole folder as a complete snapshot (a version), so there is no staging
area, no branches and nothing to rebase.
One-time setup on a new machine
npm install --global @coderook/cli # provides the cbx commandThen sign in. cbx sign-in needs a personal access token, which you create in your
account settings on coderook.com:
tools\coderook-signin.bat # asks for the token with the input hiddenThe token is stored in your own user config (%APPDATA%\CodeRook), never in this folder,
which is why it can never end up in a saved version.
Saving a change
cbx status # what is here that is not saved yet
cbx submit -m "what changed" # save it as a new version
cbx submit -n -m "..." # dry run: show what would be sent, send nothing
cbx versions outpost-command # what has been savedRestoring the project on another machine:
cbx clone outpost-command outpost-commandcbx reads the ordinary .gitignore in this folder, so node_modules/ and .voxai/
are excluded and never uploaded.
Useful
cbx versions # what has been saved
cbx get # bring this folder up to date
cbx bundle . outpost-command.cbx # pack the whole project into one fileSaving is private by default: a new project starts private, and nothing is visible to
anyone else until you explicitly cbx release a version.
config.js.localStorage, so it is per-browser, not a file on disk.PUBLIC REPOSITORY