# Structure rules (design 24.12; read by src/world/structures/Structures.cpp). See README.md in this folder for
# the format.
#
# A structure cell picks one rule by weight, then tries it and the others in a shuffled order, at a
# few spots each. Row order is part of the data: the pick walks the rows in file order and the
# shuffle draws once per row. Rows are StructureKind names; derelict outposts are research outposts
# taken over (35% of them, on a hash of their own), so they have no row.
#
#   weight       its odds against the other rules on the planet
#   dry weight   the weight instead where the planet's mean moisture is under `dry below`
#   radius       half the size of the ground it needs, blocks
#   flatness     most the ground may vary over it, blocks
#   attempts     spots tried per cell (relays need a hilltop, so they look harder)
#   needs        breathable living: only on worlds with breathable air and life over 0.3
#   start world  no: never on the start world, and its weight doesn't count there (so the start
#                world's ruins stay where they were before the kind was added)
#
# Step 30's kinds are appended after the old rows. Their code checks more ground of its own
# (structures/Places.cpp): farmsteads want mild, watered country; mining camps a rich deposit
# under them; abandoned mines hills or mountains over the middle ore band; sensor stations hills
# or plains; geothermal plants a steam vent close by (so only volcanic worlds have them).

[structure ResearchOutpost]
weight = 2.5
radius = 24
flatness = 8
attempts = 9

[structure CrashedShip]
weight = 1
radius = 16
flatness = 8
attempts = 5

[structure Ruins]
weight = 1.5
dry weight = 2.5
dry below = 0.3
radius = 17
flatness = 9
attempts = 5

[structure CommsRelay]
weight = 2
radius = 12
flatness = 5
attempts = 12

[structure Settlement]
weight = 2.5
dry weight = 4
dry below = 0.45
radius = 24
flatness = 8
attempts = 5
needs = breathable living

[structure TradingPost]
weight = 1.0
radius = 24
flatness = 5
attempts = 7
start world = no

[structure Farmstead]
weight = 1.8
radius = 26
flatness = 6
attempts = 7
needs = breathable living
start world = no

[structure ResearchDig]
weight = 0.5
dry weight = 0.8
dry below = 0.3
radius = 22
flatness = 9
attempts = 5
start world = no

[structure MiningCamp]
weight = 1.2
radius = 24
flatness = 7
attempts = 7
start world = no

[structure AbandonedMine]
weight = 1.0
radius = 20
flatness = 10
attempts = 6
start world = no

[structure SensorStation]
weight = 1.0
radius = 13
flatness = 5
attempts = 6
start world = no

[structure GeothermalPlant]
weight = 2.0
radius = 20
flatness = 8
attempts = 10
start world = no

[structure PirateCamp]
weight = 0.7
radius = 16
flatness = 7
attempts = 6
start world = no

[structure Freighter]
weight = 0.3
radius = 26
flatness = 9
attempts = 5
start world = no

[structure MilitaryWreck]
weight = 0.25
radius = 26
flatness = 9
attempts = 5
start world = no

[structure EscapePod]
weight = 0.3
radius = 10
flatness = 8
attempts = 5
start world = no

# Settlements still lived in (the abandoned ones' towns, whole), and the great ruins.
[structure Village]
weight = 1.2
dry weight = 2
dry below = 0.45
radius = 24
flatness = 8
attempts = 5
needs = breathable living
start world = no

[structure GrandRuins]
weight = 0.35
radius = 36
flatness = 10
attempts = 6
start world = no

# What a structure is built from where the air can't be breathed (airless, thin, toxic or
# scorching worlds): nobody frames a house in timber, thatches a barn, nails up sheet metal (and
# nothing rusts without air and water) or hangs a plain door there. Walls and roofs are sealed
# hull plate. Each block type on the left becomes the one on the right (its variants too, rusted
# sheet among them); `steel` is the site's steel truss. Furniture indoors stays as it is.
[harsh Materials]
Planks = DeckPlate
WoodLog = steel
Thatch = Hull
RoofTiles = Hull
Corrugated = Hull
Cobble = Concrete
Fence = steel
Door = ShieldedDoor

# The start system's settlements (section 3, step 30d): what its settlers built on its other
# worlds, never the start world. Each place goes in a structure cell at or round the middle of
# a world's first face, whatever the rules above say (a farm on a world without breathable air is
# built sealed, under glass). Worlds are taken nearest the start world first, among those whose
# gravity is at most `max gravity` (what the board's ships reach) and with a free cell (a small
# moon has none): each place on the next of them round, a farm on the nearest breathable world with
# life if there is one.
[start-system Settled]
places = TradingPost, MiningCamp, Farmstead
max gravity = 16

