Skip to content

OnlyWorlds Unity SDK 0.8.0

Choose a tag to compare

@tmoosting tmoosting released this 20 Oct 18:18
· 95 commits to main since this release

A world folder zipped as one .owworld file imports into Unity as a read-only world cache, measured in the Editor, a
desktop player, an Android IL2CPP player and a WebGL player; the calendar reader follows the new atlas_calendar
profile and its conformance fixture; the schema pin moves to dist.33. A minor release because it adds public API
(below).

Added

  • World archives, .owworld (a spec world zip, renamed: one world, as one top-level folder or with world.json
    at the root). Drop one into Assets/ and it imports as a read-only OWWorldCache; a zip with no world or two is an
    import error, never a guess. The cache is keyed by the world's id and the archive asset's GUID
    (OWWorldArchive.KeyFor(worldId, guid)), so the asset carries no machine's path and keeps its key through a move.
    The archive is read in memory, never extracted, and an entry name that is absolute or climbs out of the world
    refuses the archive. Assets/OnlyWorlds/Pack World Folder... packs a folder from anywhere
    on disk into the project and imports it; OWWorldArchive.Pack(folder, archive) is the same step from code. Pack
    writes only the archive, never into the folder; packs world.json, elements/, spatial/ and media/, leaving out
    dot-folders, dot-files and Unity .meta files, and records/ whole and byte for byte (folder spec §4.5: a producer's
    files are never dropped; the importer reads none of them); drops world.json's api block (it holds a key) unless asked to
    keep it; and is deterministic (ordinal entry order, a fixed timestamp). OWWorldArchive.Read(archive) gives a folder
    read's result. Media travels in the archive but is not imported yet.
  • OWFolderReader.ReadEntries(entries, includeLegacySpatial?, source?) reads a world held in memory, as
    (path inside the world, text) pairs, by the folder read's own rules and code; Read(folder) is unchanged.
  • OWFolderLoader.LoadInto(cache, read, key, readOnly?) fills a cache from a read already done, so it is not paid
    twice. LoadInto(cache, path) now calls it and behaves as before.
  • Measured on Tuvsh Ul (3,829 elements): an imported archive loads about 5-6x faster than the folder reader from
    cold in a release desktop player, and the asset and a runtime OWWorldArchive.LoadInto both work in an Android
    IL2CPP player and a WebGL player (Minimal stripping; higher stripping untested).

Changed

  • OWJoin.ParseLink names the link shape with the preview on, <site>/join/<world_id>#<code> (keel #422), and a
    test holds it. Its behaviour is unchanged: it always read the code after the last #.
  • The schema pin moves from dist.24 to v0.32.2-dist.33 (canonical 00.32.02): two descriptions in the generated
    models (an Event's characters are those who know of it; a Narrative's dates are when it is told), and
    ow-presentation.json gains each type's public list (the fields shown on a known-of element). The walk and the
    rulings are unchanged.

Fixed

  • The calendar reader follows the atlas_calendar profile (schema-dist profiles/calendar.md, dist.33) and the
    TypeScript kernel 4.42.2, checked by the profile's conformance fixture, now vendored (OWCalendarFixtureTests: 52
    cases, 113 steps). A down era counts its years from the one holding the step before its pivot, so a mid-year pivot
    has no year 0, and ParseDate is its inverse again; at equal starts an up era wins over a down one, then the later
    in the list; an eras or intercalary that is present but not a list (false, 0, "") is not a calendar; a
    calendar written as a JSON string is read only when it is strict JSON.