Help us shape the future of Go! Take the 2026 Go Developer Survey

karty-sdk

module
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: MIT

README

Karty SDK

The public contracts shared by the Karty CLI, public compilers and game engine. This Go module builds independently of engine source and credentials.

Package Responsibility
format/cartridge Game manifests, embedded assets, Wasm sections and streaming media catalogs
format/level Versioned level envelopes and modules
format/worldchunk Independent render chunks, offline meshes and conservative streaming visibility
format/actions Candidate authored sequences, action literals and level-scoped actor references
format/world Canonical compiled convex-sector worlds, lighting, mapping and static solids
format/worldparticles Bounded GPU sprite particle presets, schedules and emitter motion envelopes
format/worldsource Separately versioned room, prefab, port and content authoring semantics
format/worldmaterial Material atlases, mip tails and strength controls
format/worldlightmap Static receiver charts, bake recipes and completed prebake formats
bake/worldlightmap Deterministic CPU direct/diffuse RNM baking
format/performance Binary adaptive presentation profiles
codec/qoi, codec/qoa Bounded adapters around pinned image and audio codecs

The SDK owns formats and shared validation. Public compilers own authoring parsing and expansion; the CLI owns project building and asset processing; the engine owns runtime execution and graphics. Published package paths remain stable. Detailed contracts live beside their owning packages.

Development

Install the pinned tools with mise, then run from this repository root:

mise install
mise run fmt
mise run check-fmt
mise run lint
mise run test
mise run build
mise run test-race
mise run test-simd-emulated
mise run test-32
mise run test-wasm
mise run fuzz
mise run bench

The shared checks in hk.pkl use golangci-lint for Go (including govet), yamllint for YAML, Taplo for TOML, and Prettier for YAML layout, JSON, Markdown and web files. Taplo validates syntax without downloading schemas.

mise install installs the pinned tools and repository pre-commit hook through mise; use mise run install-hooks to reinstall it. The hook checks staged files and applies formatting fixes while preserving unstaged work. fmt applies all formatters through hk without staging; check-fmt reports differences without writing files. lint runs all format and lint checks; check also runs tests and build. Generated Go and *.generated.* snapshots, derived output and local contributor directories and binary fixtures are excluded from formatting. Authoring YAML fixtures retain their decoder input format; yamllint checks them.

After changing typed world/lightmap/material declarations, regenerate their checked-in codecs with mise exec -- go generate ./format/world. Runtime formats use bounded typed binary; tests reject JSON/reflection imports in format and codec production code. The candidate binary wire replaces released JSON artifacts and requires rebuilding levels and bake caches.

After changing authoring/actions/schema.json, regenerate consumer snapshots with their mise run generate-action-contract tasks; public SDK checks remain independent of private source.

The pinned mise environment enables Go 1.27 portable SIMD for the offline baker. Direct Go builds importing that package require GOEXPERIMENT=simd; format-only imports are unaffected. test-simd-emulated exercises Go's built-in fallback rather than a second production implementation.

test-race runs one package at a time to bound instrumentation overhead. Dense baker producer compatibility fixtures run in a separate process with the same nine-second timeout; both invocations retain race detection. test-32 executes native 386 tests on an x86 Linux host with 32-bit execution support. fuzz verifies each configured target exists before exploring it for a bounded budget; normal tests also run the seed corpus. test-wasm executes Go Wasm tests using the official Go runner and pinned Node, running one package at a time to bound memory use. Its launcher passes a minimal environment to stay within Go's 8 KiB argument/environment limit, preserving temporary paths and the GODEBUG and GOMAXPROCS runtime controls. It does not exercise browser graphics. Benchmarks report allocation totals and CPU time for fixed codec, material-atlas, connected-world and bake fixtures. See CONTRIBUTING for compatibility and review requirements.

Versions and releases

Go module tags (vVERSION) pin immutable public package dependencies. Engine artifact tags (sdk-vVERSION) version downloadable SDK bundles and hosts independently. SDK 0.0.8 contracts are documented as available features, rather than unfinished proposals; capability declarations still govern host support. Compiled worlds support versions 1–3, and authoring documents support versions 1–10. New optional features retain their explicit version gates and canonical encoding rules. Incompatible formats or producer behavior need a versioned decision and compatibility coverage.

The private engine workflow publishes SDK bundles, native hosts, browser Wasm, checksums and signatures here. This repository does not build private engine source. Game developers obtain these artifacts through Karty, without engine access or credentials.

Licensing

The MIT license covers this repository's source, exported SDK bindings and templates. The pinned codec dependencies have their own MIT notices in codec/qoi and codec/qoa. Official runtime binaries use the separate Karty Runtime License, which allows distribution with free and commercial games; private engine implementation source remains proprietary.

Directories

Path Synopsis
authoring
actions
Package actions exposes the editor schema only; it is not a runtime format.
Package actions exposes the editor schema only; it is not a runtime format.
bake
worldlightmap
Package worldlightmapbake implements deterministic CPU direct and diffuse bounced RNM lightmaps.
Package worldlightmapbake implements deterministic CPU direct and diffuse bounced RNM lightmaps.
cmd
karty-actions-schema command
karty-actions-schema exports the canonical public action schema into an SDK snapshot.
karty-actions-schema exports the canonical public action schema into an SDK snapshot.
codec
qoa
Package qoa provides bounded one-shot and incremental adapters around Karty's pinned QOA codec.
Package qoa provides bounded one-shot and incremental adapters around Karty's pinned QOA codec.
qoi
Package qoi provides a bounded adapter around Karty's pinned QOI codec.
Package qoi provides a bounded adapter around Karty's pinned QOI codec.
format
actions
Package actions owns the bounded binary runtime action document format.
Package actions owns the bounded binary runtime action document format.
asset
Package asset defines the public, versioned processing contract shared by Karty SDK manifests, the CLI asset processors, and runtime hosts.
Package asset defines the public, versioned processing contract shared by Karty SDK manifests, the CLI asset processors, and runtime hosts.
cartridge
Package cartridge defines bounded data embedded in a Karty game cartridge.
Package cartridge defines bounded data embedded in a Karty game cartridge.
level
Package level defines the bounded, versioned data envelope stored in a Karty level cartridge.
Package level defines the bounded, versioned data envelope stored in a Karty level cartridge.
performance
Package performance owns the versioned cartridge contract for adaptive presentation profiles.
Package performance owns the versioned cartridge contract for adaptive presentation profiles.
world
Code generated by internal/codegen/binary; DO NOT EDIT.
Code generated by internal/codegen/binary; DO NOT EDIT.
worldchunk
Package worldchunk defines build-generated render assets and conservative streaming visibility for one logical world.
Package worldchunk defines build-generated render assets and conservative streaming visibility for one logical world.
worldlightmap
Code generated by internal/codegen/binary; DO NOT EDIT.
Code generated by internal/codegen/binary; DO NOT EDIT.
worldmaterial
Package worldmaterial defines the build-time world material atlas contract.
Package worldmaterial defines the build-time world material atlas contract.
worldparticles
Code generated by internal/codegen/binary; DO NOT EDIT.
Code generated by internal/codegen/binary; DO NOT EDIT.
worldsource
Package worldsource defines the high-level, separately versioned room and prefab schema consumed by public world compilers.
Package worldsource defines the high-level, separately versioned room and prefab schema consumed by public world compilers.
internal
binwire
Package binwire implements bounded, canonical primitives for generated typed format codecs.
Package binwire implements bounded, canonical primitives for generated typed format codecs.
codegen/binary command
Command binary emits static typed field codecs from the public Go contracts.
Command binary emits static typed field codecs from the public Go contracts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL