Roblox Integration
Bring Playprint's player profiling and Ghost AI to Roblox. Track player decisions in Luau, extract playstyle profiles, and generate AI opponents that play like real people — all within Roblox Studio.
Status: In Development. The Roblox SDK is actively being built with two reference games. Early access available for studio partners.
How It Works
The Roblox integration mirrors the TypeScript SDK's pipeline, implemented in Luau:
-- 1. Track decisions during gameplay
local Playprint = require(ReplicatedStorage.Playprint)
local tracker = Playprint.newTracker("my-roblox-game")
tracker:startMatch()
tracker:decision({ label = "attack", risk = 0.8 })
tracker:decision({ label = "defend", risk = 0.2 })
tracker:outcome({ type = "hit", delta = 0.5 })
-- 2. End match and get profile
local profile = tracker:endMatch("win")
-- { aggression = 0.55, riskWhenWinning = 0.7, bluffRate = 0.0, ... }
-- 3. Generate Ghost AI biases
local ghost = Playprint.createGhost(profile)
-- { aggression = 0.72, patience = 0.28, riskTolerance = 0.65, consistency = 0.8, deception = 0.0 } Architecture
Playprint runs entirely on the server side in Roblox to keep credentials safe and prevent client tampering.
| Component | Location | Purpose |
|---|---|---|
| PlayprintTracker | ServerScriptService | Records decisions and outcomes during gameplay |
| Profile Extraction | ServerScriptService | Aggregates match history into PlayprintData |
| Ghost AI Module | ServerScriptService | Converts profiles to AI parameters |
| Remote Events | ReplicatedStorage | Client sends decision labels; server validates and records |
| DataStore | Server | Persists profiles across sessions |
Ghost AI in Roblox
The 8 ghost bias weights work identically in Luau and TypeScript — 6 core gameplay biases plus 2 communication biases:
| Bias | Range | What It Controls |
|---|---|---|
aggression | 0–1 | How often the ghost initiates attacks |
patience | 0–1 | Willingness to wait for better opportunities |
riskTolerance | 0–1 | Acceptance of risky plays |
consistency | 0–1 | Predictability of play style |
deception | 0–1 | Tendency to bluff or misdirect |
reach | 0–1 | How broadly the ghost targets and exerts influence |
expressiveness | 0–1 | How chatty the ghost is (0 = silent) |
provocation | 0–1 | Tendency toward trash talk vs. sportsmanship |
Map these to your game's specific AI parameters:
-- Map ghost biases to game-specific NPC behaviour
local aiParams = Playprint.mapGhostBiases(ghost, {
attackFrequency = { bias = "aggression", range = {0.1, 0.9} },
retreatThreshold = { bias = "patience", range = {0.2, 0.8} },
dodgeChance = { bias = "riskTolerance", range = {0.1, 0.6} },
patternVariance = { bias = "consistency", range = {0.05, 0.4} },
fakeoutRate = { bias = "deception", range = {0, 0.3} },
targetSpread = { bias = "reach", range = {1, 4} },
emoteFrequency = { bias = "expressiveness", range = {0, 0.8} },
tauntChance = { bias = "provocation", range = {0, 0.5} },
}) Cross-Platform Profiles
Playprint profiles are platform-agnostic. A player profiled in your Roblox game produces the same PlayprintData shape as one profiled in a web or Unity game. This enables:
- Cross-game Ghosts — A player's Ghost from Game A can be imported into Game B
- Shared archetypes — Reckless, Calculated, Patient, Cautious classifications work everywhere
- Friend codes — WORD-NNNN codes work across platforms
Reference Games
Two complete Roblox games demonstrate the full Playprint integration:
| Game | Features Demonstrated |
|---|---|
| 100 Legends | Full telemetry pipeline, Ghost AI opponents, friend code sharing, archetype display |
| Seven Legends | Multi-player Ghost challenges, leaderboards, mid-match adaptation |
Key Requirements
- HttpService — Must be enabled in Game Settings → Security → Allow HTTP Requests
- Server-side only — Never expose credentials or profile data in client scripts
- DataStore limits — Playprint data is compact (~2KB per profile) and well within DataStore quotas
- 5+ matches — Ghost AI requires at least 5 matches for a reliable profile
Next Steps
- Read the Quickstart to understand the core SDK concepts
- See the API Reference for the TypeScript SDK (Luau API mirrors this)
- Review the Core Concepts for traits, archetypes, and ghost AI