Economy & Markets
Related: 37 — Economic map zones, 43 — Boundary zones, 08 — Inventory & storage, 22 — Chat & player trade, 18 — Unique items, 13 — Workers, 53 — Town market NPC price.
4.1 Building + clerk
- Building tag
market - Interior blueprint; NPC with
role: market_clerkand matching schedule labels - Fields on the building:
| Field | Meaning |
|---|---|
market_boundary_zone_ids |
Segment boundary_zones[].id values this hall participates in |
market_max_volume |
Escrow capacity (same volume model as town storage); blank = server default |
Player loop: enter hall → walk to clerk → interact → market panel.
4.2 Shared browse (boundary zones)
Each hall H has zone set Z(H). At hall B, visible listings are those held at any hall H where:
Z(H) ∩ Z(B) ≠ ∅
Disjoint zone lists → isolated markets. Overlap on one shared zone → shared book. See 43 — Boundary zones.
4.3 List / reprice / delist
- Seller chooses source: town storage vault (jurisdiction intersects hall zones) or on-person inventory
- Chooses pricing mode: Fixed (unit copper ≥ 1) or NPC price (mode only — 53)
- Sets quantity; Fixed also sets unit price
- Goods move into that hall’s escrow; volume counts against
market_max_volume - Seller may reprice Fixed lots or delist either mode; delist returns goods to chosen dest (storage or person); soft-fail if dest full
4.4 Buy (Fixed listings)
Browse listings visible under §4.2
Player buys apply only to Fixed listings; NPC-price lots are dump-queue only
Confirm unit price and line total (qty × unit)
Buy partial quantity or all
Choose dest: town storage or person
Settlement (atomic):
- Debit buyer bank for the listed line total
- Credit seller bank
total − tax - Sink tax (
LedgerCategory::Taxes) - Move qty from hall escrow to buyer dest
- Reduce or remove listing
Insufficient bank balance → reject (hard), unlike soft harvest tax.
NPC-price sweeps (phase schedule, FIFO, convenience fee, no hall tax) are specified in 53.
4.5 What may list
Stackable / template lots (crops, ores, mats, potions, and other listable templates). Equipment instance browse/inspect listings are a deferred extension — not required for the craft/farm → hall loop.
5. Goods logistics (storage + workers)
Workers → town storage vault (and/or chests)
Player at clerk → list from vault or person → hall escrow
Buyer → buy into vault or person
Delist → back to vault or person
- Town storage vaults are eligible when the storage building’s boundary/jurisdiction intersects the hall’s
market_boundary_zone_ids - Workers: route deposit/withdraw to owned chests/lodging or a
storage-tagged building vault - Craft/farm → market path: deposit to vault, then list at the clerk (no forced mass on the player’s back)
6. Crown sales tax
Tax zone covering the listing hall supplies market tax (see 37):
| Field | Meaning |
|---|---|
market_sales_tax_bps |
Basis points of sale total sunk to crown |
market_sales_flat_copper |
Optional flat copper per purchase |
Buyer pays the listed line total from bank; tax is taken from the seller’s proceeds and credited to the town treasury. Regional harvest tax (rate_bps) remains separate: the plot owner keeps owner_tax_share_bps, and the remainder of tax actually collected also credits the treasury.
7. NPC shops (dump valve)
NPC buys / sells YAML catalogs stay:
- Narrow template lists. The matching specialist pays the real price; a general broker pays the catalog pawn rate.
- Shop sell prices stay above that specialist buy, so a stack cannot be bought and sold back.
- Do not feed the player Fixed order book
Two dump paths use the same buy tables:
- Face-to-face shop sell at the NPC
- Hall NPC-price listings swept on schedule (53) — convenience fee instead of visiting each merchant
Worker BrokerSell continues to sell to NPC buy lists.
A gather is worth about 20 copper of goods per labor at full price (a log or an ore is 10, and a swing yields about two). The first process step pays about half again the raw buy: two logs or two ore become lumber or an ingot at 30. Later taught crafts pay about 30% over the input buy. Shop sells sit about 1.4× above the buy.
Each buyer has a daily purse (economy.daily_purse_copper, or the server default, 8000). Face-to-face sells and hall sweeps share one quote: full price for the first saturation_qty of that template today (default 80, one level-1 workday of a two-yield gather), then 0.55×, 0.20×, and 0.05× (still at least 1 copper). One sale walks those bands. It does not pay the opening price for the whole pile. The purse and the town treasury both cap the stack. Dawn resets spent copper and qty bought. A short treasury buys a partial stack or refuses. The Town tab on i shows settlement, treasury, tax where you stand, and each buyer’s purse and today’s prices.
Each boundary zone may set daily_budget_copper (43). After dawn, once per game day, the treasury is raised to the sum of those floors (the highest value per jurisdiction). A balance already above the floor, including harvest tax and hall sales tax, stays. Unconfigured zones add nothing. starter_town_boundary is 50,000 copper. The grant day is stored on the region snapshot, so a restart the same day does not pay it again.
8. Currency integration
| Action | Settlement |
|---|---|
| Hall purchase (Fixed) | Buyer bank debit; seller bank credit; tax sink |
| Hall NPC-price sweep | Town treasury → seller bank (convenience fee after the demand step); goods sunk; no hall tax |
| Hall list | Items escrowed (no coin until sale) |
| Direct trade | Physical items + coins in trade window |
| NPC shop | Physical coins / bank-first spend rules as elsewhere |
| Remote bank withdraw | Not allowed — coins physical only at bank branch (08) |
Uses the single character bank ledger (not per-jurisdiction balances).
9. Central authority & anti-cheat
| Responsibility | Owner |
|---|---|
| Escrow items during listings | Region worker + snapshot persist |
| Bank debit/credit + tax | Authoritative sim + ledger |
| Duplicate item prevention | Central mint/burn |
| Zone intersection browse | Deterministic from authored zone lists |
10. Client UX (gfx)
| Key | Action |
|---|---|
L |
List goods (source → stack → qty → Fixed price or NPC price) |
Tab |
Cycle listing category |
/ |
Search filter |
| ↑↓ / PgUp/PgDn | Select / page listings |
| Enter | Buy selected (confirm) or delist your own |
| Esc | Back / clear search / close |
Show labels over raw ids for halls, vaults, and templates. Capacity meter for hall escrow volume.
11. Design notes
Zone-linked halls keep isolated frontier towns and linked regional networks without a global auction house. Storage + worker deposit closes the craft/farm → market loop. NPC dump shops and hall NPC price mode prevent stuck inventory without destroying player Fixed pricing.
Crafted roadside player stalls and magical cross-region quote networks are out of scope — zone lists are the share/isolate tool.