Versions, compatibility, and 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.
Versions and compatibility
Section titled “Versions and compatibility”Patter is at 1.0: its shape has settled. From here every public package, runtime, app, and library in the family follows semantic versioning, with one meaning of “breaking” for all of them: a change that makes your game, your project, or your build pipeline do something before it works again.
- A patch (1.0.x) is fixes. Nothing that plays changes unless it was wrong.
- A minor (1.x.0) adds: new API, new format fields with defaults, new features. Everything that worked keeps working, unchanged.
- A major (2.0.0) removes or changes the meaning of something, collected together, with a migration guide and tooling. One happens when a break is worth it, not on a calendar.
What a minor may not break:
- Bundles. A bundle compiled by any 1.x compiler plays on the same or any later 1.x runtime. The other way round isn’t promised: a minor may add to the format, so build with a compiler no newer than the Patterplay you ship, which the Download page keeps together.
- Saves. A save written by any 1.x runtime loads in any later 1.x runtime.
- Projects. A 1.x project opens in any later 1.x Patterpad, migrated in place where a field has changed.
- The public API of all four runtimes: the JavaScript exports, Unity’s public members, Unreal’s Blueprint nodes and public C++, and Godot’s methods and signals. A removal or a change of meaning waits for a major. A rename adds the new name and marks the old one deprecated in each runtime’s own way, and the old name stays until the next major.
- The expression kernel, which Patterplay shares with the Storylet Engine: a kernel change is a major on every runtime that carries it.
Who shares a number:
- The four Patterplay runtimes share one version and move together. A feature lands in all four in one release,
or in none. This is the version your game sees, and the one an extension checks with
versionInRange. - The libraries (
@patterkit/*on npm) have their own versions. Patterpad and the CLI have theirs, and release whenever a library they bundle moves, so a download never carries an older library than npm does. - Extensions such as Patterstage have their own versions, each declaring the Patterplay range it runs on.
Deprecated API in force: none at 1.0.0. What’s new lists each release.
The bundle schema names the shape, not the version
Section titled “The bundle schema names the shape, not the version”A compiled bundle declares a schema (patter/bundle@0), and a save declares its own (patter/save@0).
These name the shape of the data, not the product version, and they change only for a break the runtimes
can’t read past, which is a major. Every 1.x runtime reads patter/bundle@0.
| 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 cover the evaluator, the Patter dialect (
random,flags,seen,visits, …), and the seeded random-number generator, giving identical results on every engine. - Playthroughs cover scenes, blocks, groups, selectors, sticky/fallback options, call/return,
conditions and effects, visit counts,
{@ref}interpolation, and locale and character-name resolution (including the<Untranslated: {id}>fallback). - Scripted operations cover save/load round-trips, multiple flows, and reset.
- Game Data covers 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”You ship on one engine, and this is what makes your engine trustworthy. It plays the story exactly as Patterpad’s preview and every other Patterplay 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, with 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.
Open source under the MIT licence, made by Ian Thomas.