`anm2ed convert <file> [--format json|xml] [--out PATH]` saves a document as
the editor does: XML (the default) is the game's copy with the editor's
embedded, animation layers flattened through their libraries; JSON is the
editor's own. Without --out the file is rewritten in place. JSON problems go
to stderr; a file that can't load or write exits 1, a bad --format 2. A
document loads without an OpenGL context now: its custom shaders just aren't
compiled. The file and --out are made absolute, so a bare file name has a
folder (render and frame crashed on one too).
JSON writes and reads "libraries" before "layers", so a layer's library index
is checked against the libraries rather than reported missing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Documents can be saved as the editor's own JSON (Save as JSON, in Configure's
Serialization row, off by default) and any .anm2 starting with '{' opens as
one. The schema is new, not an XML mirror: content items in arrays (an item's
index is its id), animations keyed by unique name (a repeat saves as "Name 2"),
groups nested, paired values as arrays, a frame on a region storing only the
region, ISO 8601 dates, every default left out, and one line per frame and
content item, with anything else that fits in 100 columns on one line. Unknown
XML isn't kept. Each part is described once (frame_io, track_io, model_io...)
and run by a JsonWriter or a JsonReader; simdjson parses (new submodule). A
JSON file that opens but has unknown keys, wrong types, unknown values or bad
indices lists them by location in a warning toast; libraries toast their load
problems too. With Save as JSON on, saving always shows the Isaac warning.
The extended format is gone: no setting, File menu toggle, ExtendedVersion or
isExtendedFormat. XML saves are always the game's copy with SourceDocument;
old extended files still open. Document saves take Options instead of loose
bools, and model_load reads through model_load_string. docs/json_format.md
replaces docs/extended_format.md; goldens lose ExtendedVersion and the
.extended variants.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Events are plain again: no built-in names offered, locked or listed in the
Events window, and the game's copy of a trigger keeps its first event. The
list rows' rename lock and event_id_resolve go with them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/extended_format.md describes ExtendedVersion 2 for converters and game
loaders: libraries, animation layers and how children are placed, timed and
fire triggers, multiple events, SVG spritesheets, the frame attributes and
the transform, and what a Rebirth copy keeps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>