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.
The bundle schema is the contract
Section titled “The bundle schema is the contract”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.
| Runtime | Artifact | Status |
|---|---|---|
| Patterplay JS | @patterkit/runtime (+ patterplay.min.js) | Available: corpus-verified |
| Patter CLI | @patterkit/cli | Available: corpus-verified |
| Patterplay Unity | GitHub Release (UPM) | Available: corpus-verified |
| Patterplay Unreal | GitHub Release (plugin) | Available: corpus-verified |
| Patterplay Godot | GitHub Release (addon) | Available: corpus-verified |
The shared test suite
Section titled “The shared test suite”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.
Why this matters
Section titled “Why this matters”- 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 Ian Thomas · patterkit.com