Menu
Sign inDownload

Engine link reference

The full contract between an engine and Comms Array.

The contract between Comms Array's core and a game's telemetry engine. The core owns this document; an engine follows it.

Finished views and described values. The service screens (the Cockpit tab, the setup checklist, the party line and feed, the service record, and the pad's strip, lamps and built-in panels) are finished views: the engine builds them in the formats below and the core draws them without knowing the game. Everything a player or an add-on builds with is a described value: the engine describes each value once (info.metrics), sends only the value and how fresh it is, and the core formats and colours it from the description, so every widget, built-in or custom, shows it the same way. Each game keeps its own value ids; nothing maps one game's values onto another's.

Two manifests

engine.json (at the top of the engine's package)info (the engine's hello, at run time)
Readby the core before the engine runs (consent first)once the engine process is running
Holdsid, name, version, engine_api, processes, consent, input_rules, run, authorwording, tags, metrics, layouts, sharing switches, ...
Wins onwhich programs mean the game is running and which windows may get key presses, the link versioneverything else

The engine's code never chooses where key presses go: processes in engine.json does.

Packages

An engine is a package: a zip with, at its top,

FileWhat
engine.jsonthe manifest below
hub.jsonits stats, boards, service record and party dashboard description. The hub requires it when you publish; the app doesn't read it
the codewhat run names

engine.json:

KeyTypeWhat
idstr^[a-z][a-z0-9_]{1,30}$, the engine's own id for good (its package, updates, settings, data folder and consent use it). On the hub, the first publish claims it
gamestrrequired, same rule as id: the game it serves. Everything the player keeps belongs to the game: its record, saved pad layouts, add-on permissions, personas, stats, world data and party cards. Two engines naming the same game share all of it; the player picks which one runs. Our engines: starcitizen, elite. Another engine for an existing game keeps that game's value paths, action ids and situation names, so its players' pads keep working
game_namestroptional: the game's name (else name). Say it when name is your engine's own name
namestrthe engine's name, shown to the player (ours use the game's name)
versionstrthe package's version (1.2.0): numbers compared as numbers. Also the version the engine says in info
engine_apiintthe link version it speaks (2)
authorstrwho made it, shown on the Games tab
processeslistthe game's program names (Game.exe): when one runs, the game is running; only these windows ever get key presses
consentdictterms_version (required; a new one asks the player again), notice, reads, never, places (which of personal / party / leaderboard / world the game offers; the link step asks about personal and, if offered, world before the engine runs)
input_rulesdictautomation, text: what the game's terms allow (shown with the key-press switch)
show_labelsdictoptional: a name for each of your show texts ({"ship": "Ship", "place": "Location"}), shown where a player picks party fields (the pad's Party widget). In engine.json so it's there for a party member's game even when it isn't running here. A text with no label is named from its key
rundict{"python": "<package>"} or {"program": "<file>.exe", "args": [...]} (below)

Two kinds of engine; the author decides:

  • "run": {"python": "mygame"}: Python, run by Comms Array's engine host (CommsArray.exe engine <id>), with the package folder first on sys.path. mygame/__init__.py is in the zip, and every other file except engine.json, hub.json, README.md and LICENSE* is inside mygame/. The package (or its mygame.engine module) has create(data_dir) -> Engine (commsarray.engine.Engine). It can import only what Comms Array's exe carries (the standard library minus GUI toolkits and the test suite, as in docs/addons.md, aiohttp, grpc, protobuf, and commsarray's helpers such as commsarray.values and commsarray.layouts).
  • "run": {"program": "bin/mygame-engine.exe", "args": []}: its own program (a relative path to an .exe in the zip; the hub refuses anything else), any language, its own libraries. It speaks this link itself (below).

The hub's own rules for a package it accepts (version format, caps on files and hub.json, publishing) are the hub's docs/api-engines.md. version is MAJOR.MINOR.PATCH with an optional -prerelease (before its release).

How the core starts an engine

Both kinds run in their own process, started only once the player linked the game, with:

VariableWhat
CA_ENGINE_URLws://127.0.0.1:<port>/engine/v1: connect here (loopback only)
CA_ENGINE_TOKENsend Authorization: Bearer <token> with the WebSocket handshake. A new token each start
CA_ENGINE_DIRa folder for the engine's own data, kept across updates
CA_ENGINE_PACKAGEthe installed version's folder (read it, don't write it: an update replaces it)

The working directory is CA_ENGINE_PACKAGE. A program engine:

  1. connects to CA_ENGINE_URL with the token (a text WebSocket, one JSON object per message, 4 MB max each);
  2. sends hello first, then status, frames and the rest (Messages, below);
  3. answers each req with a res carrying the same id;
  4. exits when the socket closes. The core closes it to stop or restart the engine and kills the process after 5 s.

Writes log lines to stderr (LEVEL name: text); the core copies them into its log. A crash is restarted (backing off; after 5 crashes in 5 minutes the Games tab offers "Try again"). Example: examples/hello_engine/ (a program engine that imports nothing of Comms Array); guide: write-an-engine.md.

Installing and updating

Engines install into %APPDATA%\CommsArray\engines-installed\<id>\<version>-<sha8>\. The official engines (Star Citizen, Elite Dangerous) ship inside the exe and install on first run, so the app works offline from the start.

Updates are the player's choice. The hub's engine catalog is checked a minute after start, every 6 hours and on "check for engine updates", on the app's own update channel (Setup > Updates): stable sees the versions their owners promoted to stable, beta the newest version. A newer version whose engine_api the app speaks shows Update to X on its game in the Games tab; nothing installs until the player clicks it. With Update engines automatically switched on (Games tab, off by default) a check installs it by itself, except an unreviewed version, which always waits for the player's trust step. Either way the download's hub signature is checked (sha256, id, version, engine_api, tier) and only that engine restarts, not the app. One that needs a newer engine_api (the catalog's latest) waits, and the Games tab says so. Tiers are per version: a newer version with a lower tier than the installed one (a verified engine's next version is unreviewed until the hub reviews it) waits for its review.

The previous version stays on disk. A new version that fails twice before it has run cleanly (60 s after a hello the core accepted) is rolled back on its own; at any time the player can click Use the previous version, which switches back and restarts only that engine. Either way the version left isn't offered again (not from the hub, not from the exe) until a newer one is published. Engines the player installed from a zip are never replaced from the hub.

Tiers

TierWhoAt install
officialmade and signed by Comms Arrayinstalled
verifiedmade by someone else, reviewed and signed by Comms Arrayinstalled (a program engine asks first)
unreviewedanyone's (a hub developer account, or a zip)only after the player confirms "I trust whoever made this"; the step says it runs as a program on their PC

The tier comes from the hub's signature (a zip is always unreviewed). An unreviewed zip can't replace an installed official or verified engine, and a hub update can't lower an engine's tier. The core's protections don't depend on the tier: consent per game before the engine runs, key presses only to processes and only when switched on, sharing filtered by share_fields and off until switched on, who is playing only from the engine's identity view (hashed on the PC), and the engine_api refusal.

Version

"engine_api": 2 in engine.json and in info. The core refuses an engine with another number (the Games tab says why) and tells it nothing. A later version of this link bumps the number.

VersionWhat changed
1first version
2pad metrics are described values: info.metrics holds descriptions, live updates carry the value and its freshness
2, additionoptional, so the number stays: info.pack_makers and the pad view's pack (packs by ship, 29 Nov 2026)

Messages

engine -> core   {"t": "hello", "info": {...}}                 who it is (below); first message
                 {"t": "status", "status"}                     off | waiting | connected | live
                 {"t": "frame", "state", "views", "events", "at"}  one telemetry frame
                 {"t": "views", "views"}                       views changed without a frame
                 {"t": "journal", "event"}                     one raw log event, for add-ons with events.journal:
                                                               never chat or other players' names (strip them first)
                 {"t": "player", "name"}                       the player's in-game name (per game, never carried over)
                 {"t": "setup", "setup"}                       the setup checklist
                 {"t": "stats", "part", "summary", "saved"}    this session's game stats
                 {"t": "settings", "settings"}                 the engine changed its own stored settings
                 {"t": "feed", "feed"}                         what the game's feed carried this session, by shape
                                                               only (below); optional
                 {"t": "res", "id", "body"}                    answer to a request
core -> engine   {"t": "configure", "settings", "sharing", "player"}
                 {"t": "req", "id", "op", "body"}              actions | press | setup | setup_fix | missions | game_info |
                                                               binding | bindings | catalog
                 {"t": "cmd", "op", "body"}                    stats_begin | stats_tick | stats_restore | stats_end

catalog: what a pad button can press (the widget picker)

Optional. The answer to {"op": "catalog"}: everything a button can press, for the pad's picker, one row per thing a player wants:

{"status": "ok",
 "subjects": [{"id", "name", "icon"}],                  the game's own grouping, in its words (tiles in the picker)
 "actions": [{"action", "name", "game", "subject", "group", "key", "api", "lit", "holdable", "dangerous", "style",
              "where", "sets"?, "variants": [{"action", "role", "game", "key", "api", "where", "sets"?}]}],
 "values": {value id: subject id}, "panels": {panel id: subject id},
 "synonyms": {"the player's word": "the game's word"}, "hidden": {...counts left out}}

name is the clean name and game the game's own; where is where to bind it in the game's own menu (shown for one with no key); key is the action's current key as text, empty when it has none the core can press; api says the game presses it itself (the pad sends a tap on it through press; anything else, and every Hold or Toggle, goes by key); lit comes from the engine's lamps. Toggle / On / Off forms of one thing fold into one row's variants (role: Toggle, On, Off, Deploy...). sets (optional, "on" or "off", 30 Nov 2026 / add-on API 1.5) is the lamp state a form leaves the game in: Deploy "on", Retract "off", for a lit thing. Say it only where it's true whatever the state was before; the core's set (a physical toggle switch) presses that form, and falls back to the Toggle only when the lamp says the state differs. Without a catalog, the core lists the engine's actions as rows with no subjects, and the picker shows them by kind.

feed: what the game's feed carries ("new fields seen")

Optional. Games change their feeds with patches; feed lets the hub notice before world numbers go wrong. One report per play session, sent again (whole) when it grows: {"session": random id, "build": the game's version as the game states it, "schema": what the engine decodes with, "present": [field paths that held a value], "unknown": [{"at": parent path, "n": field number, "wire": type}], "enums": [{"at": path, "v": number}], "frames", "sampled"}. Never a value: an unknown field could be anything. The core sends it to the hub signed with the world key, whether or not world data is on, and puts build in the world session record (with rows, the sharing-grid rows whose world cell was on, so the hub counts a public number only from sessions that sent what it needs). An engine without a feed of its own sends nothing.

info

Each key must have this type, or the core drops it as if the engine hadn't said it. All of info together must be under 512 KB.

KeyTypeWhat
idstrmust match the engine the core started
engine_apiint2
name, versionstrshown to the player; the version goes into stats
glossarydictthe game's words for generic ones: {"player": "commander", "vehicle": "ship", ...}
tagsdictsituation id -> label
metricsdictvalue id -> its description (below). A value without a valid description is dropped (the log says why)
panelsdictthe engine's built-in panel widgets: id -> {name, desc, title, style, size}
layoutsdictbuilt-in pad layouts by name (today every engine provides Phone and Tablet)
dangerouslistaction ids the pad and add-ons must confirm (through the game or by key)
lit_actionslistthe actions whose state the engine reports (its lamps): a pad button on one of these has a lamp, any other has none. A "now" list: add an action when the engine learns its state, and buttons on it get their lamp by themselves. "<Action>.on"-style ids light by their base action
sharinglistthe sharing switch ids. They start off: the engine only names them
sharing_labelsdictswitch id -> what it shares, in the player's words
share_fieldsdictwhich switch each field of the share view belongs to (below)
event_sharedictevent type prefix -> switch: which events may go to the party
sharing_defaultsdictswitch id -> whether the engine suggests it on; used only by the grid's "Friends" preset
griddictthe sharing grid's rows: row id -> {"label"?, "places": [...]} (below)
stats_itemsdictwhich grid row each part of the session summary belongs to (below)
grid_groupslisthow the grid is shown: [{"id", "label", "rows"}], a few categories; the single rows sit under "Advanced"
settingsdictthe engine's settings and their defaults
wordslistthe game's own names (the core word check fails if a core file uses them)
keysdict{"by": "position" | "layout", "hint"}: how the game's binds name keys
pack_makersdictbutton pack id -> the maker it matches, in the game's words ({"aegis": "Aegis Dynamics"}). The pad's pack list shows it ("Spearhead · Aegis Dynamics ships") and offers Match my ship. Optional: a game without it has no Match my ship

Described values

info.metrics describes every value the pad, custom widgets and add-ons can build with. Ids are a contract: saved layouts bind to them, so an id never changes meaning.

FieldForWhat
labelallwhat the player sees in the designer (required)
groupallwhere the designer lists it (required)
typeallnumber · bool · enum · text · list (required)
rangenumber[min, max]: a gauge's empty and full. Without one (and without format: percent) a number can't be a gauge
unitnumbershown after the value (m/s, °C, ly, ...; % and ° without a space)
formatnumberdecimals (default; with decimals: 0..6, thousands grouped), percent (where it is in range, default [0, 1]), duration (seconds), heading (degrees)
levelsnumber{"warn": x, "bad": y, "low_is_bad": true}: at or below (or at or above) the mark it's warn / bad, else ok
levelsenum, bool{value: level}; for bools the keys are "true" and "false"
valuesenum, bool{value: word}: what to show (else the value itself; bools on / off)
oflistthe description of each part (any type but list; no label or group needed)
itemslistthe parts' labels in order, each a string or {"label", "levels"} (that part's own levels). Without items the parts change (a hold's contents) and each comes with its label

A level is ok, warn, bad, off or "" (nothing to say).

Widgets bind to any value of a matching type: a gauge to a number with a range, a readout to a number, bool, enum or text, a parts widget to a list. A saved gauge on a value that can't fill one shows as a readout.

Live updates

The pad view's metrics holds the live updates, by id:

{"v": value | null, "fresh": "live" | "last_known" | "unknown", "age": seconds, "t": own text, "level": own level}
  • v is the value in its own unit (a number, true/false, an enum value, a text, or a list). A value of the wrong type counts as unknown.
  • fresh defaults to live when there is a value; last_known values (from a log, not live telemetry) say their age. A value the engine doesn't send is unknown.
  • t and level are optional: the engine may always send its own text (deep space instead of an altitude) and level (a flag the game raises); a widget shows them instead of what the description gives.
  • A list's v is a list: with items, one entry per item in order, null = that part isn't there (a system the vehicle doesn't have), a shorter list = the rest aren't there; without items, each entry is {"label", "v", "level"?}.

The core presents each described value before it reaches the pad and add-ons:

{"v", "t": text, "level", "pos": 0..1 | null (a gauge's fill), "fresh", "age",
 "parts": [{"label", "v", "t", "level", "pos"}] (lists only)}

Views

share: what the party sees

{"game": status, "player": {...} | None, "vehicle": {...} | None, "show": {...}}

player and vehicle are the game's own shape. show is finished text for the party dashboards, which draw it without knowing the game:

show keyWhat
lines[[key, ...], [key, ...]]: which show keys make each line of a party member, in order. The first line follows the member's presence; later lines are smaller. Keys that weren't shared are missing and simply skipped
statusok / downed / dead, the member's badge colour
badgea short shout after the name (e.g. a travel state), optional
any othera short text the lines name, or a value the hub's hub.json dashboard reads

The core filters it again. share_fields maps "<top>" and "<top>.<field>" to a switch id, a list of switch ids (all must be on) or "always" (the name and the game status: the floor). The core drops every field whose switches are off and every field not declared at all, before the summary leaves the PC or is shown as "what you share". The engine should still filter (it knows what a readout's text reveals); the core makes sure an engine's bug can't share more than the switches allow.

The sharing grid

A player chooses, per game, what goes to each of four places: personal (their own service record), party, leaderboard (public, per in-game name, still opt-in on the hub) and world (anonymous aggregates). The engine declares the rows:

  • Every sharing switch is a row with a party cell (the party column is the switch itself, as above).
  • grid adds the other places a row may go to, and rows with no party cell: {"wallet": {"places": ["personal", "world"]}, "events": {"label": "Deaths, ship losses ...", "places": [...]}}. A place not listed is not offered (there is no leaderboard of a location).
  • stats_items maps each part of the session summary to a row: {"counters": {name: row}, "dimensions": {name: row}, "details": {table: row}}; "always" keeps it whatever the grid says (use it only for things like the game version).

grid_groups puts the rows into a few categories for the Party tab (a player ticks a category; it shows mixed when its rows differ). A row belongs to the first group that names it; rows no group names are shown under "Other". The core adds its own first row, session (play time, party size, features used): when its personal cell is off, no session summary is sent for that game at all. The core leaves a row's counters, dimensions and detail tables out of the session summary when its personal cell is off, and leaves out anything stats_items doesn't map; counters and detail tables whose row's leaderboard cell is off are listed in the summary's no_board for the hub, which keeps them off the boards, and those whose row's party cell is off (or not offered) in no_party (always sent, even empty), which keeps them out of the party boards. Once the player has made a leaderboard choice for the game (the link step's leaderboard answer, a ticked cell or a preset), the summary also says boards: true when any leaderboard cell is on, false when none is; that choice alone lists the player on the boards. Before any choice boards is left out, a leaderboard cell reads as off in the grid, and no_board is worked out as if every leaderboard cell were on, as older builds sent it, so the hub keeps using the player's old per-name opt-in. The link step's answers (personal, world, leaderboard) are the defaults for every row the player hasn't set. An engine that declares no stats_items (an older one) has its summary sent as it was. Every counter, dimension and detail table in the engine's hub.json must be mapped (a test checks both official engines).

pad: the pad's live message

{"tags": [tag ids on], "metrics": {id: live update (above)},
 "lamps": {action id: "on" | "off" | "busy"}, "panels": {...}, "strip": {title, values, badges}, "profile": key,
 "pack": a button pack id | null}

pack is the engine's suggestion for the vehicle you're in (its maker's pack), null with none or on foot. A layout set to Match my ship uses it unless the player picked a pack for that vehicle; on foot the pad keeps the last vehicle's pack. Send it only for a pack id in pack_makers.

panels (the engine's built-in panel widgets: summary, level, active, items, columns, segments), strip and lamps are finished views. The same data a panel shows is also a list value, so a player can build their own. Add-ons with state.live get tags and the presented metrics; the game message carries the descriptions.

cockpit: the PC panel's Cockpit tab

{"cards": [{"id", "title", "aside"?: {"text", "level", "title"?}, "empty"?: text, "blocks": [block, ...]}]}
BlockFields
bannertext, sub, level: a coloured line across the card
bigtext, unit: one large readout
barv (0..1), level: a horizontal gauge
rowsrows: [{"label", "text"} | {"label", "parts": [{"text", "dim"?}]}]
lightsitems: [{"label", "level", "blink"?, "title"?}], columns
headingtext
segmentsshape: "cross" | "row", items: [{"label"?, "title"?, "v", "level"}], center? (cross: top, bottom, left, right)

level is one of ok, warn, bad, dim, accent, "". The panel escapes every text.

identity: who is playing

{"key", "name", "group"?}: key is opaque and stable for one game account (the core hashes it with the game id before anything leaves the PC, so every engine of a game that reports the same key finds the same persona); name is the player's in-game name; group (opaque) = in the same crew.

Who is playing comes only from the running engine. The engine reports identity (and player) from what the game itself says (Star Citizen: Game.log; Elite: the journal's Commander / LoadGame), never from a name the core handed it: configure's player is always None. The core keeps no "last persona of this game" either: after a start or a game switch nobody is playing, no party is active and nothing is shared, until the engine says who. Play before that moment belongs to whoever the engine then reports.

profile, share_key

profile: the key the pad's per-profile pages match (e.g. a vehicle). share_key: changes in it send the party summary at once instead of with the 1 s tick.

Stats

stats.summary is the session so far, for the service record card. summary.lines is a list of finished texts: the panel puts the first after the play time and the rest below it. stats.part is the upload, in the shape the engine's hub.json declares.

Not yet

  • Program engines aren't code-signed (Q-005): the tier and the trust step are what the player goes by.
  • Every engine must provide built-in layouts named Phone and Tablet (the pad falls back to them by name).
From the Comms Array source, commsarray-agent d615c4d.