@threenative/playtest API

Every public function and class in @threenative/playtest. Scenario-driven playtest harness for Three.js games. Runs on plain Three.js with zero ThreeNative dependencies.

On this page

Generated from the engine's capability manifest: 88 functions and 15 classes. Each entry is the exported signature, what it is for, and a working example. Start with the package overview.

assertJsonSafe

function · import { assertJsonSafe } from "@threenative/playtest"

Validate JSON-safe bridge messages and protocol sizes.

ts
function assertJsonSafe(value: unknown, path = "$"): asserts value is JsonValue

Use it to

  • send a safe observation over the playtest bridge
  • reject an oversized or cyclic playtest payload
  • validate entity components and gameplay observations before crossing the bridge

Example

ts
assertJsonSafe({ score: 10 });

Good to know

  • bridge values must be JSON-shaped
  • throws instead of silently dropping the offending field

DeviceMetricsError

class · import { DeviceMetricsError } from "@threenative/playtest"

Measure and judge device thermal, power and battery state around a device playtest run.

ts
class DeviceMetricsError extends Error

Use it to

  • find out whether an Android run was throttled or started hot
  • read battery temperature, current draw or per-rail power for a run

Example

ts
const verdict = summarizeDeviceMetrics(observation.samples);

Good to know

  • a reading the device does not expose reports unavailable, never zero
  • a run that started hot or whose thermal status rose is flagged as confounded

DeviceMetricsRecorder

class · import { DeviceMetricsRecorder } from "@threenative/playtest"

Measure and judge device thermal, power and battery state around a device playtest run.

ts
class DeviceMetricsRecorder

Use it to

  • find out whether an Android run was throttled or started hot
  • read battery temperature, current draw or per-rail power for a run

Example

ts
const verdict = summarizeDeviceMetrics(observation.samples);

Good to know

  • a reading the device does not expose reports unavailable, never zero
  • a run that started hot or whose thermal status rose is flagged as confounded

evaluateRichPlaytestAssertions

function · import { evaluateRichPlaytestAssertions } from "@threenative/playtest"

Evaluate rich semantic assertions against captured observations.

