Economy and building
For creatorsAdd-on 2.2.2+
You build a two-base map where workers mine crystals, raise buildings and train new units. It builds on units and orders and combat.
- Select workers and right-click crystals to gather.
- B, then a building’s key, to build: C Command HQ, D supply depot, R barracks, F factory. Click the ground to place it.
- Select a building and press a unit’s key to train it: W worker, T trooper, K hover tank.
- With a building selected, right-click to set its rally point. On crystals, new workers start gathering there.
- The orders of tutorial 16 still apply.
- Tap a worker, then tap crystals.
- The command card at the bottom left builds and trains. After a building button, tap the ground to place it.
What you get
Section titled “What you get”Each side starts with a Command HQ, six workers and 100 crystals, with eight crystal nodes behind the HQ. The red side does nothing yet: the next tutorial gives it a computer player.
Build it
Section titled “Build it”-
Start from your map. Keep the ground, the rock and the camera from tutorial 15. Add two scene tags:
rts.crystals = 100,100(each team’s starting crystals) andrts.cap = 400(the most units and buildings the map holds). -
Add the worker and the buildings to the unit table. A building is a unit that never moves: give it
building: 1, a footprint in cells (foot) and a speed of 0. Copy the rows in The economy table below intodata/units.json. -
Model them. Model a worker and the four buildings, and name them as the table’s
modelcolumn says:Model_Worker,Model_HQ,Model_Depot,Model_Barracks,Model_Factory. -
Place the crystals. Model a crystal node and copy it eight times behind each base. Give each one Add Component ▸ Shooter & Strategy ▸ Crystal Node. Its
rts.resourceis the crystals it holds (500). -
Start each side. In
data/start.json, give each team onehqand sixworkerrows near its crystals. -
Update the help lines. Change the HUD lines to the building and training keys.
-
Press ▶ Play. Box-select your workers, right-click the crystals, then press B and D and click a clear spot. A worker walks over and a depot rises.
The economy table
Section titled “The economy table”| Row | cost |
supply |
buildTime |
Notes |
|---|---|---|---|---|
| worker | 50 | 1 | 8 s | gather: 5 crystals a trip after mineTime: 2 s of mining |
| trooper | 50 | 1 | 10 s | |
| hover tank | 150 | 3 | 20 s | |
| Command HQ | 400 | 60 s | foot: "4,4", provides: 10 supply, produces: worker, dropoff: 1 (takes deliveries) |
|
| supply depot | 100 | 20 s | foot: "2,2", provides: 8 supply |
|
| barracks | 150 | 30 s | foot: "3,3", produces: trooper |
|
| factory | 200 | 40 s | foot: "3,3", produces: tank, requires: barracks |
Give every row a hotkey (the key that builds or trains it) and an hp and sight, as in tutorial 16.
How the economy plays
Section titled “How the economy plays”- Buildings are units. They have a team, health and sight. You can select them, and enemies can target and destroy them. Their footprint is solid, so units walk round them, even one placed across a path. Armies fight units first, then buildings.
- The worker’s round. A worker walks to a node, mines for two seconds, carries five crystals to the nearest finished HQ, and goes back. A node shrinks as it is mined and disappears when empty; its workers move on to the nearest node with crystals left. Workers on the job pass through each other, so a mining line never jams.
- Building. The worker walks to the site, and the building is placed and paid for when it arrives. If the ground is no longer clear, or the crystals are gone, nothing is built and nothing is spent. The site rises from a pad in its team’s colour, and its health grows with the work, so a site under fire is fragile.
- Training. A building queues up to five units. Cost and supply are charged when you queue. The unit appears beside the building when its time is up and walks to the rally point.
- Supply. Finished buildings provide supply, up to 100. Living units and queued units use it.
- Nothing is lost on a refusal. An order that can’t happen (rock, too few crystals, no barracks yet, full supply, a full queue) is refused at no cost.
The command card
Section titled “The command card”- The resource bar shows your crystals and supply.
- Select workers and the card shows a button per building, with its cost and key. A button you can’t use yet is greyed; hover it for the reason, such as needs barracks.
- Select one finished building and the card shows a button per unit it trains, its queue with the first unit’s progress, and its rally point.
- Placing. A ghost of the building follows the cursor, snapped to the grid. It is green where every cell is free and you can afford it, and red where not. A click on red places nothing. The nearest selected worker takes the job.
Settings
Section titled “Settings”| Tag | Values | What it does |
|---|---|---|
rts.crystals |
100,100 |
Each team’s starting crystals |
rts.cap |
default 400 |
The most units and buildings the map holds, including those trained later |
rts.resource |
crystals, default 500 |
On a crystal node: what it holds |
Next: a game against the computer.