Prism has several contracts, each with its own version number. This page lists them, says what each does when it does not match, and says where to read what changed.
The version numbers
| Contract | Where you write it | Today | When it does not match |
|---|---|---|---|
| Mod API (mods, skins, map scripts) | apiVersion in defineMod, defineSkin, defineChart |
2 |
The script is not loaded. Equality, not a minimum. |
| Theme API | themeApi in theme.json (optional) |
1 |
A theme that asks for a newer version is refused; an older one loads; absent means 1. |
| Editor API (map editor mods) | apiVersion in defineEditorMod |
1 |
A separate number from the mod API; the editor declarations are their own block of modding.d.ts. |
| Game protocol | PROTOCOL_VERSION, negotiated by features |
1 |
There is no v2: messages are additive and features are negotiated. See online API. |
| Catalogue | schema of GET /api/catalog |
1 |
No v2: readers ignore unknown fields. |
| Release list | schema of releases.json |
1 |
See Release list. |
Replay (.pvreplay) |
the byte after the PVRZ magic |
1 |
A newer file: "The replay was made by a newer version of the game". |
| Playlist, marathon | version of the JSON |
1 |
A newer file is refused with "…made by a newer version of the game" (playlist) or "…needs a newer Prism" (marathon). |
| Hashes | noteHashVersion, HASH_VERSION |
1 |
A stored hash of another version is recomputed. |
A package also has its own semantic version (version: "1.2.0"). That one is the author's: it orders the releases of one mod, and other packages can require a range of it with uses (see Concepts).
The mod API: apiVersion
The game speaks one version of the mod API (API_VERSION, 2 today). A mod, a skin or a map script declares the version it was written for, and it must be equal:
`my-mod` requires modding API version 1; this game provides version 2
the map script requires modding API version 1; this game provides version 2
The first message is what the Mods page shows for a mod or a skin written for another version; the second is for a map script. The script is not loaded and the rest of the game goes on. Nothing is run, so no half-working state exists.
TypeScript cannot catch this: in modding.d.ts the field is a plain number, so apiVersion: 1 type-checks and the game refuses it. See Troubleshooting.
The SDK file is generated from the Rust contracts of the game and its first line names the version it describes (// Modding API version 2.). The SDK reference states the version of the page you are reading. To move a mod to a new version:
- Download the
modding.d.tsof the game version you target (modding.d.ts) and replace the one your project uses. - Run
tsc: every function, event, field or type that changed or went away is now an error. - Fix those, then set
apiVersionto the new number. - Try the mod in the game and read the Mods page for load errors.
Declare apiVersion as the number written in the SDK header, not as a range: a mod cannot say "2 or later".
The theme API: themeApi
A theme says which version of the theme contract it was written for with "themeApi": 1 in theme.json. The game speaks one version, THEME_API, which is 1 today.
- Absent, the field means 1: every theme written before it existed.
- A value that is not a whole number from 1 is refused, and the message says what was found.
- A theme that asks for a newer version than the game speaks is refused with one sentence:
themeApi N is newer than this game speaks (theme API M): update the game, or use a version of the theme written for API M. - A theme that asks for an older version loads for as long as the game can still read it.
A second version of the theme contract is planned: when the contract needs a change that would break themes, it becomes theme API 2, published next to API 1 for as long as the game can keep both. Until it ships, write "themeApi": 1. The rules are in Interface themes and the list of what needs a new version is in what a new version means.
What counts as breaking
For themes the contract is written down. These stay inside a version and never break a theme: adding an input path, an output, a node kind or a property, widening a limit, changing what a theme cannot see. These need a new version: removing or renaming a path, a part, a token, a node kind or a property, changing the type of a path, making an optional place required.
For mods, skins and map scripts, the contract is the SDK file shipped with the game. What the game can do is compare apiVersion; everything else is checked while the script runs. So, for your script:
- Adding to the SDK does not touch a script that does not use it: a new function, event, optional field or enum value.
- Removing, renaming or retyping a function, event, field or value you use makes the script fail where you use it, with an error on the Mods page. If the API version changed, the script is refused at load instead.
- Tightening a limit (a smaller budget, a shorter text) makes a script that sat close to the old limit fail with the usual validation error. The numbers are in Limits.
Read the diff of modding.d.ts between two game versions: it is generated, so it is exact.
Where the release notes are
Release notes are written for players, in plain words, once per release, in English and in French.
| Where | What |
|---|---|
/changelog/ (French: /fr/changelog/) |
The notes of every release of each channel, read from the release list. |
| In the game: Settings → System → Updates → What's new | The notes of the installed version, and the notes of what you have not seen after an update. |
CHANGELOG.md and CHANGELOG.fr.md |
The full log, newest first, installed next to prism.exe and kept in the repository. |
docs/changelog/v<version>.en.md, .fr.md |
The body of the notes of one version, as published. |
A version of the log has sections New, Improved, Changed, Fixed and Known limits. The top section, [Unreleased], is the work not shipped yet. The log is about what changes for a player and is written in player words (a check refuses developer jargon), so it rarely names an API call. For the developer side, the sources are the generated SDK (its header and its diff), the SDK reference, and these pages, which are generated from the code and the SDK.
When a mod or a theme stops working after an update, check in this order: the Mods page (or the theme error shown with its file and reason), the apiVersion or themeApi number against this page, then the changelog entry of the version that updated.