Controller+BETADownload

Integration guidance for coding agents

Use Controller+ when a game should accept phones as controllers: players scan a QR code and their phone becomes a gamepad, or a private screen for roles, votes, answers and drawings. Phones need no app; the controller runs in the phone's browser.

Pick the integration

The game is… Use Guide
A web page with no server (canvas, Phaser, three.js, plain JS, a single HTML file) createRoom from https://controller.plus/sdk/src/relay-host.mjs Web game
A web or Node game with its own server ControllerHost from @controller-plus/sdk/node-host, phones connect to that server Quickstart
Godot, Unity, Unreal or C/C++ The engine package, connected to a ControllerHost or to the relay Engines

For a web page without a server, this is the complete integration:

import { createRoom, movement } from "https://controller.plus/sdk/src/relay-host.mjs";
const room = await createRoom({ game: { id: "my-game", name: "My Game" } });
qrElement.innerHTML = room.qrSVG;
room.on("join", ({ playerId, name }) => addPlayer(playerId, name));
room.on("leave", ({ playerId }) => removePlayer(playerId));
room.on("input", ({ playerId, input }) => {
  const [x, y] = movement(input);           // stick + D-pad, -1..1, right/down positive
  setControls(playerId, x, y, input.buttons[0] > 0.5); // button 0 = bottom face button
});

Rules that keep the integration correct

  1. Keep the game's own keyboard and gamepad controls. Phones are another input, assigned to their own player. Never let every phone control player one.
  2. Create players on join and remove or pause them on leave. A phone that reconnects within five minutes keeps its playerId.
  3. Describe controls by position ("bottom button jumps"), not by letter. Players choose skins with different printed letters.
  4. Show the QR where everyone can see it, and keep it visible or re-openable for late joiners.
  5. Put anything secret (roles, cards, answers) in a private view with room.view(playerId, …). Never put it in shared state.
  6. Test with two phones (or two browser tabs on room.joinURL) before calling it done: join, input, leave, rejoin.

Entry points

Terms

Games may use and modify the SDK, including commercial games. Do not use it to harm players or to interfere with the Controller+ apps. Do not put a room's host token in a QR, a public asset or a log: it controls the room.