# Research outposts: a hub (the commons) with modules around it. The first two modules listed
# always come first; the rest are shuffled. Order is part of the data.
[outpost Research]
modules = Lab, Dorm, Greenhouse, Comms, Storage, Power

# Furniture along a module's walls, one row per module. Walls are taken in a random order, closed
# ones first: wall 1 holds the module's main pieces. Each list runs from the corners in, skipping
# the middle of an open wall, one piece per cell; "-" leaves a cell empty. The rest of a module
# (tables, beds, planters, crates, the reactor, roof fittings and who works there) is code, and a
# module lists only the walls its code doesn't furnish itself (a dorm's first wall holds its beds).

[module Commons]
wall 1 = Shelf, Shelf, Locker, Locker
wall 2 = Console, Console

[module Lab]
wall 1 = LabBench, LabBench, LabBench, LabBench, LabBench
wall 2 = ServerRack, Console, Console, ServerRack
wall 3 = Shelf, Locker

[module Dorm]
wall 2 = Locker, Locker, Locker, Locker
wall 3 = Shelf, Table, -, -

[module Greenhouse]
wall 1 = -, -, Shelf

[module Comms]
wall 1 = Console, Console, Console, Console, Console
wall 2 = ServerRack, ServerRack, ServerRack, ServerRack

[module Storage]
wall 1 = Shelf, Shelf, Shelf

[module Power]
wall 1 = ServerRack, Console, ServerRack

# ---------------------------------------------------------------------------------------------
# Places with people (design 20.1, step 30; read by src/world/structures/Places.cpp). Each kind's
# code lays it out and names what a row fills: its rooms, its counters and its people's posts.
#
#   name         what follows the syllable name ("Kestrel Trading Post"); one is picked
#   ROOM         pieces along the room's back wall, in order ("-" leaves a cell empty)
#   shop COUNTER the shop the counter sells from: a [shop KIND] of assets/data/prices.txt
#   person       ROLE at POST, or ROLE at POST x N: who works there and where, in order. Roles:
#                Trader, Barkeep, Farmer, Archaeologist, Prospector, Technician, Director...
#
# Trading posts: rooms market, cantina; counters market, cantina; posts market, cantina, yard.
[place TradingPost]
name = Trading Post, Trade Post, Exchange, Market
market = Shelf, Crate, Shelf, Barrel, Shelf, Crate, Shelf, Locker, Shelf
cantina = Shelf, CookStation, Barrel, Shelf, Barrel
shop market = tradingpost
shop cantina = cantina
person = Trader at market
person = Barkeep at cantina
person = Prospector at yard x 2

# Farmsteads: rooms house, barn; counter house; posts house, fields.
[place Farmstead]
name = Farm, Homestead, Farmstead, Acres
house = Shelf, CookStation, Shelf, Locker
barn = Crate, Crate, Barrel, -, Crate, Barrel, Crate
shop house = farmstead
person = Farmer at house
person = Farmer at fields

# Research digs: rooms lab, store; counter lab; posts lab, trench, camp.
[place ResearchDig]
name = Excavation, Dig Site, Field Camp
lab = LabBench, LabBench, ServerRack, Shelf, LabBench
store = Crate, Crate, Crate, Crate, Crate
shop lab = dig
person = Archaeologist at lab
person = Archaeologist at trench x 2
person = Technician at camp

# Mining camps: room office; counter office; posts office, pit, rigs. Their rigs, conveyors,
# crates and power are code (a grid and a network of the camp's own).
[place MiningCamp]
name = Mining Camp, Dig Works, Quarry, Pit
office = Locker, Locker, Shelf, Crate, Shelf
shop office = miningcamp
person = Miner at office
person = Miner at pit x 2
person = Miner at rigs x 2

# Geothermal plants: room control; no counter; posts control, taps.
[place GeothermalPlant]
name = Geothermal Plant, Steam Works, Heat Station
control = Console, ServerRack, Console, Console, ServerRack, Console
person = Technician at control
person = Technician at taps

# Pirate camps: posts lookout, fire, tents. A lookout with a rifle, a leader by the fire and
# pistoleers at the tents (the gunmen of design 10.3; they shoot on sight).
[place PirateCamp]
name = Camp, Hideout, Roost, Den
person = Marauder at lookout
person = Enforcer at fire
person = Outlaw at fire
person = Outlaw at tents x 2

# Military wrecks: post guard, spots in a ring round the hull. The scavengers who got there first.
[place MilitaryWreck]
name = Wreck
person = Enforcer at guard
person = Marauder at guard x 2
person = Outlaw at guard

# Escape pods: post pod. Its survivor.
[place EscapePod]
name = Pod
person = Survivor at pod