ts
function evaluateRichPlaytestAssertions(input:

Use it to

  • assert movement, visibility, or diagnostics in a playtest
  • turn a scenario observation into a pass or failure

Example

ts
const result = evaluateRichPlaytestAssertions(input);

Good to know

  • malformed or empty assertions fail closed

invalidScenario

function · import { invalidScenario } from "@threenative/playtest"

Construct a named invalid-scenario error without loading or executing a scenario.

ts
function invalidScenario(scenarioPath: string, message: string): PlaytestScenarioError

Use it to

  • construct a validation error for malformed scenario input

Example

ts
import { invalidScenario } from "@threenative/playtest";
throw invalidScenario("smoke.playtest.json", "Expected a non-empty assertion set");

Good to know

  • returns an error; the caller must throw it

jsonByteLength

function · import { jsonByteLength } from "@threenative/playtest"

Validate JSON-safe bridge messages and protocol sizes.

ts
function jsonByteLength(value: JsonValue): number

Use it to

  • send a safe observation over the playtest bridge
  • reject an oversized or cyclic playtest payload
  • check a runtime observation against the protocol payload limit before sampling

Example

ts
assertJsonSafe({ score: 10 });

Good to know

  • bridge values must be JSON-shaped

loadPlaytestScenario

function · import { loadPlaytestScenario } from "@threenative/playtest"

Load and validate a scenario and its referenced evidence before running it.

ts
async function loadPlaytestScenario(projectPath: string, scenarioPath: string): Promise<IPlaytestScenario>

Use it to

  • create a browser or device playtest scenario
  • load a deterministic tick-based playtest scenario

Example

ts
import { loadPlaytestScenario } from "@threenative/playtest";
const scenario = await loadPlaytestScenario(process.cwd(), "playtests/smoke.playtest.json");

Good to know

  • unknown scenario keys and missing referenced evidence fail closed
  • loading validates the fixture; use the runner to execute it

missingPlaytestCapabilities

function · import { missingPlaytestCapabilities } from "@threenative/playtest"

Validate and inspect playtest capability declarations.

ts
function missingPlaytestCapabilities(required: readonly string[], available: readonly string[]): string[]

Use it to

  • check whether a scenario's required capabilities are installed
  • report unknown or missing playtest capabilities

Example

ts
const missing = missingPlaytestCapabilities(required, available);

parseDeviceBattery

function · import { parseDeviceBattery } from "@threenative/playtest"

Measure and judge device thermal, power and battery state around a device playtest run.

ts
function parseDeviceBattery(output: string): IPlaytestDeviceBattery

Use it to

  • find out whether an Android run was throttled or started hot
  • read battery temperature, current draw or per-rail power for a run

Example

ts
const verdict = summarizeDeviceMetrics(observation.samples);

Good to know

  • a reading the device does not expose reports unavailable, never zero
  • a run that started hot or whose thermal status rose is flagged as confounded

parseDeviceCurrent

function · import { parseDeviceCurrent } from "@threenative/playtest"

Measure and judge device thermal, power and battery state around a device playtest run.

ts
function parseDeviceCurrent(output: string): PlaytestDeviceMeasurement<number>

Use it to

  • find out whether an Android run was throttled or started hot
  • read battery temperature, current draw or per-rail power for a run

Example

ts
const verdict = summarizeDeviceMetrics(observation.samples);

Good to know

  • a reading the device does not expose reports unavailable, never zero
  • a run that started hot or whose thermal status rose is flagged as confounded

parseDevicePowerRails

function · import { parseDevicePowerRails } from "@threenative/playtest"

Measure and judge device thermal, power and battery state around a device playtest run.

ts
function parseDevicePowerRails(output: string): PlaytestDevicePowerRails

Use it to

  • find out whether an Android run was throttled or started hot
  • read battery temperature, current draw or per-rail power for a run

Example

ts
const verdict = summarizeDeviceMetrics(observation.samples);

Good to know

  • a reading the device does not expose reports unavailable, never zero
  • a run that started hot or whose thermal status rose is flagged as confounded

parseDeviceThermal

function · import { parseDeviceThermal } from "@threenative/playtest"

Measure and judge device thermal, power and battery state around a device playtest run.

ts
function parseDeviceThermal(output: string): IPlaytestDeviceThermal

Use it to

  • find out whether an Android run was throttled or started hot
  • read battery temperature, current draw or per-rail power for a run

Example

ts
const verdict = summarizeDeviceMetrics(observation.samples);

Good to know

  • a reading the device does not expose reports unavailable, never zero
  • a run that started hot or whose thermal status rose is flagged as confounded

playtestDiagnostic

function · import { playtestDiagnostic } from "@threenative/playtest"

Create a structured playtest diagnostic.

ts
function playtestDiagnostic( code: PlaytestDiagnosticCode, message: string, instruction: string, details: Pick<IPlaytestProtocolDiagnostic, "capability" | "path"> &

Use it to

  • report a named runtime diagnostic to a scenario
  • explain why a playtest assertion cannot pass

Example

ts
playtestDiagnostic("TN_PLAYTEST_CAPABILITY_MISSING", "body missing", "register rapier() before adding bodies");

PlaytestScenarioError

class · import { PlaytestScenarioError } from "@threenative/playtest"

Carry a structured scenario validation diagnostic as an error.

ts
class PlaytestScenarioError extends Error

Use it to

  • catch a structured playtest scenario validation error

Example

ts
import { PlaytestScenarioError } from "@threenative/playtest";
const error = new PlaytestScenarioError({ code: "TN_PLAYTEST_SCENARIO_INVALID", message: "Invalid fixture", severity: "error", suggestion: "Fix the fixture" });

Good to know

  • the diagnostic describes a failed load, not a successfully executed scenario

playtestStepHoldTicks

function · import { playtestStepHoldTicks } from "@threenative/playtest"

Read a validated step's input-hold duration in simulation ticks.

ts
function playtestStepHoldTicks(step: IPlaytestStep, fallback = 1): number

Use it to

  • read the deterministic number of ticks to hold a playtest input

Example

ts
import { playtestStepHoldTicks } from "@threenative/playtest";
const ticks = playtestStepHoldTicks({ kind: "input", press: "KeyW", holdTicks: 30, release: true });

Good to know

  • reads the duration only; the runner advances the simulation

playtestStepWaitTicks

function · import { playtestStepWaitTicks } from "@threenative/playtest"

Read a validated step's no-input duration in simulation ticks.

ts
function playtestStepWaitTicks(step: IPlaytestStep): number

Use it to

  • wait or hold a game for a deterministic number of ticks

Example

ts
import { playtestStepWaitTicks } from "@threenative/playtest";
const ticks = playtestStepWaitTicks({ kind: "wait", waitTicks: 30, release: true });

Good to know

  • reads the wait duration only; the runner advances the simulation

rejectUnknownKeys

function · import { rejectUnknownKeys } from "@threenative/playtest"

Reject object keys outside the explicitly allowed scenario fields.

ts
function rejectUnknownKeys( value: Record<string, unknown>, allowedKeys: readonly string[], scenarioPath: string, objectPath: string, ): void

Use it to

  • reject an unknown field while validating a scenario object

Example

ts
import { rejectUnknownKeys } from "@threenative/playtest";
rejectUnknownKeys({ name: "smoke" }, ["name"], "smoke.playtest.json", "scenario");

Good to know

  • throws an invalid-scenario error on the first unknown key

requiredPlaytestCapabilities

function · import { requiredPlaytestCapabilities } from "@threenative/playtest"

Evaluate rich semantic assertions against captured observations.

ts
function requiredPlaytestCapabilities( scenario: IPlaytestScenario, target?: string, ): PlaytestCapability[]

Use it to

  • assert movement, visibility, or diagnostics in a playtest
  • turn a scenario observation into a pass or failure

Example

ts
const result = evaluateRichPlaytestAssertions(input);

Good to know

  • malformed or empty assertions fail closed

resolveDiagnosticsPolicy

function · import { resolveDiagnosticsPolicy } from "@threenative/playtest"

Resolve the effective diagnostics policy for a run, with fail-closed defaults applied.

ts
function resolveDiagnosticsPolicy( policy: IPlaytestDiagnosticsAssertion | undefined, target?: string, ): IPlaytestDiagnosticsPolicy

Use it to

  • judge captured console, network, or runtime diagnostics for a playtest

Example

ts
const policy = resolveDiagnosticsPolicy(scenario.assert?.diagnostics);

Good to know

  • absent policy fields default to rejecting errors

summarizeDeviceMetrics

function · import { summarizeDeviceMetrics } from "@threenative/playtest"

Measure and judge device thermal, power and battery state around a device playtest run.

ts
function summarizeDeviceMetrics( samples: readonly IPlaytestDeviceMetricsSample[], ): IPlaytestDeviceMetricsVerdict

Use it to

  • find out whether an Android run was throttled or started hot
  • read battery temperature, current draw or per-rail power for a run

Example

ts
const verdict = summarizeDeviceMetrics(observation.samples);

Good to know

  • a reading the device does not expose reports unavailable, never zero
  • a run that started hot or whose thermal status rose is flagged as confounded

unknownPlaytestCapabilities

function · import { unknownPlaytestCapabilities } from "@threenative/playtest"

Validate and inspect playtest capability declarations.

ts
function unknownPlaytestCapabilities(capabilities: readonly string[]): string[]

Use it to

  • check whether a scenario's required capabilities are installed
  • report unknown or missing playtest capabilities

Example

ts
const missing = missingPlaytestCapabilities(required, available);

assertCaptureNotBlank

function · import { assertCaptureNotBlank } from "@threenative/playtest/capture"

Fail closed when a screenshot is blank or uniform.

ts
function assertCaptureNotBlank(png: Buffer, label: string): ICaptureFrameStats

Use it to

  • guard a visual playtest against a blank frame
  • prove a screenshot contains more than a loading surface

Example

ts
assertCaptureNotBlank(png, "first frame");

Good to know

  • the assertion throws instead of returning a false pass

assertFrameShowsSomething

function · import { assertFrameShowsSomething } from "@threenative/playtest/capture"

Fail closed when a screenshot is blank or uniform.

ts
assertFrameShowsSomething = assertCaptureNotBlank

Use it to

  • guard a visual playtest against a blank frame
  • prove a screenshot contains more than a loading surface

Example

ts
assertFrameShowsSomething(png, "first frame");

Good to know

  • the assertion throws instead of returning a false pass

CaptureGuardError

class · import { CaptureGuardError } from "@threenative/playtest/capture"

Explain why a captured frame failed the non-blank guard.

ts
class CaptureGuardError extends Error

Use it to

  • fail a visual test when the rendered frame is blank
  • include capture statistics in a playtest error

Example

ts
throw new CaptureGuardError("menu", "no bright pixels");

collectRegionalTone

function · import { collectRegionalTone } from "@threenative/playtest/capture"

Collect opt-in regional tone observations from the same acquired PNG.

ts
function collectRegionalTone( png: Buffer, assertions: readonly IPlaytestToneAssertion[], label: string, atStep?: string, ): IPlaytestRegionalToneObservation[]

Use it to

  • measure a specified pixel crop in a captured playtest frame

Example

ts
collectRegionalTone(png, assertions, "character", "posed");

Good to know

  • does not acquire another screenshot or alter frame timing

inspectFrame

function · import { inspectFrame } from "@threenative/playtest/capture"

Inspect a PNG frame for visible pixels and luminance variation.

ts
function inspectFrame(png: Buffer): ICaptureFrameStats

Use it to

  • measure whether a screenshot contains a rendered game
  • diagnose a uniform or blank capture

Example

ts
const stats = inspectFrame(png);

assertJsonSafe

function · import { assertJsonSafe } from "@threenative/playtest/protocol"

Reject any value that would not survive JSON serialization.

ts
function assertJsonSafe(value: unknown, path = "$"): asserts value is JsonValue

Use it to

  • validate entity components and gameplay observations before crossing the bridge

Example

ts
assertJsonSafe(snapshot, "$.components");

Good to know

  • throws instead of silently dropping the offending field

jsonByteLength

function · import { jsonByteLength } from "@threenative/playtest/protocol"

Measure a payload's wire size in bytes.

ts
function jsonByteLength(value: JsonValue): number

Use it to

  • check a runtime observation against the protocol payload limit before sampling

Example

ts
const bytes = jsonByteLength(observation);

requestedPlaytestClockMode

function · import { requestedPlaytestClockMode } from "@threenative/playtest/protocol"

The clock the host asked for, or undefined for the default deterministic run. wall-clock is the production profile's opt-in and the only one this protocol has. An unrecognised value throws instead of falling back, because a misspelling that quietly left the loop frozen would publish a frame rate for a game that was not playing. Read at the moment it is needed rather than once at install: a request that arrives after the producer was installed is still a request, and a producer that missed it would judge a live frame pump by a count it never asked for.

ts
function requestedPlaytestClockMode(): PlaytestClockMode | undefined

Use it to

  • report which clock a playtest producer is really running on, before judging its ticks

Example

ts
if (requestedPlaytestClockMode() === "wall-clock") host.pumpDrivesTheSimulation();

Good to know

  • throws on an unrecognised value instead of falling back to a fixed-step run

AdbAndroidDriver

class · import { AdbAndroidDriver } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
class AdbAndroidDriver implements IAndroidDriver

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

advanceFixedStep

function · import { advanceFixedStep } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
async function advanceFixedStep( page: Page, bridge: Pick<IPlaytestBridgeClient, "advance">, ticks: number, ): Promise<void>

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

advanceTimeoutMs

function · import { advanceTimeoutMs } from "@threenative/playtest/runner"

Connect a Playwright page to a playtest bridge.

ts
function advanceTimeoutMs( ticks: number, perTickMs: number = PLAYTEST_ADVANCE_TICK_BUDGET_MS, ): number

Use it to

  • run a browser scenario against a game
  • inspect bridge diagnostics from a runner

Example

ts
const bridge = await connectPlaytestBridge(page, scenario);

Good to know

  • the bridge must answer the handshake or the run fails

androidMailboxPaths

function · import { androidMailboxPaths } from "@threenative/playtest/runner"

Resolve a native device transport and its mailbox paths.

ts
function androidMailboxPaths( packageName: string, root = `/sdcard/Android/data/$

Use it to

  • connect a native host to the playtest runner
  • validate an Android or iOS device endpoint

Example

ts
const paths = deviceMailboxPaths(projectRoot);

Good to know

  • paths stay inside the managed artifact directory

androidTouchBatches

function · import { androidTouchBatches } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function androidTouchBatches( identity: readonly string[], positions: readonly string[], ): string[][]

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

batchArtifactDirectory

function · import { batchArtifactDirectory } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
function batchArtifactDirectory(base: string, scenarioPath: string, index: number): string

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

boundedTeardownStep

function · import { boundedTeardownStep } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
async function boundedTeardownStep( step: Promise<unknown> | undefined, timeoutMs: number, ): Promise<boolean>

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

bridgeWaitTimeoutMs

function · import { bridgeWaitTimeoutMs } from "@threenative/playtest/runner"

Connect a Playwright page to a playtest bridge.

ts
function bridgeWaitTimeoutMs( operationMs: number = PLAYTEST_PROTOCOL_LIMITS.operationTimeoutMs, ): number

Use it to

  • run a browser scenario against a game
  • inspect bridge diagnostics from a runner

Example

ts
const bridge = await connectPlaytestBridge(page, scenario);

Good to know

  • the bridge must answer the handshake or the run fails

buildReport

function · import { buildReport } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
function buildReport( config: IStandalonePlaytestConfig, scenario: IPlaytestScenario, beforeSnapshot: IPlaytestObservationSnapshot | undefined, afterSnapshot: IPlaytestObservationSnapshot | undefined, consoleEntries: IRunnerConsoleEntry[], networkEntries: Array<

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

captureVisualSurface

function · import { captureVisualSurface } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
async function captureVisualSurface( page: Page, artifactPath?: string, ): Promise<Buffer | undefined>

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

connectPlaytestBridge

function · import { connectPlaytestBridge } from "@threenative/playtest/runner"

Connect a Playwright page to a playtest bridge.

ts
async function connectPlaytestBridge( page: Page, scenario: IPlaytestScenario, timeoutMs: number = PLAYTEST_PROTOCOL_LIMITS.operationTimeoutMs, ): Promise<IPlaytestBridgeClient | undefined>

Use it to

  • run a browser scenario against a game
  • inspect bridge diagnostics from a runner

Example

ts
const bridge = await connectPlaytestBridge(page, scenario);

Good to know

  • the bridge must answer the handshake or the run fails

connectPlaytestBridgeTransport

function · import { connectPlaytestBridgeTransport } from "@threenative/playtest/runner"

Connect a Playwright page to a playtest bridge.

ts
async function connectPlaytestBridgeTransport( transport: IBridgeTransport, scenario: IPlaytestScenario, timeoutMs: number = bridgeWaitTimeoutMs(), target?: string, ): Promise<IPlaytestBridgeClient | undefined>

Use it to

  • run a browser scenario against a game
  • inspect bridge diagnostics from a runner

Example

ts
const bridge = await connectPlaytestBridge(page, scenario);

Good to know

  • the bridge must answer the handshake or the run fails

decideDisplayStrategy

function · import { decideDisplayStrategy } from "@threenative/playtest/runner"

Decide which display a pixel-producing run paints on, the same decision the runner makes.

ts
function decideDisplayStrategy(input: IDisplayDecisionInput): IDisplayStrategy

Use it to

  • judge whether a measured frame rate came from a display that can carry one

Example

ts
import { decideDisplayStrategy } from "@threenative/playtest/runner";
const lane = decideDisplayStrategy({ env: process.env, platform: "linux" });
if (lane.kind === "private-xvfb") throw new Error("refuse to judge this frame rate");

Good to know

  • a private Xvfb is software, so a rate read there measures the X server

DesktopPlaytestDriver

class · import { DesktopPlaytestDriver } from "@threenative/playtest/runner"

Drive a local desktop playtest mailbox.

ts
class DesktopPlaytestDriver implements IDevicePlaytestDriver

Use it to

  • run a desktop target through the playtest protocol
  • exchange observations with a native desktop host

Example

ts
const driver = new DesktopPlaytestDriver(options);

Good to know

  • the mailbox lifecycle must be disposed after the run

DeviceBridgeTransport

class · import { DeviceBridgeTransport } from "@threenative/playtest/runner"

Resolve a native device transport and its mailbox paths.

ts
class DeviceBridgeTransport implements IDevicePlaytestTransport

Use it to

  • connect a native host to the playtest runner
  • validate an Android or iOS device endpoint

Example

ts
const paths = deviceMailboxPaths(projectRoot);

Good to know

  • paths stay inside the managed artifact directory

deviceMailboxPaths

function · import { deviceMailboxPaths } from "@threenative/playtest/runner"

Resolve a native device transport and its mailbox paths.

ts
function deviceMailboxPaths(root: string): IDeviceMailboxPaths

Use it to

  • connect a native host to the playtest runner
  • validate an Android or iOS device endpoint

Example

ts
const paths = deviceMailboxPaths(projectRoot);

Good to know

  • paths stay inside the managed artifact directory

DeviceMailboxTransport

class · import { DeviceMailboxTransport } from "@threenative/playtest/runner"

Resolve a native device transport and its mailbox paths.

ts
class DeviceMailboxTransport implements IDevicePlaytestTransport

Use it to

  • connect a native host to the playtest runner
  • validate an Android or iOS device endpoint

Example

ts
const paths = deviceMailboxPaths(projectRoot);

Good to know

  • paths stay inside the managed artifact directory

deviceTimeoutDiagnostic

function · import { deviceTimeoutDiagnostic } from "@threenative/playtest/runner"

Resolve a native device transport and its mailbox paths.

ts
function deviceTimeoutDiagnostic( diagnostic: IPlaytestProtocolDiagnostic, hostAlive: boolean | undefined, lastConsoleLines: readonly string[], ): IPlaytestProtocolDiagnostic

Use it to

  • connect a native host to the playtest runner
  • validate an Android or iOS device endpoint

Example

ts
const paths = deviceMailboxPaths(projectRoot);

Good to know

  • paths stay inside the managed artifact directory

discoverAdb

function · import { discoverAdb } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function discoverAdb(environment: NodeJS.ProcessEnv = process.env): string

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

failedDiagnosticsAssertion

function · import { failedDiagnosticsAssertion } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
function failedDiagnosticsAssertion(policy: IPlaytestDiagnosticsPolicy): IPlaytestAssertionResult

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

formatPipelineSummary

function · import { formatPipelineSummary } from "@threenative/playtest/runner"

Parse and explain bounded shader-compilation captures.

ts
function formatPipelineSummary(summary: IPipelineSummary): string

Use it to

  • diagnose a slow shader-heavy launch from one browser or native capture
  • reconcile pipeline creation counts and compile timing

Example

ts
summarizePipelineCapture(parsePipelineCapture(captureText));

Good to know

  • incomplete or malformed captures never become a successful empty report

formatUsage

function · import { formatUsage } from "@threenative/playtest/runner"

Parse standalone playtest runner configuration.

ts
function formatUsage(): string

Use it to

  • invoke the playtest CLI from a scaffold
  • validate runner flags before launching a browser

Example

ts
const config = parseStandalonePlaytestArgs(argv);

Good to know

  • invalid flags throw a named usage error

handlePlaytestSignal

function · import { handlePlaytestSignal } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
async function handlePlaytestSignal( teardown: (stopManagedServer: boolean) => Promise<void>, setExitCode: (code: number) => void = (code) =>

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

initStandalonePlaytest

function · import { initStandalonePlaytest } from "@threenative/playtest/runner"

Initialize the standalone playtest files for a project.

ts
async function initStandalonePlaytest(projectPath = process.cwd()): Promise<

Use it to

  • add the runner contract to a new game
  • create a starter scenario fixture

Example

ts
await initStandalonePlaytest(projectPath);

Good to know

  • generated scenarios must contain real assertions

isRuntimeReadout

function · import { isRuntimeReadout } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
function isRuntimeReadout(entry: unknown): boolean

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

keyboardIsShown

function · import { keyboardIsShown } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function keyboardIsShown(dump: string): boolean

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

LocalDeviceMailbox

class · import { LocalDeviceMailbox } from "@threenative/playtest/runner"

Drive a local desktop playtest mailbox.

ts
class LocalDeviceMailbox

Use it to

  • run a desktop target through the playtest protocol
  • exchange observations with a native desktop host

Example

ts
const driver = new DesktopPlaytestDriver(options);

Good to know

  • the mailbox lifecycle must be disposed after the run

ManagedServerError

class · import { ManagedServerError } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
class ManagedServerError extends Error

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

openPageAndConnectBridge

function · import { openPageAndConnectBridge } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
async function openPageAndConnectBridge( page: Page, config: IStandalonePlaytestConfig, scenario: IPlaytestScenario, ): Promise<IPlaytestBridgeClient | undefined>

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

pageLifecycleDiagnostic

function · import { pageLifecycleDiagnostic } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
function pageLifecycleDiagnostic( error: unknown, lifecycle: IPageLifecycle, url: string, ): IPlaytestProtocolDiagnostic | undefined

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

parseAndroidConsole

function · import { parseAndroidConsole } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function parseAndroidConsole(output: string): Array<

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

parseAndroidTouchViewport

function · import { parseAndroidTouchViewport } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function parseAndroidTouchViewport(output: string): IAndroidTouchViewport

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

parseLaunchedPid

function · import { parseLaunchedPid } from "@threenative/playtest/runner"

Drive and inspect iOS simulator playtest transport.

ts
function parseLaunchedPid(output: string): string

Use it to

  • run a scenario on the iOS simulator
  • parse the launched native process identifier

Example

ts
const driver = new XcrunIosDriver(options);

Good to know

  • simulator evidence does not claim physical-device proof

parsePipelineCapture

function · import { parsePipelineCapture } from "@threenative/playtest/runner"

Parse and explain bounded shader-compilation captures.

ts
function parsePipelineCapture(input: string | unknown): IPipelineCapture

Use it to

  • diagnose a slow shader-heavy launch from one browser or native capture
  • reconcile pipeline creation counts and compile timing

Example

ts
summarizePipelineCapture(parsePipelineCapture(captureText));

Good to know

  • incomplete or malformed captures never become a successful empty report

parsePipelineEventMarkers

function · import { parsePipelineEventMarkers } from "@threenative/playtest/runner"

Parse and explain bounded shader-compilation captures.

ts
function parsePipelineEventMarkers(text: string): IPipelineCaptureEvent[]

Use it to

  • diagnose a slow shader-heavy launch from one browser or native capture
  • reconcile pipeline creation counts and compile timing

Example

ts
summarizePipelineCapture(parsePipelineCapture(captureText));

Good to know

  • incomplete or malformed captures never become a successful empty report

parseStandalonePlaytestArgs

function · import { parseStandalonePlaytestArgs } from "@threenative/playtest/runner"

Parse standalone playtest runner configuration.

ts
function parseStandalonePlaytestArgs(argv: readonly string[], cwd = process.cwd()): IStandalonePlaytestConfig

Use it to

  • invoke the playtest CLI from a scaffold
  • validate runner flags before launching a browser

Example

ts
const config = parseStandalonePlaytestArgs(argv);

Good to know

  • invalid flags throw a named usage error

PlaytestBridgeError

class · import { PlaytestBridgeError } from "@threenative/playtest/runner"

Connect a Playwright page to a playtest bridge.

ts
class PlaytestBridgeError extends Error

Use it to

  • run a browser scenario against a game
  • inspect bridge diagnostics from a runner

Example

ts
const bridge = await connectPlaytestBridge(page, scenario);

Good to know

  • the bridge must answer the handshake or the run fails

PlaytestCliUsageError

class · import { PlaytestCliUsageError } from "@threenative/playtest/runner"

Parse standalone playtest runner configuration.

ts
class PlaytestCliUsageError extends Error

Use it to

  • invoke the playtest CLI from a scaffold
  • validate runner flags before launching a browser

Example

ts
const config = parseStandalonePlaytestArgs(argv);

Good to know

  • invalid flags throw a named usage error

playtestStepDrivesMovement

function · import { playtestStepDrivesMovement } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
function playtestStepDrivesMovement( step: IPlaytestScenario["steps"][number], hasHeldInput: boolean, ): boolean

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

PlaywrightTransport

class · import { PlaywrightTransport } from "@threenative/playtest/runner"

Connect a Playwright page to a playtest bridge.

ts
class PlaywrightTransport implements IBridgeTransport

Use it to

  • run a browser scenario against a game
  • inspect bridge diagnostics from a runner

Example

ts
const bridge = await connectPlaytestBridge(page, scenario);

Good to know

  • the bridge must answer the handshake or the run fails

preflightDisplay

function · import { preflightDisplay } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
function preflightDisplay( config: Pick<IStandalonePlaytestConfig, "headless">, scenario: Pick<IPlaytestScenario, "artifacts" | "assert" | "steps">, environment: NodeJS.ProcessEnv = process.env, platform = process.platform, ): IPlaytestDiagnostic | undefined

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

reconcileBrowserPointers

function · import { reconcileBrowserPointers } from "@threenative/playtest/runner"

Compare pointer snapshots and produce down, move, and up transitions.

ts
function reconcileBrowserPointers( previous: ReadonlyMap<number, Required<IPlaytestPointer>>, next: readonly IPlaytestPointer[], ): IBrowserPointerChange[]

Use it to

  • reconcile pointer contacts into down move and up events

Example

ts
import { reconcileBrowserPointers } from "@threenative/playtest/runner";
const changes = reconcileBrowserPointers(new Map(), [{ id: 1, x: 20, y: 30 }]);

Good to know

  • returns changes only; the caller dispatches them and retains the next snapshot

recordToScenario

function · import { recordToScenario } from "@threenative/playtest/runner"

Convert captured runner observations into a replay scenario.

ts
function recordToScenario( value: unknown, scenarioPath = "recording.json", oracleValue?: unknown, ): IPlaytestScenario

Use it to

  • preserve a failing playtest as a replay fixture
  • require assertions before recording a scenario

Example

ts
const scenario = recordToScenario(recording);

Good to know

  • an empty assertion set is a failure

requireAssertions

function · import { requireAssertions } from "@threenative/playtest/runner"

Convert captured runner observations into a replay scenario.

ts
function requireAssertions( value: IPlaytestScenario["assert"], scenarioPath: string, ): NonNullable<IPlaytestScenario["assert"]>

Use it to

  • preserve a failing playtest as a replay fixture
  • require assertions before recording a scenario

Example

ts
const scenario = recordToScenario(recording);

Good to know

  • an empty assertion set is a failure

resolveBrowserArguments

function · import { resolveBrowserArguments } from "@threenative/playtest/runner"

Copy the selected Chromium arguments without silently enabling a rendering recipe.

ts
function resolveBrowserArguments(browserArgs: readonly string[] | undefined): string[]

Use it to

  • run a browser playtest with Vulkan WebGPU

Example

ts
import { resolveBrowserArguments, WEBGPU_BROWSER_ARGS } from "@threenative/playtest/runner";
const args = resolveBrowserArguments(WEBGPU_BROWSER_ARGS);

Good to know

  • pass WEBGPU_BROWSER_ARGS explicitly; undefined selects no additional arguments
  • inspect the observed adapter before claiming hardware GPU evidence

resolveManagedServerCommand

function · import { resolveManagedServerCommand } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
function resolveManagedServerCommand( config: IStandalonePlaytestConfig, dynamicPort?: number, ): string

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

resolveManagedServerConfig

function · import { resolveManagedServerConfig } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
async function resolveManagedServerConfig( config: IStandalonePlaytestConfig, ): Promise<IStandalonePlaytestConfig>

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

rotatedTouchPosition

function · import { rotatedTouchPosition } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function rotatedTouchPosition(x: number, y: number, rotation: number): [number, number]

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

runAndroidPlaytest

function · import { runAndroidPlaytest } from "@threenative/playtest/runner"

Run a playtest on Android through the configured device transport.

ts
async function runAndroidPlaytest( config: IStandalonePlaytestConfig, dependencies: IAndroidPlaytestDependencies =

Use it to

  • execute a scenario on an Android target
  • collect Android playtest artifacts

Example

ts
await runAndroidPlaytest(options);

Good to know

  • the app bundle and device transport must be prepared

runDesktopPlaytest

function · import { runDesktopPlaytest } from "@threenative/playtest/runner"

Run a desktop playtest and collect its report.

ts
async function runDesktopPlaytest( config: IStandalonePlaytestConfig, dependencies: IDesktopPlaytestDependencies =

Use it to

  • execute a scenario against the desktop host
  • verify native desktop behavior from the same scenario

Example

ts
await runDesktopPlaytest(options);

Good to know

  • the desktop host must be built before launching

runDevicePlaytest

function · import { runDevicePlaytest } from "@threenative/playtest/runner"

Run a playtest on Android through the configured device transport.

ts
async function runDevicePlaytest( config: IStandalonePlaytestConfig, target: IDevicePlaytestTarget, ): Promise<IStandalonePlaytestReport>

Use it to

  • execute a scenario on an Android target
  • collect Android playtest artifacts

Example

ts
await runAndroidPlaytest(options);

Good to know

  • the app bundle and device transport must be prepared

runIosPlaytest

function · import { runIosPlaytest } from "@threenative/playtest/runner"

Run a playtest on the iOS simulator or device transport.

ts
async function runIosPlaytest( config: IStandalonePlaytestConfig, dependencies: IIosPlaytestDependencies =

Use it to

  • execute a scenario on an iOS target
  • collect iOS playtest artifacts

Example

ts
await runIosPlaytest(options);

Good to know

  • identify simulator versus physical transport in evidence

runStandalonePlaytest

function · import { runStandalonePlaytest } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
async function runStandalonePlaytest( config: IStandalonePlaytestConfig, options: IStandalonePlaytestRunOptions =

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

runStandalonePlaytests

function · import { runStandalonePlaytests } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
async function runStandalonePlaytests( config: IStandalonePlaytestConfig, ): Promise<readonly IStandalonePlaytestReport[]>

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

softwareAdapterName

function · import { softwareAdapterName } from "@threenative/playtest/runner"

Identify a software renderer in the fields reported by adapter.info.

ts
function softwareAdapterName(adapter: Readonly<Record<string, string>> | undefined): string | undefined

Use it to

  • reject a SwiftShader adapter as evidence

Example

ts
import { softwareAdapterName } from "@threenative/playtest/runner";
const software = softwareAdapterName({ architecture: "swiftshader" });

Good to know

  • undefined means no software name was found, not proof of a hardware adapter

substituteManagedPort

function · import { substituteManagedPort } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
function substituteManagedPort(command: string, port: number): string

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

summarizePipelineCapture

function · import { summarizePipelineCapture } from "@threenative/playtest/runner"

Parse and explain bounded shader-compilation captures.

ts
function summarizePipelineCapture(capture: IPipelineCapture): IPipelineSummary

Use it to

  • diagnose a slow shader-heavy launch from one browser or native capture
  • reconcile pipeline creation counts and compile timing

Example

ts
summarizePipelineCapture(parsePipelineCapture(captureText));

Good to know

  • incomplete or malformed captures never become a successful empty report

tapCommand

function · import { tapCommand } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function tapCommand(x: number, y: number): string[]

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

touchPositionForViewport

function · import { touchPositionForViewport } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function touchPositionForViewport( x: number, y: number, viewport: IAndroidTouchViewport, rotationOverride?: number, ): [number, number]

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

touchRotationFromWindowDump

function · import { touchRotationFromWindowDump } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function touchRotationFromWindowDump(dump: string): number | undefined

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

validateDeviceEndpoint

function · import { validateDeviceEndpoint } from "@threenative/playtest/runner"

Resolve a native device transport and its mailbox paths.

ts
function validateDeviceEndpoint(value: string): URL

Use it to

  • connect a native host to the playtest runner
  • validate an Android or iOS device endpoint

Example

ts
const paths = deviceMailboxPaths(projectRoot);

Good to know

  • paths stay inside the managed artifact directory

viewportPresentationCommands

function · import { viewportPresentationCommands } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function viewportPresentationCommands( viewport:

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

viewportPresentationObserved

function · import { viewportPresentationObserved } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function viewportPresentationObserved( override: string | undefined, expected: string | undefined, physical:

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics
  • verify that an Android device presented the requested viewport
  • accept the physical panel size when wm size omits its override line

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

viewportRestoreCommands

function · import { viewportRestoreCommands } from "@threenative/playtest/runner"

Drive and inspect Android playtest transport.

ts
function viewportRestoreCommands(): string[][]

Use it to

  • run a scenario on an Android emulator or device
  • parse Android console diagnostics

Example

ts
const adb = discoverAdb(process.env);

Good to know

  • Android evidence must name its target and transport

withBrowserCapture

function · import { withBrowserCapture } from "@threenative/playtest/runner"

Capture a ready ThreeNative game with the runner's display, lock, server and browser ownership.

ts
async function withBrowserCapture<T>( config: IStandalonePlaytestConfig, capture: (session: IBrowserCaptureSession) => Promise<T>, signal?: AbortSignal, ): Promise<T>

Use it to

  • write a custom browser capture without owning Xvfb or Chromium cleanup

Example

ts
import { parseStandalonePlaytestArgs, withBrowserCapture } from "@threenative/playtest/runner";
const config = parseStandalonePlaytestArgs(["--scenario", "playtests/smoke.playtest.json", "--url", "http://127.0.0.1:5173"]);
await withBrowserCapture(config, async (session) => session.screenshot("ready"));

Good to know

  • browser only; requires a scenario and runtime.startup; does not execute scenario steps or assertions
  • cancellation is checked between resource acquisitions; lock waiting retains its own bounded queue policy
  • use session.screenshot for nonblank PNGs; private-display captures are not FPS evidence
  • use threenative-playtest trace --url <url> for slow-frame attribution instead of creating another profiler

writeCaptureProvenance

function · import { writeCaptureProvenance } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
async function writeCaptureProvenance( artifactDirectory: string, provenance: IPlaytestCaptureProvenance, ): Promise<void>

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

writeObservationArtifacts

function · import { writeObservationArtifacts } from "@threenative/playtest/runner"

Execute scenario steps, assertions, and evidence capture.

ts
async function writeObservationArtifacts( artifactDirectory: string, requested: IPlaytestArtifactRequest | undefined, observations:

Use it to

  • run a complete browser or device playtest
  • capture diagnostics and screenshots from a managed server

Example

ts
const report = await runStandalonePlaytest(options);

Good to know

  • missing observations and malformed assertions fail closed

XcrunIosDriver

class · import { XcrunIosDriver } from "@threenative/playtest/runner"

Drive and inspect iOS simulator playtest transport.

ts
class XcrunIosDriver implements IDevicePlaytestDriver

Use it to

  • run a scenario on the iOS simulator
  • parse the launched native process identifier

Example

ts
const driver = new XcrunIosDriver(options);

Good to know

  • simulator evidence does not claim physical-device proof

adviseThreeRenderWorkload

function · import { adviseThreeRenderWorkload } from "@threenative/playtest/three"

Explain which render workloads should be collapsed or retained.

ts
function adviseThreeRenderWorkload(input: IRenderAdvisorInput): IRenderAdvisorReport

Use it to

  • diagnose a slow Three.js scene
  • choose a render optimization from observed workload data

Example

ts
const advice = adviseThreeRenderWorkload(input);

Good to know

  • use measured input rather than visual guesses

connectDevicePlaytestBridge

function · import { connectDevicePlaytestBridge } from "@threenative/playtest/three"

Connect a device-hosted game to the playtest bridge.

ts
function connectDevicePlaytestBridge( bridge: IPlaytestBridgeV1, endpoint: string, ): IDeviceBridgeInstallation

Use it to

  • run the same playtest on an Android or iOS target
  • read the device bridge endpoint

Example

ts
const connection = connectDevicePlaytestBridge(bridge, endpoint);

Good to know

  • use the device transport selected by the runner

installThreePlaytestBridge

function · import { installThreePlaytestBridge } from "@threenative/playtest/three"

Install the playtest observation bridge for a plain Three.js game.

ts
function installThreePlaytestBridge(options: IThreePlaytestBridgeOptions): IThreePlaytestBridgeInstallation

Use it to

  • expose a non-ThreeNative game to the scenario runner
  • add semantic observations to a browser playtest

Example

ts
const bridge = installThreePlaytestBridge(options);

Good to know

  • install once before the runner connects

observeSceneResources

function · import { observeSceneResources } from "@threenative/playtest/three"

Observe the room a game is played in — lights, materials, fog, background and camera framing.

ts
function observeSceneResources(scene: Scene, camera: Camera): IPlaytestSceneObservation

Use it to

  • ask why a frame is black or washed out without opening a screenshot
  • ask what lights, materials and framing a running game actually has

Example

ts
const room = observeSceneResources(scene, camera);

Good to know

  • reports counts and names only; it decides nothing about how the game looks
  • reports counts and names only; nothing here decides how the game looks
  • a walk that hits SCENE_WALK_OBJECT_CAP reports truncated: true

readPlaytestEndpoint

function · import { readPlaytestEndpoint } from "@threenative/playtest/three"

Connect a device-hosted game to the playtest bridge.

ts
function readPlaytestEndpoint(): string | undefined

Use it to

  • run the same playtest on an Android or iOS target
  • read the device bridge endpoint

Example

ts
const connection = connectDevicePlaytestBridge(bridge, endpoint);

Good to know

  • use the device transport selected by the runner

ThreePlaytestPhysicsRecorder

class · import { ThreePlaytestPhysicsRecorder } from "@threenative/playtest/three"

Record Three.js physics bodies for playtest observations.

ts
class ThreePlaytestPhysicsRecorder

Use it to

  • assert physics contacts in a plain Three.js game
  • capture bounded body state for a scenario

Example

ts
const physics = new ThreePlaytestPhysicsRecorder(worldPhysics);

Good to know

  • keep recorder limits within the documented caps
View source on GitHub ↗