← All projects

Published by KnownBetter Studios → This page is the engineering case study.

And More Will Follow

In development

A deterministic tile game with a portable C simulation, exact 2,048-bit arithmetic and native shells for input, lifecycle and pixels.

GameIncrementalPuzzleCSwiftiOS

At a glance

  • Outcome: Implements deterministic 2048-style tile-to-idle-city play with clockwork automata and knowledge-preserving resets. Links product page, screenshots and release plans.
  • Status: Targets its first Android/iOS/Windows/macOS/Linux release for late 2026. The September 6, 2026 pre-alpha includes portable C core, City renderer, Simulator-tested iPhone/read-only-watchOS shells and Apple-free Linux tests; Godot 4 remains its behaviour reference.
  • Role: Led architecture, contracts, save/render rules and tests solo; reviewed AI-assisted code.
  • Stack & libraries: Uses C11/CMake, SwiftPM/SwiftUI, iOS 16/watchOS 10, Xcode and Linux Nix shells with clang/GCC/Swift 6.3.3. No engine.
  • Validation: Runs 34/33 CTests under clang/GCC over 28 C files, 66 SwiftPM tests (last Linux: 63, none skipped), and 80 Apple shell tests. Covers mechanics/exact amounts/ABI, BSS/stack budgets, fixture checksums, player-copy lint, City asset regeneration and optional screen-reader-order UI tests. UBSan passes; AppleClang 17/macOS 26 blocks ASan.
  • Limitations: Lacks signed builds/TestFlight/Android/desktop shells/monetization. The widget builds unembedded; old saves are refused, not migrated. The navigation ADR’s ABI/interface bump is incomplete; Godot’s state-machine workbench did not transfer.

Architecture

Rebuilt the loop-proven, engine-owned, 178-test-file Godot version against rewritten language. The provenance-documented tree is read-only evidence; no code transferred. Portable C owns authority; shells own lifecycle/input/rendering/accessibility.

Exposes seven calls: workspace setup, World command, projection, save migration, compact-save decode, companion-byte projection and validation. Callers own the 1,310,720-byte workspace and 65,536-byte-maximum saves. Heap-free, nonrecursive C has a 4,096-byte BSS cap and FNV-1a fingerprints of public type layouts. Exact 2,048-bit naturals use 128 sixteen-bit limbs, not native integers or floats. C supplies canonical decimal, abbreviated and scientific forms; Swift decodes.

Saves

Uses World/compact save format 8. A September 2026 scoring change altered older Round histories, so formats 1 through 7 are refused transactionally. Tests stamp each old version, a future version and frozen v5 fixture, requiring unsupported status and unchanged bytes. Checksums cover 66 v1-v6 fixtures.

WorldAuthority writes/flushes immutable generations, atomically replaces the manifest, then reopens/verifies before receipts. Opening distinguishes valid, recoverable interruption, corrupt, unsupported legacy and future states. Only an absent store creates a World; durability tests interrupt and corrupt it.

Platform

An accepted ADR assigns meaning/content to C and appearance/speech/layout natively. On September 5 two C modules replaced Swift’s opening reducer and Directory/rail/shortcut normalisation. Thin bindings passed 8 opening/16 reachability tests unchanged; both libraries have zero data/BSS symbols under Linux clang and GCC.

A deterministic one-bit renderer maps validated snapshot/camera/tick/Reduce Motion to City pixels and typed accessibility data. Callers supply 240×192 maximum framebuffers (46,080 bytes). CTest rebuilds the Python-compiled 238,680-byte art package and rejects drift. WatchConnectivity sends read-only 532-byte snapshots. Nonshipping, unregistered GRAY8 evidence covers 160×96/320×192; a runner verifies all 264 checked-in FNV-1a frame hashes.

Features

Supports 3×3/4×4/5×5 boards beyond 2048, with cutouts, lift cells, named hazards, boosts and a fixed rank-11 goal. Includes three sectors, nine infrastructure stages, exact foreground/elapsed production, ordered works list, cycle-bounded frame/chip/imprint automata, repeatable proofs, six forgettings and remnants. The iPhone shell includes opening, ident, held title, navigation, four main places, Tower/City directories, Tower rooms and Settings. Linux builds all code below views.