# Daily and repeatable quests

> Quests that come back: each day, each week, or whenever the player wants, with a small reward each time.

You write quests that come back: a daily review, a weekly plan, an inbox sweep the player runs when they want. Each has a `type`, a rhythm, and a small reward; the machine proves each round, so a round is never won by a click.

**Before you begin (15 minutes)**

- A quest pack that passes `alta lint`: the [quickstart](https://docs.altasystem.ai/quickstart) makes one.
- A step proven by the machine: see [Prove a step with a check](https://docs.altasystem.ai/guides/quests/prove-with-checks).

### Choose the type

`type` says how a quest lives. Without it, a quest is a `campaign`: done once.

| `type` | Comes back | Reward |
|---|---|---|
| `campaign` | never | its `reward`, plus 10 per step |
| `instant` | never; one step | 10 to 30 |
| `daily` | each day or each week, at a local time | up to 60 a day for the whole branch |
| `repeatable` | when the player turns it in again | up to 30 |

An `instant` quest is one step and a small reward: a quick win.

```json [focus.game.json]
{
  "id": "pin-note",
  "uid": "focus.pin-note",
  "act": 1,
  "giver": "daemon",
  "type": "instant",
  "title": {
    "en": "Pin your focus note",
    "fr": "Épingle ta note de concentration"
  },
  "reward": { "xp": 15 },
  "steps": [
    {
      "id": "pin",
      "kind": "check",
      "title": { "en": "Create the note", "fr": "Crée la note" },
      "check": {
        "type": "file",
        "path": "~/Documents/focus/README.md"
      }
    }
  ]
}
```

### Reset it each day

A `daily` quest needs `reset`: `every` is `day` or `week`, and `at` is the player's local time, `HH:MM` (04:00 when left out). At that time the quest starts again, empty. A day the player skips costs nothing: there is no streak and no penalty.

At least one step must be proven by the machine: a `check` (not `answer`) or a mission.

```json [focus.game.json]
{
  "id": "evening-review",
  "uid": "focus.evening-review",
  "act": 2,
  "giver": "daemon",
  "type": "daily",
  "reset": { "every": "day", "at": "18:00" },
  "title": { "en": "Evening review", "fr": "Bilan du soir" },
  "requires": ["focus.first-block"],
  "reward": { "xp": 20 },
  "steps": [
    {
      "id": "write",
      "kind": "check",
      "title": {
        "en": "Write three lines in today's note",
        "fr": "Écris trois lignes dans la note du jour"
      },
      "check": {
        "type": "file",
        "path": "~/Documents/focus/today.md"
      }
    }
  ]
}
```

### Or each week

A weekly quest is a `daily` with `every: "week"` and a `weekday`, from 1 (Monday) to 7 (Sunday). Here a mission proves it: the step is done when the agent comes back with the week's priorities.

```json [focus.game.json]
{
  "id": "weekly-plan",
  "uid": "focus.weekly-plan",
  "act": 2,
  "giver": "architect",
  "type": "daily",
  "reset": { "every": "week", "at": "09:00", "weekday": 1 },
  "title": { "en": "Plan the week", "fr": "Prépare la semaine" },
  "reward": { "xp": 30 },
  "steps": [
    {
      "id": "ask",
      "kind": "mission",
      "title": {
        "en": "Ask for the week's three priorities",
        "fr": "Demande les trois priorités de la semaine"
      },
      "mission": {
        "brief": {
          "en": "Give me my three priorities for this week, one line each.",
          "fr": "Donne-moi mes trois priorités de la semaine, une ligne chacune."
        }
      }
    }
  ]
}
```

### Let the player repeat it

A `repeatable` quest is turned in by the player, then waits `repeat.cooldownS` seconds before the next round; `repeat.max` is the number of rounds in all, not per day. Its reward is 30 at most, and a step is proven by the machine.

```json [focus.game.json]
{
  "id": "inbox-sweep",
  "uid": "focus.inbox-sweep",
  "act": 2,
  "giver": "operator",
  "type": "repeatable",
  "repeat": { "cooldownS": 3600, "max": 50 },
  "title": { "en": "Sweep the inbox", "fr": "Fais le tri dans la boîte" },
  "reward": { "xp": 15 },
  "steps": [
    {
      "id": "sweep",
      "kind": "mission",
      "title": {
        "en": "Send the operator to sort new mail",
        "fr": "Envoie l'opérateur trier le courrier"
      },
      "mission": {
        "brief": {
          "en": "Sort the unread mail: urgent, later, archive. Tell me the urgent ones.",
          "fr": "Trie le courrier non lu : urgent, plus tard, archive. Dis-moi les urgents."
        }
      }
    }
  ]
}
```

### Give them a branch of their own

The daily quests of one branch give 60 experience a day in all, and the main branch already uses its share. Put your daily quests in a branch of your own: a game file (`alta.game`) with its acts, skills and quests, which reaches players as a [chart](https://docs.altasystem.ai/charts/guides/quest-pack).

```json [focus.game.json]
[
  { "id": 1, "title": { "en": "Make room", "fr": "Faire de la place" } },
  {
    "id": 2,
    "title": { "en": "Keep the rhythm", "fr": "Tenir le rythme" },
    "level": 2
  }
]
```

### Check it

Check the file. A daily quest without `reset`, one without a machine proof, or a branch whose daily quests give more than 60 a day is refused: [`quest.daily-reset`](https://docs.altasystem.ai/reference/errors#quest-daily-reset), [`quest.machine-proof`](https://docs.altasystem.ai/reference/errors#quest-machine-proof), [`branch.daily-xp-cap`](https://docs.altasystem.ai/reference/errors#branch-daily-xp-cap). A repeatable quest above 30 is refused too: [`quest.repeatable-xp`](https://docs.altasystem.ai/reference/errors#quest-repeatable-xp).

```sh [Terminal]
alta lint examples/quest-pack/focus.game.json
```

```text [Output]
ok   examples/quest-pack/focus.game.json (game)
1 checked, 0 errors, 0 warnings
```

**Try it:**

```sh
alta dev examples/chart-data/evening-pack
```

This chart adds a branch with a daily quest. Open the address it prints, press <kbd>L</kbd>, then the **Evening routine** tab: its daily quest says when it resets. The **Today** list gathers the daily quests of every branch.

## Pitfalls

| Do | Avoid |
|---|---|
| A step proven by the machine in every daily and repeatable quest | An `answer` or a manual step as the only proof |
| A small reward that adds up over weeks | A daily quest that gives more than a campaign step |
| `reset.at` in the player's local time | A time meant for one time zone |
| A cooldown that matches the task (an hour for an inbox) | A repeatable the player can farm in a minute |

Three more types are written by the game or by the player's tools, rarely by hand: `repair` (an entity of the map in error, proven by an `entity` check), `system` (a measure of the machine), and `personal` (a task of the owner). Their rules are on the [quests](https://docs.altasystem.ai/reference/standards/quests) page.

## Go further

- [Quests](https://docs.altasystem.ai/reference/standards/quests): `type`, `reset` and `repeat`, field by field.
- [Closed lists](https://docs.altasystem.ai/reference/standards/closed-lists#quest-types): every quest type.
- [Errors](https://docs.altasystem.ai/reference/errors#standard-quests): every rule of quests.

**Next:**

- [Package a quest pack](https://docs.altasystem.ai/charts/guides/quest-pack)
- [Send an agent on a mission](https://docs.altasystem.ai/guides/missions/send-agent)
- [One step per system](https://docs.altasystem.ai/guides/quests/per-os)
