Docs

CairnGames

Install and make Cairn yours, the physics game in RealityKit. Version 1.0.0.

A balance stacker in real 3D physics: set river stones one on another on a misty loch shore, twist each to fit, and see how high it stands. This guide takes you from download to a running game under your own name. It covers version 1.0.0. See the screens on its game page.

Requirements

  • Xcode 26 and an iOS 17.0 or later deployment target
  • Tuist 4 (brew install tuist)
  • An Apple Developer team for devices, Game Center, iCloud and the widget. The simulator runs without one.

Install

Download

Included with Games. Not signed in? The button takes you to sign in or create an account, then starts the download when you're back. Unzip the archive; it contains one folder, Cairn/.

Make it yours

cd Cairn
scripts/setup.sh --name YourGame --bundle-id com.you.yourgame

The script renames the target, scheme and bundle ids, rewrites the StoreKit product ids and runs tuist generate. To keep the name Cairn for now, run tuist generate instead.

Run it

Open YourGame.xcworkspace, choose an iPhone simulator and run the YourGame scheme. The scheme uses Configuration/Products.storekit, so the shop works before App Store Connect is set up.

What's in the project

  • Content: 48 levels
  • Game Center: 3 leaderboards, 20 achievements
  • Shop: Sea glass pouches, Steady tokens, Supporter pack
  • Built on: GameCore, Feel, GameServices, Shaders, GameUI
  • Presets: dawn, haar, gloaming
  • Swift: 6,757 lines in 70 files

Rebrand options

OptionWhat it sets
--nameTarget, scheme and product name
--bundle-idBundle id. Modules, the widget, the App Group (group.<bundle-id>) and tests derive theirs from it
--display-nameThe name under the icon
--teamYour team id. Required for devices, Game Center, iCloud and the widget's App Group
--product-prefixApp Store Connect product ids. Defaults to the bundle id

The values live in Tuist/ProjectDescriptionHelpers/AppConfig.swift. Game Center ids are listed in Configuration/GameCenter.json (three leaderboards, twenty achievements); create them under your app in App Store Connect. Products are in Configuration/Products.storekit, which the scheme uses for local purchases.

Structure

App/                  @main, the root stage (loch backdrop + RealityKit shore + phase layer), deep links
Features/Home         The title: Build, the daily cairn, the open shore and the five places
Features/Shores       Six lochs of eight shores, each shore's goals card
Features/Play         The HUD (height, breeze, goals, next stones), pause and the fallen panel
Features/Results      The results card, marks, sea glass, keep in journal, the reminders ask
Features/Journal      Records, kept cairns as photos, the twenty keepsakes, leaderboards
Features/Stones       The collection of stone kinds and the four stone sets
Features/Shop         Sea glass pouches, Steadies and the Supporter pack (StoreKit 2)
Features/Settings     Light, sound, haptics, drop guide, reminders, accessibility, restore, credits
Modules/GameCore      Seeded RNG, value noise, daily seed, saves, event ring, synth (no game types)
Modules/CairnKit      The rules: stone kinds and shapes, mesh and texture generation, shores, the
                      bag, the breeze, the judge (standing, height, falls), the run, profile, rewards
Modules/CairnStage    RealityKit: the ARView, stone entities and physics, the rock and shingle,
                      breeze forces, the drop guide, the camera rig, the touch layer, snapshots
Modules/GameDesign    CairnTheme tokens (per light), glass, buttons, marks, swatches, the loch backdrop and its shaders
Modules/Feel          Sound bank, audio engine (water, breeze, bowls), haptic patterns
Modules/GameServices  Game Center, StoreKit 2, iCloud sync, reminders
Modules/Session       GameSession (phases, HUD, input, results) and the journal photos
Widget/               The Daily Cairn widget. Shared/ holds what it shares with the app
Design/StyleSpec.md   The art direction: tone, palette per light, type, glass, motion, sound
Tests/                Swift Testing for stones, shores, runs and meta; XCUITest for launch and menus

How it runs

  • RealityKit steps the physics at real gravity, in metres and kilograms. Stones are convex hulls with mass from their kind's density, so a stone that is thicker at one end really is heavier there. CairnStage reads every stone's pose each frame and CairnRun (plain Swift) decides from those poses alone whether the cairn stands, how tall it is, and whether anything fell.
  • Stones are built from a seed: StoneGeometry makes a superellipsoid mesh with taper, bend and lumps; StoneTexture paints its albedo from 3D noise so there is no seam. Both run off the main actor ahead of time, so spawning a stone never hitches.
  • The run emits RunEvents; the session turns each into its feedback (bells climbing a pentatonic as the cairn grows, clacks scaled by impulse and mass, haptics, toasts).
  • The stage is mounted once. Pausing switches the stones to kinematic; it never tears down.
  • The look is a theme: change LochColors, Palette or StageLight for a light and the backdrop, the 3D sun and every screen follow.

Tuning and how the shores' targets are set are documented in BALANCE.md.

Licenses

Fraunces and Manrope (bundled as subsets) are under the SIL Open Font License 1.1 (Licenses/). Everything else in the project is yours to ship with your game. See ASSET_MANIFEST.md.

Changelog

1.0.0

2026-11-05

  • First release: river stones stacked on a misty loch shore, with real 3D physics in RealityKit and SwiftUI screens over it.
  • Each stone is made from a seed: its own shape, weight and centre of mass, painted and meshed on the device. Nine kinds of stone, from greywacke to the rare heart stone, each with real density and grip.
  • Drag to carry a stone over the cairn, twist with two fingers to turn it and the view, and lift your finger to let it go. A dotted drop line shows where it will land.
  • 48 shores across six lochs, each with a fixed bag of stones, a target, a crown and three marks to earn. The lochs teach long stones, the breeze, slippery quartz, a leaning rock and gusts off the sea.
  • A daily cairn with the same stones for everyone, a streak and a Home Screen widget, and an endless open shore.
  • The breeze grows with the height of the cairn and gusts around its level, pushing every stone on it.
  • Steadies take back the stone that brought a cairn down and set the rest as they last stood.
  • A shore journal of the cairns you keep, as photos in the light they stood in, plus records and twenty keepsakes.
  • A stone collection and four stone sets (Highland, Basalt Coast, Machair, Heather), sea glass to earn, and a StoreKit 2 shop.
  • Three lights for the whole game: Dawn, Haar and Gloaming.
  • Game Center leaderboards and achievements, iCloud save sync, Reduce Motion, Increase Contrast and Game Mode.
  • Every sound synthesised on the device: stone on stone, water at the shore, the breeze, and singing-bowl bells.