> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-advanced-gang/configuration/tiers.md).

# Camp tiers and challenges

Configure the five camp tiers of CAS Advanced Gang System: prices, roster and stash sizes, challenge types, the pace and adding a tier.

{% code title="config.lua" %}

```lua
Config.Tiers = {
  { tier = 1, name = 'Wild Camp', cost = 0.0, stash = 0, members = 8,
    blurb = 'A fire, a tent and whatever you carried in.',
    purpose = '...',
    unlocks = { 'Campfire', "Leader's tent", 'Ledger table', 'Roster of 8', 'Treasury & ledger' } },

  { tier = 2, name = 'Established Camp', cost = 2500.0, stash = 300, members = 14,
    blurb = '...', purpose = '...', unlocks = { '...' },
    requires = {
      { type = 'members',        target = 5 },
      { type = 'heldDays',       target = 4 },
      { type = 'treasuryEarned', target = 6000.0 },
      { type = 'stashLaidIn',    target = 120 },
    } },

  -- tiers 3 to 5
}
```

{% endcode %}

## Tier fields

| Field      | Meaning                                                                                                              |
| ---------- | -------------------------------------------------------------------------------------------------------------------- |
| `tier`     | The tier number, counting from 1 with no gaps.                                                                       |
| `name`     | Shown wherever the tier is named.                                                                                    |
| `cost`     | Paid from the treasury to reach this tier.                                                                           |
| `stash`    | Wagon capacity at this tier, in items.                                                                               |
| `members`  | Roster size at this tier.                                                                                            |
| `blurb`    | One line under the tier name on the Upgrades tab.                                                                    |
| `purpose`  | What the tier is for, on the Upgrades tab.                                                                           |
| `unlocks`  | The list shown under "unlocks". It's text only. What a tier really unlocks is the structures whose `tier` equals it. |
| `requires` | The challenges. Leave out any you don't want, or leave `requires` out entirely.                                      |

## Challenge types

| `type`           | Counts                                                              | `target`   |
| ---------------- | ------------------------------------------------------------------- | ---------- |
| `members`        | Riders on the roster now                                            | riders     |
| `heldDays`       | Whole days since founding                                           | days       |
| `treasuryEarned` | Money paid in over the camp's life, less money drawn out            | amount     |
| `stashLaidIn`    | Goods laid in over the camp's life, less goods taken out or spoiled | items      |
| `structures`     | Structures standing now                                             | structures |
| `contestsHeld`   | Contests seen off                                                   | contests   |

Without a money framework, `treasuryEarned` and `stashLaidIn` are skipped. With `Config.Territory.enabled = false`, `contestsHeld` can never grow, so take it out of `Config.Tiers`.

## The pace

The defaults are tuned in weeks: tier III in two to three weeks and tier V in a season, for a gang of about a dozen. For a small or short-lived server, lower the targets. `heldDays` is the floor nothing else gets past, so it's the first number to cut.

## Adding a tier

1. Add an entry to `Config.Tiers` with the next `tier` number.
2. Give the structures it should unlock `tier = N` in `Config.Structures`.
3. Add its upkeep at index `N` in `Config.Upkeep.cost`.

The Upgrades tab shows every tier. Its layout was designed around five, so check it after adding more.
