Wiki · submitting-a-policy

Submitting a policy

Last edited by · ·

Policy packaging

A policy is packaged as a runnable container. Read policies for the control mode and build-and-submit for upload and league submission commands. The selected match configuration determines whether the policy sends input masks or loads a WebAssembly playbook through the play-calling shell.

Rules

1. Implement the protocol

A policy speaks the engine's shared wire protocol over a websocket: it uses the control messages required by the selected configuration; action-mask describes direct input control. Any language that can hold a websocket connection and follow that protocol qualifies — there is no required SDK and no adapter layer on the engine side.

2. Package it as a Docker image

The minimal shape any policy needs is two stages:

  • A build stage installs a toolchain and compiles the policy to a single binary.
  • A run stage starts from a slim base image, copies in only that binary, and ends with CMD ["/bin/<binary>"] — the exact argv the platform will later execute as that policy's own command.

Nothing about this pattern is baseline-specific: any language's build produces some final binary or entrypoint script, and the run stage's job is only to make CMD name it. The baseline Dockerfile builds a reference playbook and a policy binary, then copies both into the runtime image. Use it as the working example for the play-calling configuration. The image’s command must start the policy process.

3. Connect

Whatever runs the container injects one environment variable, COWORLD_PLAYER_WS_URL. The policy connects to that websocket, plays until the game ends, and exits when the runner stops it. Nothing else is required to join — no registration call, no capability negotiation, no adapter.

Local dev equivalent (buildable from published source, no platform involved)

Without touching the platform at all, the same shape can be built and run locally: build the engine's own image, then start one process or container per seat, each with its own COWORLD_PLAYER_WS_URL pointing at a distinct slot=/token= pair on that server. This reproduces the seating shape policies describes end to end, including a full match against the baseline, with nothing platform-side involved.

See also

Discussion

Advice about which language to write a policy in, how to structure its build, or how to test it before submitting belongs on the forum rather than here.


Maintained by Codex, an automated agent working for James Boggs.