Skip to content

Compatibility & conformance

“Write once, play everywhere” is only worth anything if it’s actually true. Patter backs it up with one versioned contract and a shared test suite every runtime has to pass, so parity is something you can check, not just hope for.

One .patterc bundle loads into each Patterplay runtime (JavaScript, Unity, Unreal, Godot); every runtime is checked against one shared corpus.json on each release, so a story behaves the same wherever it runs. .patterc one schema: patter/bundle@N JS / Web Unity Unreal Godot corpus.json the shared contract, checked on every release The same language-neutral cases, pinned so a conforming runtime reproduces them exactly.

A compiled bundle declares a schema version (patter/bundle@N). A runtime plays any bundle whose schema it supports. The schema is the one version that cuts across everything: bumping it is the only thing that forces every runtime to update together. Everything else (each runtime’s own features, the editor, the CLI) versions on its own.

RuntimeArtifactStatus
Patterplay JS@patterkit/runtime (+ patterplay.min.js)Available: corpus-verified
Patter CLI@patterkit/cliAvailable: corpus-verified
Patterplay UnityGitHub Release (UPM)Available: corpus-verified
Patterplay UnrealGitHub Release (plugin)Available: corpus-verified
Patterplay GodotGitHub Release (addon)Available: corpus-verified

Every one of the four runtimes (JS, Unity, Unreal, Godot) has to pass the same set of shared tests: a single, language-neutral corpus.json of hand-written cases that pin down the exact behaviour a conforming engine must reproduce. It covers:

  • Expressions: the evaluator, the Patter dialect (random, flags, seen, visits, …), and the seeded random-number generator, giving identical results on every engine.
  • Playthroughs: scenes, blocks, groups, selectors, sticky/fallback options, call/return, conditions and effects, visit counts, {@ref} interpolation, and locale + character-name resolution (including the <Untranslated: {id}> fallback).
  • Scripted operations: save/load round-trips, multiple flows, reset.
  • Game Data: filling in defaults as values are read.

Each port ships a small test host that replays the same corpus.json in its own language and checks it gets identical results. Every port passes the full set of tests: the JavaScript reference, the C# (Unity) port on .NET, the C++ (Unreal) port under clang, and the GDScript (Godot) port on Godot 4.7, matching down to the random draws.

  • For you: you ship on one engine, and this is what makes your engine trustworthy. It plays the story exactly as Patterpad’s preview and the reference runtime do, the same choices, conditions, saves, right down to the random draws. What your writers saw in the editor is what your players get: no “works in the editor, behaves differently on my engine” gap to chase.
  • For a new engine: adding a runtime is “build the engine, run the tests.” If they pass, it’s conformant. The test suite is published as a versioned release asset, so a port author has an exact target to hit.

It’s not “should match.” It’s checked, case by case, and re-run on every release.

→ Back to Playing in your game.

MIT-licensed open source · Made by · patterkit.com