# Sealed Orders (assassinationKit): Assassination Contracts, Opportunities, Exits and Ratings Kit
**Turn any stealth level into a sandbox assassination mission.** You write a contract as one data file: the target (or targets), their portrait, their daily round and the guards who shadow them, the intel players can overhear, read or talk out of people, the opportunities (little chains of find → prepare → trigger that end in a staged accident or an opening), the exits (some locked until earned), the start points, outfits and gear. Sealed Orders runs the rest.
The package is `assassinationKit` (`require("assassinationKit.api")`); "Sealed Orders" is its display title.
- **Contract select, briefing and debrief**, drawn by the **missionScreens** package (Mission Dossier). Select shows every contract (two looks: **notice board** `board` or simple **list** `list`); the briefing shows the portrait, intel you already know and the start, outfit and gear you pick; the debrief shows every rating line, the grade, mastery progress and what you unlocked. Briefing and debrief come in three looks: **paper scroll** `scroll`, **case-file board** `caseBoard` and **compact phone card** `card`. Five styles in all, each switched with one setting.
- **Intel** from overheard conversations (earshotKit), notes and letters (loreKit), conversations (dialogueKit) or searching a place. Intel reveals an opportunity, points out the target, or opens an exit.
- **Eight opportunity kinds**: `poison` (a drink or meal), `heavyDrop` (something heavy falls), `riggedSwap` (swap in a rigged item), `impersonate` (take the place of someone the target meets), `lure` (draw him somewhere quiet), `sabotage` (what he rides or leans on), `guardAway` (send a guard off), `doorOpen` (leave a door open).
- **Five exit kinds**: `boat`, `cart`, `gate`, `rope` (rope or rooftop), `hatch` (hidden hatch).
- **Bloodless kills**: a kill is shown as an impactFrames ink-splash frame in sepia ink, never blood. **Knock-outs are always possible and never cost you grade.**
- **Run record and rating**: seen, alarms, bodies found, innocents killed, guards killed, knock-outs, accidents, disguises worn, time against par and the exit used become rating lines with bonuses and penalties, then a grade. The points are scored on **scoreKit**: each line goes through a scoreKit rules player (`Rules.add` for the base line and penalties, `Rules.bonus` for named bonuses) and the tiers come from scoreKit's grade lines (`Rules.rate`). **Four rating tables**: `ranks` (named ranks), `letters` (S to D), `pointsStars` (points with zero to five stars) and `team` (one co-op grade for the whole crew).
- **Mastery per contract**, saved per player in saveKit: replaying with a better grade earns experience and levels that unlock new start points, a starting disguise and gear.
- **Co-op multiplayer**: every player sees the same targets, opportunity progress, open exits and intel, also a player who joins late. Each player keeps their own record, disguise and gear; the `team` table grades the crew as one.
- **Two languages**: English and Brazilian Portuguese (see *Languages* below). Every word players read can also be renamed by your game.
- Keyboard and mouse, gamepad and touch; desktop and browser.
It is the glue. The guards, awareness and alerts are stealthKit and aiKit; bodies, hiding and alarms concealKit; takedowns takedownKit; disguises disguiseKit; the crowd townsfolkKit; overheard talk earshotKit; notes loreKit; conversations dialogueKit; prompts interactKit; items inventoryKit; tracker, markers and toasts navUiKit; saves saveKit; scoring scoreKit; the ink frame impactFrames; walkable paths navKit; the screens missionScreens. How much of the kit is these parts, and how well each served, is measured in `reuse-review.md` in this package.
## Install
Search ZeroMind for **assassinationKit** (or *Sealed Orders*) and install it, or by its guid:
```
zero zeromind installAsset 893f259e-9600-4848-8da0-b3cf709c9c4f
```
It brings every kit it needs, about forty packages, so a fresh install takes several minutes.
## Quick start
1. Install the kit (above).
2. In your scene build, place the mission and the people (the example guide has the whole scene, with the NavMap the guards walk on, the alert director and the caption settings):
```lua
local SO = require("assassinationKit.api")
local TD = require("takedownKit.api")
-- the target: a takedown-able character the mission walks round his day
TD.guard({ 0, 0, 8 }, { name = "Mayor Quill", preset = "hideGuard", target = { profile = "boss" } })
TD.guard({ 2, 0, 9 }, { name = "Quill's Guard", preset = "hideGuard" })
-- named places: plain entities the contract refers to by name (on solid ground: a 50 m starter ground ends at z = -25)
for name, p in { ["Town Well"] = { 0, 0, 7.8 }, ["Bakery"] = { 10.6, 0, 4 }, ["Flower Box"] = { 11.6, 0, 6.2 },
["South Gate"] = { 0, 0, -22 }, ["Market Start"] = { -8, 0, -12 } } do
entity.spawn(name, { position = p })
end
SO.place({ contract = "mayor_quill", rating = "letters", screens = "scroll" })
```
3. Write `contracts/mayor_quill.data/values.yaml` anywhere in your source (it replaces the kit's bundled example of the same id):
```yaml
contract: assassinationKit.contract
values:
id: mayor_quill
title: "The Mayor's Last Errand"
location: Hollowmere
brief: "Mayor Quill sells the town's wells. Make it look like bad luck."
targets:
- id: quill
name: Mayor Quill
guards: ["Quill's Guard"]
routine:
- { at: Town Well, stay: 40, doing: "greets the voters" }
- { at: Bakery, stay: 35, doing: "buys his bun" }
opportunities:
- id: flowerbox
kind: heavyDrop
title: The Loose Flower Box
at: Bakery
steps:
- { id: loosen, kind: prepare, text: "Loosen the flower box", at: Flower Box, hold: 3 }
- { id: drop, kind: trigger, text: "Push it when he is below", at: Flower Box }
exits:
- { id: gate, kind: gate, title: South Gate, at: South Gate }
starts:
- { id: market, title: Market, at: Market Start }
```
Press Play: the contract briefing opens, you pick your start, and the mission runs. `SO.problems()` lists anything wrong in a contract, naming the field.
## Swapping parts: one way for everything
```lua
SO.configure({ rating = "pointsStars", screens = "caseBoard", select = "list" }) -- the world's choice
SO.list("opportunity") -- poison, heavyDrop, riggedSwap, impersonate, lure, sabotage, guardAway, doorOpen
SO.define("exit", "balloon", { title = "Balloon", verb = "Cut the ropes", leaving = "You drift away over the roofs." })
SO.define("rating", "mine", { title = "My table", rate = function(facts, contract) ... end })
SO.words({ contract = "Job", opportunity = "Angle" })
```
The same five families (`opportunity`, `exit`, `rating`, `screens`, `select`) are what the Mission component's `rating`, `screens` and `select` fields pick from. `SO.rate(record, contract, table)` and `SO.teamRate(records, contract, table)` grade a record from code; `SO.mastery(id)` and `SO.masteryChoices(contract)` read a player's mastery.
## Languages
The kit's own words live in its catalogs `locales/en/` and `locales/pt-BR/` (namespaces `sealedorders` for words and screen lines, `sealedorders_rating` for rating lines and tier names, `sealedorders_example` for the bundled example contract). Players see the language they picked.
Text written as data is translated the same way: any text field in a contract, an opportunity or an exit may be a catalog reference written `"@<namespace>.<key>"`, and it reads in the player's language. Put the lines in your world's `/locales/en/<namespace>.json` and `/locales/pt-BR/<namespace>.json`:
```yaml
title: "i18n:one_bad_captain.title" # reads one_bad_captain.json -> "title"
```
Anything that is not a `i18n:namespace.key` reference shows as written. `SO.words({ ... })` renames a word for the whole game and a contract can rename words for itself; a renamed word can itself be a `i18n:namespace.key` reference.
## Make a contract with the workflow
The workflow `make-an-assassination-contract` takes a target idea to a contract played through twice: it designs the target, routine, guards, places, intel, opportunities and exits, writes the contract and intel files, wires the scene, checks it, then plays it quiet and loud to prove the grade. Start it with:
```
zero workflow start --name make-an-assassination-contract --args '{"target":"a toll-keeper who drowns debtors"}'
```
All args are optional (`target`, `id`, `scene`, `setting`, `opportunities`, `rating`, `screens`); its README lists them.
## Guides
- `how-to-make-an-assassination-contract-with-targets-opportunities-and-exits`: every field, every kind, how intel, steps and exits fit.
- `example-build-a-one-target-assassination-mission-from-an-empty-world`: an empty world to a playable one-target mission in about 15 minutes.
## Events
`SO.on(name, fn)`: `phase`, `intel {id, by}`, `oppStep {id, step, by}`, `oppDone {id, by}`, `targetDown {target, how, by}`, `toast`, `fx`, `refused {reason}`, `exited {exit, result}`.
## Multiplayer
The peer that owns the Mission entity (the room host) applies every command and walks the targets; the shared state lives in the Mission's synced fields, so a late joiner sees everything. Each player's engine owns their own `assassinationKit.Agent` record. Disguise, gear and the record stay personal. Events reach every peer on the bus channel `sealedOrders:evt`; commands go to the host on `sealedOrders:cmd`.
## Dependencies
| package | what the kit uses it for |
|---|---|
| stealthKit | alert level, lure gear, sense view and HUD style |
| concealKit | kill, knock-out, body-found and alarm events; knock-out and revive for opportunities |
| takedownKit | knock-out and lethal takedowns (the scene builds targets and guards with `TD.guard`) |
| disguiseKit | outfits, starting disguise, disguise record, badge |
| townsfolkKit | the crowd; townsfolk people count as civilians |
| aiKit | target and guard routes, the spotted event, concealment while leaving |
| navKit | walkable points for routine stops |
| earshotKit | overheard conversations that grant intel |
| loreKit | notes and letters that grant intel |
| dialogueKit | conversations that grant intel |
| interactKit | every step, search and exit prompt |
| inventoryKit | opportunity items and starting gear |
| navUiKit | tracker, target and exit markers, toasts |
| saveKit | mastery saved per player |
| scoreKit | rating line points and grade tiers |
| impactFrames | the ink-splash kill frame |
| missionScreens | select, briefing, debrief and leaving screens, five styles |
Optional, used when installed: controlsKit (which device a player is on, for the HUD layout) and juiceKit (ink droplets, dust, splash and shake in the kill moment and accidents).
## Performance
What was measured, and on what (2 December 2026, the showcase scene `scenes.oneBadCaptain`, a live run with the full crowd, guards and HUD):
| Where | Median frame | Average frame | Worst 1% | How |
|---|---|---|---|---|
| Desktop, the native editor window (1920x1080), playing alone, after the harbour finished loading | 25.5 to 27.8 ms (about **36 to 39 fps**) | 31 to 33 ms (about 30 fps) | 103 to 108 ms | engine profiler, three 20-second windows |
| Web, the browser build in headless Chromium (1280x625) | 29.3 ms (about **34 fps**) | 34.3 ms (about 29 fps) | 106 ms | engine profiler, one 20-second window |
**The 60 fps desktop target is not met.** These numbers come from one development machine that was running the editor, two more engine instances and a headless browser at the same time, on a development build of the engine. The profiler shows about a third of each desktop frame spent waiting for a free CPU core, so a player's machine running only the game should do better. This was not measured.
Where the desktop frame goes, after the harbour has settled: the engine's sky-visibility pass (about 4 ms), Luau garbage collection (2 to 8 ms, depending on the window), disguiseKit, the townsfolk and bodies (each 1 to 3.5 ms), and the camera follow. The kit's own mission code is below the profiler's top costs. The mission host runs at ten steps a second, and the harbour's road, village and launch hull are held on their finished frame instead of re-running their build every frame (that alone saved about 3 ms a frame).
Measure on your own machine: `zero profiler ring on`, play for 20 seconds, then `zero profiler retro --seconds 20`.