Skip to content

Support the new .vrtx project format (Studio v0.2.1) - #18

Merged
N7z merged 2 commits into
developfrom
feature/vrtx-format
Aug 17, 2026
Merged

N7z merged 2 commits into
developfrom
feature/vrtx-format

Conversation

@N7z

@N7z N7z commented Aug 17, 2026

Copy link
Copy Markdown
Owner

What

Studio v0.2.1 stopped saving projects as JSON. A .vrtx file is the ASCII magic VRTX, a container version byte, then a zstd frame that decompresses to a one-byte inner schema version followed by the ProjectData struct in bincode (classic little-endian, fixed-int). The old JSON still opens in Studio.

Changes

  • resources/js/studio/vrtx.js — a small bincode codec for the ProjectData schema. Decompresses with fzstd; with no bincode compressor on hand it writes the zstd payload as a valid raw-block frame, which the reference zstd decoder (and so the Studio) accepts.
  • Export now writes .vrtx by default; .json stays as a legacy menu item.
  • Import (upload + start screen) sniffs the VRTX magic and reads either format.
  • sun_rotation is a field of the format as of v0.2.1, so it now rides in the document (both formats) rather than only in the map.
  • Major version bump to 3.0.0 (breaking format change).

Verification

Reverse-engineered under the developer's consent (VortexStuff/docs/CONSENT.md), then checked against a file the real Studio wrote:

  • Our decoder reads the real .vrtx and matches its JSON twin field-for-field, including the enum orders (note Smooth is material index 0).
  • Our encoder's inner bincode is byte-identical to the Studio's.
  • Our hand-rolled zstd frame passes the reference zstd -t.
  • 51 tests pass (npm test), including a new scripts/vrtx.test.mjs that keeps the codec pinned to a committed real-Studio sample. npm run build is clean.

Closes #17

Studio v0.2.1 saves projects as .vrtx, not JSON: a "VRTX" magic and a
version byte, then zstd-compressed bincode of ProjectData (with a leading
inner schema byte). New resources/js/studio/vrtx.js is a small bincode
codec for that schema — it decompresses with fzstd and, having no bincode
compressor to hand, writes the zstd payload as a valid raw-block frame the
Studio's decoder accepts. Verified against a file the real Studio wrote:
our inner bincode is byte-identical.

- Download now writes .vrtx by default; .json stays as a legacy option.
- Import (upload and the start screen) sniffs the VRTX magic and reads
  either format.
- The sun direction (sun_rotation) is a field of the format as of v0.2.1,
  so it rides in the document now instead of only in the map.

Breaking format change, so a major bump to 3.0.0.

Refs #17
@N7z N7z self-assigned this Aug 17, 2026
@N7z
N7z merged commit 1a33f54 into develop Aug 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant