AI GAME DIRECTOR SDK

Every player.
The right challenge.

Adapt pacing, encounters, difficulty, quests, rewards, and live events from real-time player behavior.

PLAYSTATE / LIVE DIRECTOR

SYSTEM ONLINE
LIVE SIGNALSSESSION_8F21
PLAYER_DIED12:41:08
forest-01
HEALTH_LOW12:41:10
22%
OBJECTIVE_DWELL12:41:13
04:32
DIRECTOR STATEAUTO / RULES
PRESSURE
74/ 100
CALMBALANCEDINTENSE

-18 recommended

LATEST DECISION0.94 CONFIDENCE
RULE MATCHED

Reduce enemy pressure

Player health is low after four recent deaths.

spawn_rewardhealth_pickup · 1
offer_hintforest_path_hint

ONE DIRECTOR.
EVERY RUNTIME.

UNITYGODOTUNREALBROWSERNODE.JS

PRODUCT OVERVIEW

SCROLL TO DIRECT THE MODEL
01 / OBSERVE

Read every
player signal.

Validated telemetry becomes a clear picture of the session in real time.

LOADING RUNTIME
010203

REAL-TIME SIGNALS

BOUNDED DECISIONS

ENGINE-READY ACTIONS

THE PLAYSTATE LOOP

Every player writes
a different story.

PlayState watches the session, evaluates your rules, and chooses the next safe move—without taking control away from your game.

EXPLORE THE DIRECTOR
01

Repeated deaths

02

Objective dwell

03

High success rate

PLAYER STATE

DIRECTRules + AI
01

Reduce pressure

Fewer enemies or lower damage

02

Offer guidance

A contextual, non-spoiler hint

03

Raise challenge

Faster pacing or stronger encounters

Session fatigueChange rhythmProgress milestoneAdjust rewardPopulation activityTrigger live event

DATA FLOW

Fast local rules.
Optional trusted AI.

A continuous loop,
built around authority.

01

Track

Send validated, non-sensitive player and session telemetry from any supported runtime.

02

Evaluate

Deterministic rules inspect current game state, player context, and allowed actions.

03

Decide

PlayState returns typed, bounded actions from rules, optional AI, or a safe fallback.

04

Apply

Your game authorizes the recommendation, applies it, and remains the source of truth.

DESIGNED FOR PRODUCTION

0

Client secrets

Local decisions need no API key, model provider, or trusted server credential.

3

Decision sources

Rules, optional AI, and deterministic fallback share one typed result.

100%

Game authority

PlayState recommends bounded actions. Your game validates and applies them.

Adaptive sessions

Use real-time signals to shape pacing without scripting every possibility.

SDK CAPABILITIES

Everything the director needs.
Nothing your game cannot control.

Production-ready, framework-agnostic TypeScript for adaptive gameplay—with your game remaining authoritative at every step.

DIRECTOR ENGINEGAME STATEDIRECTOR DECISION0.94confidence · rulesACTIONS
01

Typed director decisions

Turn live game and player state into bounded actions with priority, reason, confidence, source, and expiry. Every result is filtered against your allowed actions.

READ THE DOCS ↗
LOCAL + INSTANTDEATHS ≥ 3HEALTH ≤ 30LEVEL = 6ALLMATCHoffer_hint
02

Deterministic rules engine

Evaluate local rules instantly with no network or AI provider. Compose nested conditions with eq, neq, gt, gte, lt, lte, in, and contains operators.

READ THE DOCS ↗
AI GENERATIONTRUSTED SERVERPROMPTMODELZOD VALIDFALLBACK
03

Trusted AI with safe fallback

Generate quests, encounters, explanations, and balance suggestions on your server. Zod validates every response and deterministic fallback keeps play moving.

READ THE DOCS ↗
TELEMETRYLIVE SESSION SIGNAL
04

Validated events and sessions

Track non-sensitive telemetry, aggregate session state, and feed the director with strictly validated player signals before optional HTTP delivery.

READ THE DOCS ↗
EVERY RUNTIMETYPEDDECISIONUNITYGODOTUNREALBROWSER
05

Engine-ready adapters

Serialize the same typed decision for Unity, Godot, Unreal, browser games, Node.js, or a custom runtime without rewriting your director logic.

READ THE DOCS ↗
SECURITY + RELIABILITYGAME CLIENTTRUSTED SERVERALLOWLISTAPI KEYSPUBLIC APIMUTATIONS
06

Production-grade boundaries

Keep API keys and mutations on a trusted server, with typed errors, retries, timeouts, TTL caching, action allowlists, and client-safe public APIs.

READ THE DOCS ↗

FRAMEWORK AGNOSTIC

One SDK.
Every runtime.

Use client-safe decisions inside games and trusted-server capabilities for AI, profile updates, rewards, and live-event administration.

Read the docs
playstate/director.ts
const decision = await playstate.director.decide({
playerId: "player_123",
gameState: { playerHealth: 22, recentDeaths: 4 },
allowedActions: ["reduce_enemy_pressure", "offer_hint"],
});

decision.actions.forEach(applyGameAction);
UnityGodotUnrealBrowserNode.jsGeneric JSON

START BUILDING WITH PLAYSTATE

Your game already reacts.
Now let it understand.

Add an authoritative AI director with local rules, trusted generation, and safe fallback—all through one TypeScript SDK.