Playprint Docs
Dashboard Home

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.

R roblox_status

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.

ComponentLocationPurpose
PlayprintTrackerServerScriptServiceRecords decisions and outcomes during gameplay
Profile ExtractionServerScriptServiceAggregates match history into PlayprintData
Ghost AI ModuleServerScriptServiceConverts profiles to AI parameters
Remote EventsReplicatedStorageClient sends decision labels; server validates and records
DataStoreServerPersists 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:

BiasRangeWhat It Controls
aggression0–1How often the ghost initiates attacks
patience0–1Willingness to wait for better opportunities
riskTolerance0–1Acceptance of risky plays
consistency0–1Predictability of play style
deception0–1Tendency to bluff or misdirect
reach0–1How broadly the ghost targets and exerts influence
expressiveness0–1How chatty the ghost is (0 = silent)
provocation0–1Tendency 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:

GameFeatures Demonstrated
100 LegendsFull telemetry pipeline, Ghost AI opponents, friend code sharing, archetype display
Seven LegendsMulti-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