PlayStateAI GAME DIRECTOR SDK
Every player.
The right challenge.
Adapt pacing, encounters, difficulty, quests, rewards, and live events from real-time player behavior.
-18 recommended
Reduce enemy pressure
Player health is low after four recent deaths.
✳ ONE DIRECTOR.
EVERY RUNTIME.
PRODUCT OVERVIEW
SCROLL TO DIRECT THE MODELRead every
player signal.
Validated telemetry becomes a clear picture of the session in real time.
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 / LIVE SIGNALS
Repeated deaths
Objective dwell
High success rate
PLAYER STATE
DIRECTRules + AI02 / SAFE ACTIONS
Reduce pressure
Fewer enemies or lower damage
Offer guidance
A contextual, non-spoiler hint
Raise challenge
Faster pacing or stronger encounters
DATA FLOW
Fast local rules.
Optional trusted AI.
A continuous loop,
built around authority.
Track
Send validated, non-sensitive player and session telemetry from any supported runtime.
Evaluate
Deterministic rules inspect current game state, player context, and allowed actions.
Decide
PlayState returns typed, bounded actions from rules, optional AI, or a safe fallback.
Apply
Your game authorizes the recommendation, applies it, and remains the source of truth.
DESIGNED FOR PRODUCTION
Client secrets
Local decisions need no API key, model provider, or trusted server credential.
Decision sources
Rules, optional AI, and deterministic fallback share one typed result.
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.
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 ↗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 ↗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 ↗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 ↗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 ↗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 ↗const decision = await playstate.director.decide({
playerId: "player_123"
,
gameState: { playerHealth: 22
, recentDeaths: 4
},
allowedActions: ["reduce_enemy_pressure"
, "offer_hint"
],
});
decision.actions.forEach(applyGameAction);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.