Skip to content

Prove a step with a check ​

You give a step a check: a question the game asks the machine, read only, that answers yes or no. When it says yes, the step turns green on its own; if it stops being true later, the quest reopens (the experience stays won). The player never has to say "I did it".

Before you begin 10 minutes

  • A quest pack that passes alta lint: the quickstart makes one, my-pack.
  1. Prove a file

    A check step shows only its check. The file type passes when that path exists under the player's home folder (~/). Write a hint that says what to do: the step updates by itself when the file appears.

    A check only reads, and never sends back what it read: here, only whether the folder exists.

    my-pack/checks.json
    json
    {
      "id": "projects",
      "kind": "check",
      "title": {
        "en": "A Projects folder in your home",
        "fr": "Un dossier Projects chez toi"
      },
      "hint": {
        "en": "Create ~/Projects: the step turns green on its own.",
        "fr": "Crée ~/Projects : l'étape passe au vert toute seule."
      },
      "check": { "type": "file", "path": "~/Projects" }
    }

    examples/quest-pack/checks.fragment.json#/quests/0/steps/0

  2. Prove a program

    The bin type passes when a program is installed. For a program the game knows, it also asks the program its version, so a broken install does not pass.

    my-pack/checks.json
    json
    {
      "id": "git",
      "kind": "check",
      "title": { "en": "Git is installed", "fr": "Git est installé" },
      "check": { "type": "bin", "name": "git" }
    }

    examples/quest-pack/checks.fragment.json#/quests/0/steps/1

  3. Prove an answer

    A choice step saves the player's answer under its saves key. An answer check passes once that key has an answer: use it to make a later step, or another quest, wait for the choice.

    my-pack/checks.json
    json
    {
      "id": "editor",
      "kind": "choice",
      "title": {
        "en": "Which editor do you use?",
        "fr": "Quel éditeur utilises-tu ?"
      },
      "choices": [
        {
          "id": "vscode",
          "label": { "en": "VS Code", "fr": "VS Code" }
        },
        { "id": "zed", "label": { "en": "Zed", "fr": "Zed" } },
        {
          "id": "other",
          "label": { "en": "Another one", "fr": "Un autre" }
        }
      ],
      "saves": "answers.workbench.editor"
    }

    examples/quest-pack/checks.fragment.json#/quests/0/steps/2

    my-pack/checks.json
    json
    {
      "id": "editor-known",
      "kind": "check",
      "title": {
        "en": "Your agent knows your editor",
        "fr": "Ton agent connaît ton éditeur"
      },
      "check": { "type": "answer", "key": "answers.workbench.editor" }
    }

    examples/quest-pack/checks.fragment.json#/quests/0/steps/3

  4. Prove from the map

    The game keeps a map of the player's system: modules, automations, agents, devices. The world type counts entities of a kind (in some states) between min and max; entity asks about one entity; automation, module and skill ask about one thing by its name.

    my-pack/checks.json
    json
    {
      "id": "one-automation",
      "kind": "check",
      "title": {
        "en": "At least one automation runs",
        "fr": "Au moins une automatisation tourne"
      },
      "check": {
        "type": "world",
        "kind": "automation",
        "state": ["running"],
        "min": 1
      }
    }

    examples/quest-pack/checks.fragment.json#/quests/0/steps/4

  5. Check the pack

    Save the complete example as my-pack/checks.json and check the folder. A check type the game does not know is refused: check.type. Each type has the fields it needs, listed with every other type on the check types page.

    my-pack/checks.json
    json
    {
      "schema": "alta.quests/0.3",
      "branch": "core",
      "quests": [
        {
          "id": "workbench",
          "uid": "core.workbench",
          "act": 2,
          "giver": "architect",
          "title": {
            "en": "Set up your workbench",
            "fr": "Installe ton établi"
          },
          "summary": {
            "en": "A folder for your projects, the tools you code with, and one automation that runs.",
            "fr": "Un dossier pour tes projets, les outils avec lesquels tu codes, et une automatisation qui tourne."
          },
          "reward": { "xp": 50 },
          "steps": [
            {
              "id": "projects",
              "kind": "check",
              "title": {
                "en": "A Projects folder in your home",
                "fr": "Un dossier Projects chez toi"
              },
              "hint": {
                "en": "Create ~/Projects: the step turns green on its own.",
                "fr": "Crée ~/Projects : l'étape passe au vert toute seule."
              },
              "check": { "type": "file", "path": "~/Projects" }
            },
            {
              "id": "git",
              "kind": "check",
              "title": {
                "en": "Git is installed",
                "fr": "Git est installé"
              },
              "check": { "type": "bin", "name": "git" }
            },
            {
              "id": "editor",
              "kind": "choice",
              "title": {
                "en": "Which editor do you use?",
                "fr": "Quel éditeur utilises-tu ?"
              },
              "choices": [
                {
                  "id": "vscode",
                  "label": {
                    "en": "VS Code",
                    "fr": "VS Code"
                  }
                },
                {
                  "id": "zed",
                  "label": {
                    "en": "Zed",
                    "fr": "Zed"
                  }
                },
                {
                  "id": "other",
                  "label": {
                    "en": "Another one",
                    "fr": "Un autre"
                  }
                }
              ],
              "saves": "answers.workbench.editor"
            },
            {
              "id": "editor-known",
              "kind": "check",
              "title": {
                "en": "Your agent knows your editor",
                "fr": "Ton agent connaît ton éditeur"
              },
              "check": {
                "type": "answer",
                "key": "answers.workbench.editor"
              }
            },
            {
              "id": "one-automation",
              "kind": "check",
              "title": {
                "en": "At least one automation runs",
                "fr": "Au moins une automatisation tourne"
              },
              "check": {
                "type": "world",
                "kind": "automation",
                "state": ["running"],
                "min": 1
              }
            }
          ]
        }
      ]
    }

    examples/quest-pack/checks.fragment.json

    Terminal
    sh
    alta lint my-pack
    Output
    text
    ok   my-pack/checks.json (quests)
    ok   my-pack/quests.json (quests)
    2 checked, 0 errors, 0 warnings

Try it

alta dev my-pack

Open the address it prints, press L for the quests, then open Set up your workbench. In the demo the game reads a pretend machine: some checks pass, others wait. Nothing reads your own files.

Demo: nothing is written on your machine.

Pitfalls ​

DoAvoid
A check for what the step changes on the machineA check that passes before the player did anything
A hint that says what makes the step passA check step with no clue for the player
Two steps with os when the path differs by systemOne path that only exists on macOS
answer to wait for a choiceanswer as the only proof of a daily quest

A check never returns a value it read, never a secret, and never a file's content. A service check only asks addresses on the player's machine (http://127.0.0.1:<port>). A per-system check table is refused: write one step per system, see One step per system.

Go further ​

What's next

Alta OS is open source (MIT).