Talk to Claude Code and Codex agents from an Apple Watch and an iPhone. Each agent is a character on the watch.
import SwiftUI
/// Tangle: a ball of yarn drawn in one thick pale-blue marker line, with a face on a crowd of its wires (the messy
/// scribble-lines sheet). The line is one pen stroke: it starts as a tight knot wound round and round under the face,
/// then goes round a ring drawing loops, and ends tucked back into the ball. Its mood is a handful of numbers (how big
/// the loops are, how far they swing out, orbits, spikes, flat, how alive) and each state is a target for them. Slow
/// waves run along the line all the time, so the loops slide past each other, swell and shrink and the whole mass shifts
/// and breathes; every point is a particle on a spring to where all that puts it, with tension along the line, so it
/// never cuts from one look to the next and the loops lag, overshoot and settle. Every loop is a little different, like
/// a hand's scribble, and the line never turns tighter than its own width. One flat colour, like the sheet.
/// It's yarn, and it behaves like yarn:
/// crown, one way: a thread pulls off it as you turn, the ball rolling on it as it comes off; the thread falls and
/// runs along the bottom of the screen, and reels back in (the ball rolling back) when you stop · the other way: it
/// winds itself tight, squinting with the effort, a click at each notch, and boings loose when you let go
/// shake: it wobbles like jelly and its loops fly loose and tangle; after, it knots itself back with a tug and shakes it
/// off; shaken hard, dizzy: spiral eyes, the ball circling and rocking, then it shakes that off too
/// touch: the threads near your finger stretch toward it and twang when you let go, the ball leans to you and gives
/// under the finger, the eyes follow it · tap: a twang, surprise, then a giggle; tapped too often, annoyed · stroke it
/// (pet): eyes closed, it purrs · hold a finger off it: an arm reaches out for it and follows it
/// the face: bigger than the sheet's and drawn on a rim of the yarn's own colour, so it reads even over a gap between
/// wires; it pops to each new expression and lags a little behind the body; it never goes away
/// idle: the calm ball alive with slow loops, eyes looking about; now and then it closes its eyes content · listening:
/// rounder, floating over its shadow, eyes closed and smiling, bobbing with your voice · thinking: eyes up, a small o,
/// a slow sway · working: a loop in three swings out into an orbit, eyes reading, a loop flicks out at each tool call ·
/// subagents: small yarn balls going round it · speaking: its mouth opens with its voice · done: orbits, the open smile,
/// sparkles · needs you: worried, the ball sags, a knock · blocked: wound tight and spiky, trembling · dizzy: above ·
/// sleep: sags flat into a puddle, breathing
final class TangleStage: Staged {
static let shared = TangleStage()
let ownsApproval = false
let holds: [ChumsState: Double] = [.done: 2.6, .dizzy: 3.4]
func captionTop(_ r: Rig) -> Bool { false }
func ownsCaption(_ r: Rig) -> Bool { false }
/// It never stops moving, but slowly enough in the calm states to draw at 30 frames a second.
var calm: Bool { t - busyAt > 0.6 }
// the sheet's colours, its scale, its marker
static let blue = Color(red: 155 / 255, green: 194 / 255, blue: 229 / 255)
static let ink = Color(red: 0.01, green: 0.01, blue: 0.015)
/// The face: white on the yarn.
static let faceInk = Color.white
/// pt per pixel of the sheet (its cells are 341 px): everything here is in the sheet's pixels.
static let K = 0.49
/// The marker's width.
static let W = 15.5
/// Points in the ball (the first `kN` of them the knot under the face), points in the end of the line.
static let N = 380, A = 60, kN = 76
/// The tightest a loop may be made: a radius of 0.9 of the marker's width.
static let minRadius = 0.9 * W
/// A kink: the line turning more than this between two points half a stroke apart.
static let kink = 60 * Double.pi / 180
/// The arm's shoulder never turns tighter than this.
static let shoulder = 2.4 * W
/// The drawn line's points: half a stroke apart.
static let step = 0.5 * W
/// The face: bigger than the sheet's, each mark on a rim of the yarn's colour this wide.
static let faceScale = 1.2, rim = 11.0
/// The thread the crown pulls off: at most this long, never turning tighter than `strandBend`.
static let maxStrand = 430.0, strandBend = 2.2 * W
// MARK: mood
fileprivate enum Y: Int, CaseIterable {
case R, turns, ring, rounds, rl, rlv, ecc, lean, orbit, swirl, spike, loose, mess, flat, sag, arm, aimx, aimy
case curlAng, faceX, faceY, life, tempo
}
private static let base: [Double] = {
var m = [Double](repeating: 0, count: Y.allCases.count)
let d: [Y: Double] = [.R: 122, .turns: 14, .ring: 0.36, .rounds: 1.2, .rl: 0.5, .rlv: 0.2, .ecc: 0.3, .lean: 0.2,
.mess: 0.25, .aimx: -1.7, .aimy: -0.4, .curlAng: -0.5, .life: 1.05, .tempo: 1.75]
for (k, v) in d { m[k.rawValue] = v }
return m
}()
private static func mood(_ d: [Y: Double]) -> [Double] { var m = base; for (k, v) in d { m[k.rawValue] = v }; return m }
/// Each state's shape and how alive it is, fitted to its cell on the sheet. (Every state winds the same number of
/// loops: changing it would wind the line round, its ends fastest.)
private func target(_ s: ChumsState) -> [Double] {
switch s {
case .idle, .speaking: return Self.base
case .listening: return Self.mood([.R: 128, .rl: 0.5, .ring: 0.42, .faceX: -0.18, .life: 0.8, .tempo: 1.5])
case .thinking: return Self.mood([.lean: 0.6, .rl: 0.5, .ring: 0.38, .life: 0.75, .tempo: 0.8])
case .working: return Self.mood([.orbit: 0.45, .life: 1.05, .tempo: 2.6])
case .subagents: return Self.mood([.R: 108, .life: 0.8, .tempo: 1.5])
case .done: return Self.mood([.orbit: 1, .R: 116, .life: 1.25, .tempo: 2.6])
case .needs: return Self.mood([.sag: 1, .rl: 0.48, .ring: 0.36, .life: 0.8, .tempo: 1.1])
case .approval: return Self.mood([.R: 118, .rl: 0.5, .ring: 0.38, .life: 0.7])
case .blocked: return Self.mood([.spike: 1, .rl: 0.42, .ring: 0.32, .R: 116, .life: 0.6, .tempo: 3])
case .dizzy: return Self.mood([.swirl: 0.35, .loose: 0.5, .R: 118, .rl: 0.46, .ring: 0.44, .life: 1.2, .tempo: 2.2])
case .sleep: return Self.mood([.flat: 1, .R: 124, .rl: 0.5, .ring: 0.4, .life: 0.4, .tempo: 0.45])
}
}
/// How it moves in each state: a slow turn (rad/s), a float, a breath, a tremble, how much its line wanders.
private struct Motion { var drift = 0.06, bob = 0.0, breathe = 0.015, tremble = 0.0, wobble = 1.0 }
private func motion(_ s: ChumsState) -> Motion {
switch s {
case .idle, .speaking: return Motion()
case .subagents: return Motion(drift: 0.1)
case .listening: return Motion(drift: 0.1, bob: 4)
case .thinking: return Motion(drift: 0.04, wobble: 0.7)
case .working: return Motion(drift: 0.5, wobble: 1.2)
case .done: return Motion(drift: 0.4, wobble: 1.3)
case .needs: return Motion(drift: 0.08)
case .approval: return Motion(drift: 0.08, bob: 2)
case .blocked: return Motion(drift: 0.15, tremble: 1.1, wobble: 0.8)
case .dizzy: return Motion(drift: 0.12, breathe: 0, wobble: 1.3)
case .sleep: return Motion(drift: 0.02, breathe: 0.035, wobble: 0.5)
}
}
// MARK: faces (the sheet's marks, every part blends into the next)
private struct Look {
var pose = "00"
var eL = "", eR = "", eL2 = "", eR2 = "", bL = "", bR = "", m = "", cL = "", cR = "", sw = "", tg = ""
var look = 1.0, aim = P2.zero // how much the eyes follow the gaze; a fixed look (px)
var spirals = false // dizzy: spiral eyes
var key: String { pose + eL + eR + eL2 + m + tg + (spirals ? "@" : "") }
}
private static func dots(_ pose: String, mouth: String = "", scale: Double = 0.8) -> Look {
Look(pose: pose, eL: "21.eL@\(pose).eL*1.2", eR: "21.eR@\(pose).eR*1.2", m: mouth.isEmpty ? "21.m@\(pose).m*\(scale)" : mouth)
}
private func look(_ s: ChumsState) -> Look {
switch s {
case .idle, .subagents, .speaking: return Self.dots("00", mouth: "00.m")
case .listening: return Look(pose: "11", eL: "11.eL", eR: "11.eR", m: "11.m")
case .thinking: var l = Self.dots("00", scale: 0.65); l.look = 0; l.aim = P2(5, -7); return l
case .working: return Self.dots("00", scale: 0.6)
case .done: return Self.whee
case .needs: return Look(pose: "02", eL: "02.eL", eR: "02.eR", bL: "02.bL", bR: "02.bR", m: "02.m", look: 0.5)
case .approval: var l = Self.dots("00", scale: 0.65); l.look = 0; l.aim = P2(0, 6); return l
case .blocked: return Self.cross
case .dizzy: return Self.dizzy
case .sleep: return Self.sleepy
}
}
private static let content = Look(pose: "00", eL: "00.eL", eR: "00.eR", m: "00.m", look: 0)
private static let delight = Look(pose: "01", eL: "[email protected]*0.85", eR: "[email protected]*0.85", m: "01.m", tg: "01.tg", look: 0)
private static let whee = Look(pose: "01", eL: "01.eL", eR: "01.eR", m: "01.m", tg: "01.tg")
private static let surprise = Look(pose: "00", eL: "[email protected]", eR: "[email protected]", m: "[email protected]*1.7", look: 0.3)
private static let curious = Look(pose: "00", eL: "[email protected]*0.85", eR: "[email protected]*0.85", m: "[email protected]*1.1")
private static let frazzled = Look(pose: "12", eL: "12.eL", eR: "12.eR", m: "12.m", cL: "12.cL", cR: "12.cR", sw: "12.sw", look: 0.4)
private static let reaching = Look(pose: "21", eL: "21.eL", eR: "21.eR", m: "21.m")
private static let cross = Look(pose: "10", eL: "10.eLa", eR: "10.eRa", eL2: "10.eLb", eR2: "10.eRb", m: "10.m", look: 0)
private static let strain = Look(pose: "10", eL: "10.eLa", eR: "10.eRa", eL2: "10.eLb", eR2: "10.eRb", m: "[email protected]*0.7", look: 0)
private static let dizzy = Look(pose: "12", m: "12.m", look: 0, spirals: true)
private static let sleepy = Look(pose: "20", eL: "20.eL", eR: "20.eR", m: "[email protected]*0.7", look: 0)
/// A face part: its outline (64 points) blends from one shape into the next on a spring, or shrinks away and back.
private struct Part {
var from: [P2], to: [P2], b = 1.0, bv = 0.0, name = "", none = true
var shape: [P2] { b >= 1 ? to : Strokes.mix(from, to, b) }
var shown: Bool { !(none && b > 0.98) }
mutating func set(_ n: String, _ g: [P2]) {
guard n != name else { return }
let cur = shape
if n.isEmpty {
let c = TangleStage.centroid(cur); from = cur; to = [P2](repeating: c, count: cur.count); none = true
} else {
from = none && b > 0.98 ? [P2](repeating: TangleStage.centroid(g), count: g.count) : cur
to = g; none = false
}
name = n; b = 0; bv = 0
}
}
private static func centroid(_ p: [P2]) -> P2 { p.reduce(P2.zero, +) / Double(max(1, p.count)) }
private static let empty = [P2](repeating: .zero, count: ScribbleArt.N)
// eL eR eL2 eR2 bL bR m cL cR sw tg
private var parts: [Part] = (0..<11).map { _ in Part(from: TangleStage.empty, to: TangleStage.empty) }
private var shown = Look(), shownKey = "", gazeK = 1.0, aim = P2.zero, spiralK = 0.0
private var pop = (k: 0.0, v: 0.0) // the face pops to each new expression
private var faceOff = P2.zero, faceOffV = P2.zero // and lags a little behind the body
/// A mark, moved so its face's middle (between the eyes) is at 0.
private static func faceGlyph(_ name: String, _ pose: String) -> [P2] {
let o = ScribbleArt.faceOrigin(pose)
return ScribbleArt.glyph(name).map { $0 - o }
}
// MARK: the line
/// Its body: a ball of yarn, one thread wound round, the crown its spool (Yarn).
private let yarn = Yarn()
private var pos = [P2](repeating: .zero, count: TangleStage.N + TangleStage.A)
private var vel = [P2](repeating: .zero, count: TangleStage.N + TangleStage.A)
private var tgt = [P2](repeating: .zero, count: TangleStage.N + TangleStage.A)
private var shoulderKind = -1, aimA = 0.0, aimL = 1.6 // which of the four ways the shoulder took
private var drawn: [P2] = [] // the line as drawn (smoothed)
private var mood = TangleStage.base, moodV = [Double](repeating: 0, count: Y.allCases.count)
private var started = false
/// The waves along the line: their phase (runs at the mood's tempo), and a bigger swell now and then.
private var ph = 0.0, gustT = 9.0, nextGust = 3.0
// MARK: state
private var state: ChumsState = .idle
private var t = 0.0, busyAt = 0.0, stateT = 0.0
private var cur = Motion()
private var spin = 0.0, crownIdle = 9.0, crownAcc = 0.0
/// The crown: the thread pulled off (its length, px), how fast it reels back, which side it fell; how tightly wound.
private var strand = 0.0, strandV = 0.0, strandSide = 1.0, lastStrand = 0.0, tugT = 9.0
private var wound = 0.0, woundV = 0.0
/// The drawing's own turn: rolling on the thread, a thinking sway. The face never turns with it.
private var roll = 0.0, sway = 0.0, rot = 0.0
/// The whole body: where it sits, a jelly wobble (an offset that stretches it along itself), a lean.
private var center = P2(99, 128), cv = P2.zero, fingerOff = P2.zero, dragV = P2.zero
private var jelly = P2.zero, jellyV = P2.zero, tilt = 0.0, tiltV = 0.0, circle = 0.0
private var squash = (k: 0.0, v: 0.0), hop = (y: 0.0, v: 0.0), bump = 0.0
/// Shaken: how tangled its loops are (they come loose and scramble), and the knotting back and shaking off after.
private var tangle = 0.0, tanglePeak = 0.0, lastShake = -9.0, scramble = 0.0, shakeOff = 0.0
private var finger: CGPoint?, lastTouch: CGPoint?, reach = 0.0, pluck = 0.0
private var knock = 0.0, nextTool = 0.8, toolFlash = 0.0
private var startle = 0.0, boingT = 0.0, crossT = 0.0, petT = 0.0, pokes: [Double] = []
private var fidget = 0.0, nextFidget = 9.0
private var minis = 0.0, sparkle = 0.0, shadowK = 0.0
/// Small at the top for an approval: eased there and back.
private var scale = 1.0, scaleV = 0.0
// MARK: Staged
func onState(_ r: Rig, _ s: ChumsState, prev: ChumsState?, variant: Bool) {
let was = state
state = s; stateT = 0
switch s {
case .done: hop.v = -220; squash.v -= 2; kick(radial: 60) // it bursts open
case .needs: knock = 0
case .listening: squash.v += 2
case .blocked: squash.v -= 3; kick(radial: -60) // it winds up tight
case .dizzy: tangle = max(tangle, 0.85); tanglePeak = 0 // knocked loose (it re-knots at the end)
default: break
}
if was == .dizzy && s != .dizzy { shakeOff = 0.7; woundV += 2.4 } // it shakes the daze off, knots back up
fidget = 0; nextFidget = rnd(8, 14)
busyAt = t
}
func step(_ r: Rig, _ dt0: Double) {
let dt = min(dt0, 1.0 / 30)
t += dt; stateT += dt
guard !r.ao else {
// dimmed: drawn about once a second, so nothing in flight; it rests in its shape, the loops still
startle = 0; boingT = 0; crossT = 0; petT = 0; toolFlash = 0; finger = nil; reach = 0; pluck = 0
hop = (0, 0); squash = (0, 0); bump = 0; jelly = .zero; jellyV = .zero; tilt = 0; tiltV = 0
tangle = 0; tanglePeak = 0; shakeOff = 0; strand = 0; strandV = 0; lastStrand = 0; wound = 0; woundV = 0
roll = 0; sway = 0; rot = 0; faceOff = .zero; faceOffV = .zero; pop = (0, 0)
if started { generate(); pos = tgt; for i in vel.indices { vel[i] = .zero } }
return
}
var m = motion(state)
if petT > 0 { m.drift = 0.03; m.wobble = 0.6; m.tremble = 0.3 } // stroked, it purrs
let e = min(1, dt * 3)
cur.drift += (m.drift - cur.drift) * e; cur.bob += (m.bob - cur.bob) * e; cur.breathe += (m.breathe - cur.breathe) * e
cur.tremble += (m.tremble - cur.tremble) * e; cur.wobble += (m.wobble - cur.wobble) * e
crownIdle += dt; petT = max(0, petT - dt); startle = max(0, startle - dt); boingT = max(0, boingT - dt)
crossT = max(0, crossT - dt); toolFlash = max(0, toolFlash - dt); bump = max(0, bump - dt * 3)
shakeOff = max(0, shakeOff - dt); tugT += dt
// the crown let go: the thread reels back in (slow, then quicker), the wound ball boings loose and settles
if crownIdle > 0.45 {
if strand > 0 { strandV = min(strandV + 420 * dt, 240); strand = max(0, strand - strandV * dt) } else { strandV = 0 }
if wound > 0.6 && woundV == 0 { boingT = 0.9 }
let wk = TAU * 1.4
woundV += (-wk * wk * wound - 2 * 0.3 * wk * woundV) * dt
wound += woundV * dt
if abs(wound) < 0.002 && abs(woundV) < 0.01 { wound = 0; woundV = 0 }
} else { strandV = 0 }
// the ball rolls on the thread as it comes off and goes back on
let R0 = max(60, mood[Y.R.rawValue])
roll += (strand - lastStrand) / (R0 * 0.85) * strandSide; lastStrand = strand
if strand == 0 && crownIdle > 1 {
let home = (roll / TAU).rounded() * TAU // and comes back upright
roll += (home - roll) * min(1, dt * 1.5)
}
sway += ((state == .thinking ? 0.16 * sin(t * 0.9) : 0) - sway) * min(1, dt * 2.5) // thinking: a slow sway
rot = roll + sway
spin += cur.drift * dt
// shaken: tangled while it's shaken, then it knots itself back up (a tug) and shakes it off
if t - lastShake > 0.25 { tangle = max(0, tangle - dt * (state == .dizzy ? 0.12 : 0.55)) }
if tanglePeak > 0.45 && tangle < 0.3 && state != .dizzy { tanglePeak = 0; woundV += 2.6; shakeOff = 0.7 }
scramble += dt * 3.2 * tangle
// the mood: each number on its own spring to the state's target (a little overshoot)
var goal = target(state)
if tangle > 0 {
goal[Y.loose.rawValue] = max(goal[Y.loose.rawValue], tangle * 0.9); goal[Y.mess.rawValue] += 0.5 * tangle
goal[Y.life.rawValue] += 0.5 * tangle
}
if crossT > 0 { goal[Y.spike.rawValue] = 0.7; goal[Y.rl.rawValue] = 0.46; goal[Y.tempo.rawValue] = 2.6 }
if startle > 0 && state == .sleep { goal[Y.flat.rawValue] = 0.45; goal[Y.life.rawValue] = 0.9 }
if petT > 0 { goal[Y.life.rawValue] *= 0.6; goal[Y.tempo.rawValue] *= 0.5 }
if state == .listening || state == .speaking { goal[Y.life.rawValue] += r.voice * 0.4 }
if strand > 0 { goal[Y.R.rawValue] *= 1 - 0.1 * min(1, strand / Self.maxStrand) } // the thread comes out of it
if let f = finger, reach > 0.02 {
// an arm out for the finger: aimed at it, in the ball's own units
let d = (P2(f.x, f.y) - center) / Self.K / max(0.4, scale)
let R = mood[Y.R.rawValue], l = max(1, simd_length(d))
var a = d / l * clamp(l / R, 1.45, 2.1)
// the hand stays on the screen, below the clock
let k = R * Self.K * max(0.4, scale)
let onScreen = P2(clamp(center.x + a.x * k, 16, 182), clamp(center.y + a.y * k, 64, 222))
a = (onScreen - center) / k
// the aim swings round the ball (its angle and its reach eased), never cutting across the middle
if reach < 0.05 { aimA = atan2(a.y, a.x); aimL = simd_length(a) }
aimA += remainder(atan2(a.y, a.x) - aimA, TAU) * min(1, dt * 5)
aimL += (simd_length(a) - aimL) * min(1, dt * 5)
goal[Y.arm.rawValue] = reach
let la = aimA - rot - tilt // in the turned drawing's own frame
goal[Y.aimx.rawValue] = cos(la) * aimL; goal[Y.aimy.rawValue] = sin(la) * aimL
}
let wm = TAU * 1.25
for i in 0..<mood.count {
// the arm's aim moves quickly; the number of loops slowly
let aimFast = i == Y.aimx.rawValue || i == Y.aimy.rawValue ? 3 : i == Y.turns.rawValue ? 0.3 : 1.0
let w = wm * aimFast
moodV[i] += (w * w * (goal[i] - mood[i]) - 2 * 0.72 * w * moodV[i]) * dt
mood[i] += moodV[i] * dt
}
// the waves along the line; now and then (when it's calm) a bigger swell runs through it
ph += max(0.1, mood[Y.tempo.rawValue] + 2 * max(0, wound)) * dt
gustT += dt
if [.idle, .thinking, .subagents, .speaking, .approval, .needs, .listening].contains(state) {
nextGust -= dt
if nextGust <= 0 { gustT = 0; nextGust = rnd(3.5, 6.5) }
}
// a finger: held off the ball, the arm reaches for it; on it (or near), its threads are pulled toward it
let Rp = mood[Y.R.rawValue] * Self.K * scale
var fd = 1e9
if let f = finger { fd = simd_length(P2(f.x, f.y) - center) }
if finger != nil && fd > Rp * 1.05 { reach = min(1, reach + dt * 3) } else { reach = max(0, reach - dt * 2) }
pluck += ((finger != nil && fd < Rp * 1.35 && reach < 0.5 ? 1 : 0) - pluck) * min(1, dt * 10)
// the body: squash, hop, jelly, lean, where it sits (a finger pulls it a little toward itself)
let ws = TAU * 2.6, sqT = pluck * -0.07
squash.v += (-ws * ws * (squash.k - sqT) - 2 * 0.3 * ws * squash.v) * dt; squash.k = clamp(squash.k + squash.v * dt, -0.25, 0.25)
hop.v += 1000 * dt; hop.y += hop.v * dt
if hop.y > 0 { if hop.v > 100 { squash.v -= hop.v / 160 }; hop.y = 0; hop.v = 0 }
let wj = TAU * 3.1
let ja: P2 = jelly * (-wj * wj) - jellyV * (2 * 0.13 * wj)
jellyV += ja * dt; jelly += jellyV * dt
if simd_length(jelly) > 34 { jelly = jelly / simd_length(jelly) * 34 }
var tiltT = 0.0
if let f = finger { tiltT += clamp((Double(f.x) - center.x) / 70, -1, 1) * 0.13 } // it leans to you
let dz = state == .dizzy ? clamp(1.3 - stateT / 3.4, 0.25, 1) : 0
tiltT += dz * 0.17 * sin(t * 4.1) // dizzy: it rocks
if shakeOff > 0 { tiltT += 0.16 * sin(shakeOff * 26) * shakeOff / 0.7 } // and shakes it off
let wt = TAU * 2.2
tiltV += (-wt * wt * (tilt - tiltT) - 2 * 0.5 * wt * tiltV) * dt; tilt += tiltV * dt
circle += ((state == .dizzy ? dz : 0) - circle) * min(1, dt * 3)
var home = P2(99, state == .approval ? 74 : state == .listening ? 136 : state == .sleep ? 146 : 128)
home += P2(cos(t * 3.6), sin(t * 3.6)) * (7 * circle) // dizzy: it circles
let fo: P2 = finger.map { P2(clamp(($0.x - 99) * 0.18, -16, 16), clamp(($0.y - 128) * 0.15, -14, 14)) } ?? .zero
fingerOff += (fo - fingerOff) * min(1, dt * 6); home += fingerOff
let wc = TAU * 2
let pull: P2 = (home - center) * (wc * wc), damp: P2 = cv * (wc * 1.1)
cv += (pull - damp) * dt; center += cv * dt
dragV += (cv - dragV) * min(1, dt * 7)
// the face lags behind the body (a little), and pops to each new expression
let fw = TAU * 2.4
let fT: P2 = cv * -0.06 + jellyV * -0.012
let fa: P2 = (fT - faceOff) * (fw * fw) - faceOffV * (2 * 0.42 * fw)
faceOffV += fa * dt; faceOff += faceOffV * dt
let pw = TAU * 3.2
pop.v += (-pw * pw * pop.k - 2 * 0.3 * pw * pop.v) * dt; pop.k += pop.v * dt
// the work: each tool call, a loop flicks out, a little hop, the eyes glance up
nextTool -= dt
if nextTool <= 0 && (!r.worlds.queue.isEmpty || state == .working), let c = r.worlds.nextEvent(r) {
nextTool = r.worlds.queue.isEmpty ? rnd(1.4, 2.4) : 0.5
if c.kind != .stop { flick(); hop.v = min(hop.v, -90); toolFlash = 0.6 }
}
if state == .needs {
let was = knock; knock += dt; if knock >= 3.2 { knock = 0 }
if was < 0.2 && knock >= 0.2 { bump = 1; squash.v += 2.4; r.onHaptic?(.strong); kick(radial: 90) }
}
if state == .idle && finger == nil && crownIdle > 3 {
nextFidget -= dt
if nextFidget <= 0 { fidget = 2.4; nextFidget = rnd(10, 18) }
}
fidget = max(0, fidget - dt)
let wsc = TAU * 2.2, sgoal = state == .approval ? 0.5 : 1.0
scaleV += (wsc * wsc * (sgoal - scale) - 2 * 0.75 * wsc * scaleV) * dt; scale += scaleV * dt
minis += ((state == .subagents ? 1 : 0) - minis) * min(1, dt * 3)
sparkle += ((state == .done ? 1 : 0) - sparkle) * min(1, dt * 5)
shadowK += ((state == .listening ? 1 : 0) - shadowK) * min(1, dt * 7)
// the ball of yarn: where it sits and how big (wound tight, a little smaller), then its own physics
yarn.center = center + P2(jelly.x * 0.3, hop.y + jelly.y * 0.3)
yarn.scale = scale * (1 - 0.12 * wound) * (1 + 0.04 * bump)
yarn.step(dt, gravity: P2(clamp(r.W.padX, -0.6, 0.6), 1))
if yarn.busy { busyAt = t }
stepLook(r, dt)
// fast moves draw at 60 frames a second; the slow life of the calm states at 30
let fast = finger != nil || strand > 0.5 || abs(wound) > 0.005 || abs(woundV) > 0.02 || tangle > 0.01 || shakeOff > 0
|| simd_length(jelly) > 0.4 || simd_length(jellyV) > 4 || abs(tiltV) > 0.03 || hop.v != 0 || abs(squash.v) > 0.3
|| simd_length(cv) > 4 || startle > 0 || boingT > 0 || crossT > 0 || abs(scaleV) > 0.02 || abs(pop.v) > 0.05
|| parts.contains { abs($0.bv) > 0.05 } || [.working, .done, .dizzy, .blocked, .speaking, .listening].contains(state)
if fast { busyAt = t }
}
@inline(__always) private func smooth(_ a: Double, _ b: Double, _ x: Double) -> Double {
let k = clamp((x - a) / (b - a), 0, 1); return k * k * (3 - 2 * k)
}
/// Where the mood puts every point of the line (in the sheet's pixels, round the ball's middle).
private func generate() {
let m = mood
func g(_ y: Y) -> Double { m[y.rawValue] }
// wound tight by the crown: smaller, tighter loops; boinged loose after: bigger ones
let wd = wound
let R = g(.R) * (1 - 0.12 * max(0, wd) - 0.05 * min(0, wd))
let orbit = clamp(g(.orbit), 0, 1.2), swirl = clamp(g(.swirl), 0, 1.2), turns = max(1, g(.turns))
let ring = g(.ring) * (1 - 0.15 * min(1, orbit)) * (1 - 0.35 * max(0, wd) - 0.4 * min(0, wd))
let rlW = 1 - 0.22 * max(0, wd) - 0.3 * min(0, wd)
let loose = g(.loose), spike = g(.spike) * (1 - clamp(loose, 0, 1)), mess = g(.mess) * cur.wobble // shaken loose, the bristles relax
let L = max(0, g(.life)), p = ph
let gust = gustT < 1.8 ? sin(Double.pi * gustT / 1.8) : 0
let fc = P2(g(.faceX), g(.faceY)), knotW = 1 - clamp(swirl, 0, 1)
let turn = spin
let N = Self.N
// the whole mass shifts a little, side to side and up and down
let shift = P2(cos(p * 0.45), sin(p * 0.37 + 1)) * (0.05 * L)
let irr = 1.0 + 1.1 * tangle // tangled: every loop more its own
let squashY = 1 - 0.4 * clamp(g(.flat), 0, 1.2)
let irrT = irr * (1 - 0.7 * min(1, orbit)) // orbits: their loops' own turn kept steady
let scr = scramble
// the whole line in one: past the ball's last point it carries straight on, tucking its end back in
for i in 0..<(N + Self.A) {
let s = Double(i) / Double(N - 1), sc = s - 0.5
let tuck = smooth(1, 1.16, s)
// every loop its own: smooth noise along the line, about one value per loop, drifting slowly
let lp = turns * s + 0.05 * p + scr
let nR = Self.vn(lp * 0.9, 1), nE = Self.vn(lp * 0.8, 2), nT = Self.vn(lp * 0.5, 3)
let nX = Self.vn(lp * 0.3, 4), nY = Self.vn(lp * 0.3, 5), nS = Self.vn(lp * 0.4, 6), nC = Self.vn(s * 2.4 + 0.03 * p + scr * 0.5, 7)
// the hand goes round a ring, drawing loops as it goes; the ring bunches up and spreads as waves go round it,
// and the loops crowd round some of it and wander off elsewhere
let cang = TAU * g(.rounds) * sc + 0.6 + turn * 0.5 + L * 0.4 * Self.vn(s * 1.8 + p * 0.25, 11) + irr * 0.35 * nC
let cr = ring * (1 + 0.25 * Self.vn(s * 4.4 + p * 0.1, 12) + L * 0.2 * Self.vn(s * 1.4 - p * 0.16, 13)) * (1 - 0.5 * tuck)
var cx = cos(cang) * cr + shift.x * sin(TAU * 0.5 * s + 0.6) + irr * 0.13 * nX
var cy = sin(cang) * cr + shift.y * cos(TAU * 0.5 * s) + irr * 0.13 * nY
// orbits: about one loop in three flies out into a big ellipse round the ball (each grows into it over a loop)
let kk = turns * sc, ow = orbit * smooth(-0.1, 0.9, sin(TAU * kk / 3 + 0.4))
// the loops slide along the line, and swell and shrink as a wave runs through them
let th = TAU * turns * sc + turn + L * 1.3 * Self.vn(s * 1.1 - p * 0.2, 14) + irrT * 0.9 * nS // uneven spacing
let swell = L * (0.16 * Self.vn(s * 2.8 - p * 0.35, 15) + 0.08 * Self.vn(s * 5.8 + p * 0.22, 16)) + gust * 0.22 * sin(TAU * s - p * 2)
var rr = g(.rl) * rlW * (1 + g(.rlv) * (Self.vn(s * 6.2 + p * 0.1, 17) + 0.5 * Self.vn(s * 12.6 - p * 0.06, 18)) + swell)
rr = rr * (1 - ow) + ow * (0.95 + 0.12 * sin(TAU * 3.3 * s + 1) + 0.6 * swell)
rr *= (1 + irr * 0.32 * nR) * (1 - 0.45 * tuck) // sizes differ
if loose > 0.001 {
let q = sin(TAU * 2.5 * s + 0.5 + scr * 0.3)
rr += loose * 0.3 * exp(-q * q * 2.5) // some loops swing wide
}
var e = g(.ecc) * (1 - ow) + ow * 0.48 + L * 0.12 * Self.vn(s * 3.2 + p * 0.28, 19)
e = clamp(e + irr * 0.22 * nE, 0, 0.72) // roundness differs
var psi = cang + g(.lean) + L * 0.25 * Self.vn(s * 1.6 + p * 0.16, 20) + irrT * 0.5 * nT // so does tilt
if ow > 0.001 {
// its own tilt, a little off the others' (a bounded offset: never a jump round the loop)
psi += ow * (0.45 * sin(1.2 * kk + 0.3 * sin(p * 0.4)) + 0.35)
}
// the knot: the start of the line winds round and round under the face, its loops drifting: the same line,
// its loops smaller and centred on the face (so it flows on into the rest, never a fold where they meet)
let kw = (1 - smooth(0.15, 0.24, s)) * knotW
if kw > 0.001 {
let u = s / 0.24
let wk = P2(cos(TAU * 0.6 * u + p * 0.5) + 0.6 * Self.vn(u * 1.5, 9), sin(TAU * 0.5 * u + p * 0.6 + 1) + 0.6 * Self.vn(u * 1.5, 10)) * 0.08
let rk = (0.21 + 0.05 * sin(TAU * 2.3 * u - p * 0.8) + 0.03 * L * sin(p * 1.3 + u * 5)) * (1 + 0.22 * Self.vn(u * 3.8 + 0.04 * p, 8))
let ek = 0.22 + 0.1 * sin(TAU * 0.9 * u + p * 0.4), psik = psi + 0.5 * sin(TAU * 0.7 * u + p * 0.3)
cx += (fc.x + wk.x - cx) * kw; cy += (fc.y + wk.y - cy) * kw
rr += (rk - rr) * kw; e += (ek - e) * kw; psi += (psik - psi) * kw
}
// never tighter than the marker: each loop at least so big, its ends at least so round (b² / a ≥ minRadius,
// allowing for the flattening a puddle gets later)
rr = max(rr, 1.15 * Self.minRadius / (R * squashY * squashY))
e = min(e, max(0, 1 - sqrt(Self.minRadius / (squashY * squashY * rr * R))))
let a = th - psi
if spike > 0.001 {
// bristles: where a loop swings out, every few points the line pokes out and back (a short hairpin)
let ca = max(0, cos(a)), outer = ca * ca
let k = Double(i % 12) - 5.5, comb = exp(-k * k / 7.2) // rounded teeth, tips just inside the limit
rr += spike * 0.22 * outer * comb * (1 - smooth(0.6, 1, 1 - smooth(0.15, 0.24, s))) // not on the knot
}
let lx = cos(a) * rr, ly = sin(a) * rr * (1 - e)
let cp = cos(psi), sp = sin(psi)
var q = P2(cx + lx * cp - ly * sp, cy + lx * sp + ly * cp)
if swirl > 0.001 {
// dizzy: the ball twisted like a whirlpool, its middle turned further than its edge
let tw = swirl * 1.4 * (1 - smooth(0, 1.1, simd_length(q))), ct = cos(tw), st = sin(tw)
q = P2(q.x * ct - q.y * st, q.x * st + q.y * ct)
}
q *= R
if q.x.isFinite && q.y.isFinite { tgt[i] = q } // (never a bad number into the line)
}
let A = Self.A
// the thread the crown pulled off: from the line's end, the way it was going, out and down, then along the
// bottom of the screen back under the ball; never turning tighter than `strandBend`, a slow wave running down it
if strand > 1 {
let ws = smooth(0, 30, strand)
let cr = cos(rot + tilt), sr = sin(rot + tilt)
let P0 = tgt[N - 1], d0: P2 = tgt[N - 1] - tgt[N - 2]
var q = P2(P0.x * cr - P0.y * sr, P0.x * sr + P0.y * cr)
if lastStrandStart { strandSide = q.x >= 0 ? 1 : -1; lastStrandStart = false }
var hd = atan2(d0.x * sr + d0.y * cr, d0.x * cr - d0.y * sr)
let side = strandSide
let flow = side > 0 ? 0.55 : Double.pi - 0.55
let floorY = (226 - center.y) / (Self.K * max(0.4, scale)), wallX = 190 / max(0.4, scale)
// (its length counts from the ball's edge: the line's end is somewhere inside the ball)
let ds = (strand + R * 0.85) / Double(A), maxTurn = ds / Self.strandBend
var out = [P2](repeating: .zero, count: A)
for j in 0..<A {
let u = Double(j) / Double(A - 1)
// out and down, falling more the further it goes; a wave runs down it (stronger toward its end)
var ht = flow + (Double.pi / 2 - flow) * 0.5 * u
let onFloor = smooth(floorY - 70, floorY - 25, q.y)
let floorH = side > 0 ? Double.pi + 0.08 : -0.08 // along the bottom, back under the ball
ht = ht + remainder(floorH - ht, TAU) * onFloor
let nearWall = smooth(wallX - 60, wallX - 15, abs(q.x)) * (1 - onFloor)
ht = ht + remainder(Double.pi / 2 - ht, TAU) * nearWall // at the side: straight down
let wave = (0.5 - 0.3 * onFloor) * smooth(0, 0.2, u) * sin(TAU * Double(j) * ds / 120 - t * 3.2 - (tugT < 0.6 ? 2 : 0))
ht += wave
hd += clamp(remainder(ht - hd, TAU), -maxTurn, maxTurn)
q += P2(cos(hd), sin(hd)) * ds
out[j] = P2(q.x * cr + q.y * sr, -q.x * sr + q.y * cr)
}
blendEnd(out, ws, from: P0)
} else { lastStrandStart = true }
// an arm reaching out with a hand (a loop the line runs round, then a finger). It leaves the line by the
// shortest way that never turns tighter than `shoulder` (arcs and a straight)
let wa = clamp(g(.arm), 0, 1)
if wa > 0.001 {
let T = P2(g(.aimx), g(.aimy)) * R
let tl = max(1, simd_length(T)), dd = T / tl, nn = P2(-dd.y, dd.x)
let rp = R * 0.17
let Ew: P2 = T - dd * (R * 0.3) // the wrist
let nh = 22 // 16 round the palm, 6 the finger
let open = TAU * smooth(0.35, 1, wa) // the palm curls round as the arm grows
let exit: P2 = dd * cos(open) + nn * sin(open)
let wrist2: P2 = Ew + dd * (rp * sin(open)) + nn * (rp * (1 - cos(open)))
var hand = [P2](repeating: .zero, count: nh)
for k in 0..<nh {
if k < 16 {
let th = open * Double(k + 1) / 16
hand[k] = Ew + dd * (rp * sin(th)) + nn * (rp * (1 - cos(th)))
} else {
hand[k] = wrist2 + exit * (R * 0.075 * Double(k - 15))
}
}
// from the line's end, its way, to the wrist, pointing at the target
let P0: P2 = tgt[N - 1], d0: P2 = tgt[N - 1] - tgt[N - 2]
let way = Self.dubins(P0, atan2(d0.y, d0.x), Ew, atan2(dd.y, dd.x), Self.shoulder, count: A - nh, keep: &shoulderKind)
blendEnd(way + hand, wa, from: P0)
}
// mess: a slow smooth wander along the line; sag: it hangs heavy; flat: a puddle, wide and low
let flat = clamp(g(.flat), 0, 1.2), sag = clamp(g(.sag), 0, 1.2)
let sx = 1 + 0.26 * flat, sy = 1 - 0.4 * flat
let mk = mess * R * 0.06
for i in 0..<tgt.count {
let xi = Double(i)
let w = P2(sin(xi * 0.21 + t * 0.8) + 0.5 * sin(xi * 0.067 + 1.3), cos(xi * 0.17 + t * 0.6) + 0.5 * cos(xi * 0.053))
var q = tgt[i] + (i < N ? w * mk : w * (mk * 0.3))
if sag > 0.001 && i < N {
let yy = max(0, q.y / R + 0.2)
q = P2(q.x * (1 - sag * 0.1 * yy), q.y + sag * R * 0.22 * yy * yy)
}
tgt[i] = i < N ? P2(q.x * sx, q.y * sy) : q
}
}
private var lastStrandStart = true
/// The end of the line becomes `other` by `w`: by blending how each turns and steps along its length (never their
/// places), walked out from the line's end, so the mix is never tighter than either.
private func blendEnd(_ other: [P2], _ w: Double, from P0: P2) {
let N = Self.N, A = Self.A
var cont = [P2](repeating: .zero, count: A)
for j in 0..<A { cont[j] = tgt[N + j] }
var hc = atan2(cont[0].y - P0.y, cont[0].x - P0.x), ha = atan2(other[0].y - P0.y, other[0].x - P0.x)
ha = hc + remainder(ha - hc, TAU)
var q = P0, prevC = P0, prevA = P0
for j in 0..<A {
let sc: P2 = cont[j] - prevC, sa: P2 = other[j] - prevA
let lc = simd_length(sc), la = simd_length(sa)
if j > 0 {
if lc > 1e-6 { hc += remainder(atan2(sc.y, sc.x) - hc, TAU) }
if la > 1e-6 { ha += remainder(atan2(sa.y, sa.x) - ha, TAU) }
}
let hh = hc + (ha - hc) * w, l = lc + (la - lc) * w
q += P2(cos(hh), sin(hh)) * l
prevC = cont[j]; prevA = other[j]
tgt[N + j] = q
}
}
/// A push out from the middle (in, when negative) for the whole line (a burst, a knock).
private func kick(radial: Double) {
for i in pos.indices {
// the whole line swells (or draws in) together: a push in proportion to where each point is, so it can
// stretch the line but never fold it
vel[i] += pos[i] * (radial / 80)
}
}
/// One loop flicks out (a tool call).
private func flick() {
let c = Int.random(in: (Self.kN + 20)..<(Self.N - 30))
for i in max(0, c - 18)..<min(Self.N, c + 18) {
let k = 1 - abs(Double(i - c)) / 18
vel[i] += pos[i] * (5 * k * k) // that stretch of line swells out
}
}
/// The threads near `p` (screen points) twang: a quick shiver across them that runs off along the line.
private func twang(at p: CGPoint, strength: Double) {
let w0 = (P2(p.x, p.y) - center) / (Self.K * max(0.4, scale)), c = cos(-(rot + tilt)), s = sin(-(rot + tilt))
let fl = P2(w0.x * c - w0.y * s, w0.x * s + w0.y * c)
let n = pos.count
for i in 1..<(n - 1) {
let l = simd_length(pos[i] - fl)
guard l < 110 else { continue }
let k = 1 - l / 110, d: P2 = pos[i + 1] - pos[i - 1], dl = max(1e-6, simd_length(d))
let nrm = P2(-d.y, d.x) / dl
vel[i] += nrm * (strength * k * k * sin(Double(i) * 0.9))
}
}
private func stepLook(_ r: Rig, _ dt: Double) {
var l = look(state)
if state == .done && stateT > 2.2 { l = Self.delight }
if fidget > 0 || petT > 0 { l = Self.content }
if pluck > 0.5 && petT <= 0 { l = Self.curious }
if reach > 0.5 { l = Self.reaching }
if yarn.moving > 0.25 && yarn.off > 0.01 { l = Self.whee } // reeled in or fed out
if wound > 0.22 { l = Self.strain }
if boingT > 0 { l = Self.delight }
if tangle > 0.3 && state != .sleep && state != .dizzy { l = Self.frazzled }
if shakeOff > 0 { l = Self.content }
if state == .dizzy { l = Self.dizzy }
if startle > 0 {
if state == .sleep { l = startle > 0.5 ? Self.surprise : Self.sleepy }
else if state != .dizzy { l = startle > 0.45 ? Self.surprise : Self.delight }
}
if crossT > 0 { l = Self.cross }
if state == .working && toolFlash > 0 { l.aim = P2(0, -6); l.look = 0 }
if l.key != shownKey && faceStarted { pop.v += 2.2 } // a new expression: the face pops
shownKey = l.key
shown = l
let names = [l.eL, l.eR, l.eL2, l.eR2, l.bL, l.bR, l.m, l.cL, l.cR, l.sw, l.tg]
for i in 0..<11 {
if names[i] != parts[i].name {
parts[i].set(names[i], names[i].isEmpty ? [] : Self.faceGlyph(names[i], l.pose))
if !faceStarted { parts[i].b = 1; parts[i].from = parts[i].to }
}
let w = TAU * 4.2
parts[i].bv += (-w * w * (parts[i].b - 1) - 2 * 0.68 * w * parts[i].bv) * dt
parts[i].b += parts[i].bv * dt
}
faceStarted = true
let e = min(1, dt * 10)
gazeK += (l.look - gazeK) * e; aim += (l.aim - aim) * e
spiralK += ((l.spirals ? 1 : 0) - spiralK) * min(1, dt * 8)
}
private var faceStarted = false
// MARK: input
func motion(_ r: Rig, _ ax: Double, _ ay: Double, _ az: Double) {
let g = sqrt(ax * ax + ay * ay + az * az)
if g > 0.3 { yarn.jolt(P2(-ax, -ay) * 900, hard: max(0, g - 1.1)) } // the thread swings, its turns come loose
let lat = sqrt(ax * ax + ay * ay)
let c = cos(-(rot + tilt)), s = sin(-(rot + tilt))
if lat > 0.3 {
// the body is thrown against the move and wobbles like jelly
let dir = P2(-ax, -ay) / lat
jellyV += dir * ((min(2.5, lat) - 0.3) * 30)
if g <= 1.25 {
// a small move: the outer loops lag behind it, the knot barely
let k = (lat - 0.3) * 30
let a = P2(dir.x * c - dir.y * s, dir.x * s + dir.y * c) * k
for i in pos.indices { let out = min(1.2, simd_length(pos[i]) / 110); vel[i] += a * (out * out) }
}
busyAt = t
}
if g > 1.25 {
// shaken: its loops fly loose and tangle
tangle = min(1, tangle + (g - 1.1) * 0.05); tanglePeak = max(tanglePeak, tangle); lastShake = t
let push0 = P2(-ax, -ay) * (g * 16)
let push = P2(push0.x * c - push0.y * s, push0.x * s + push0.y * c)
for i in pos.indices {
let x = Double(i)
let jit = P2(sin(x * 0.13 + t * 9), cos(x * 0.11 + t * 7)) * (g * 14)
let out = min(1.3, simd_length(pos[i]) / 110) // the knot's small loops barely jostled
vel[i] += push + jit * (out * out)
}
busyAt = t
}
}
func crown(_ r: Rig, _ delta: Double) {
crownIdle = 0; busyAt = t
// the crown is its spool: one way reels the thread in off the ball, the other feeds it back; once it's all wound,
// turning on winds it tighter (it squints with the effort and boings loose when you let go)
if delta > 0 && yarn.off <= 0 { wound = min(1, wound + delta * 0.05); woundV = 0 }
else if delta < 0 && wound > 0.02 { wound = max(0, wound + delta * 0.05); woundV = 0 }
else if yarn.crown(delta) { r.onHaptic?(.click); tugT = 0; squash.v += delta > 0 ? -0.4 : 0.3 }
}
func touched(_ r: Rig, at pt: CGPoint) { finger = pt; lastTouch = pt; busyAt = t; onThread = yarn.touch(P2(pt.x, pt.y)) }
private var onThread = false
func dragged(_ r: Rig, at pt: CGPoint) {
// on the thread: it's pulled along; on the ball: it rolls the way your finger goes
if let f = finger { yarn.drag(from: P2(f.x, f.y), to: P2(pt.x, pt.y)); if !onThread { jellyV += P2(pt.x - f.x, pt.y - f.y) * 0.3 } }
finger = pt; busyAt = t
}
func released(_ r: Rig) {
yarn.release(); onThread = false
if let f = finger, pluck > 0.3 {
// let go: the threads it had pulled snap back with a twang, the ball wobbles back
twang(at: f, strength: 150 * pluck)
let d = P2(f.x, f.y) - center, l = max(1, simd_length(d))
jellyV += d / l * -40 * pluck
}
finger = nil
}
func poke(_ r: Rig) {
pokes = pokes.filter { t - $0 < 3 } + [t]
yarn.tap()
if let p = lastTouch {
twang(at: p, strength: 170)
let d = P2(p.x, p.y) - center, l = max(1, simd_length(d))
jellyV += d / l * -55
}
squash.v -= 3
switch state {
case .blocked: crossT = max(crossT, 1.2) // crosser
case .dizzy: break // it's too dizzy to mind
case .sleep: startle = 1.1; hop.v = -90 // woken with a start, then back to sleep
default:
if pokes.count >= 4 { pokes = []; crossT = 2.2; startle = 0 }
else if crossT <= 0 { startle = 0.9; hop.v = -130; squash.v -= 0.4 }
}
busyAt = t
}
func pet(_ r: Rig) { petT = 0.45; busyAt = t }
func deny(_ r: Rig) { crossT = 1.2 }
func hit(_ pt: CGPoint) -> Bool { simd_length(P2(pt.x, pt.y) - yarn.center) < yarn.radius + 14 }
// MARK: drawing
func draw(_ r: Rig, _ ctx: GraphicsContext) {
// dimmed: drawn as one layer at half strength (piece by piece, the overlaps would show through lighter)
if r.ao { var c = ctx; c.opacity = 0.5; c.drawLayer { l in self.paint(r, l) } } else { paint(r, ctx) }
}
private func paint(_ r: Rig, _ ctx: GraphicsContext) {
let p = r.pose(raw: true)
let g0 = ctx
let sc = scale
let L = mood[Y.life.rawValue]
let bob = cur.bob * sin(t * TAU * 0.45) - (state == .listening ? r.voice * 5 : 0)
let breathe = cur.breathe * sin(t * TAU / 3.6)
let morph = 0.03 * L * sin(ph * 0.9) // it shifts its shape: wider, then taller
let tremble = cur.tremble * sin(t * 113) * (0.6 + 0.4 * sin(t * 7))
let stretch = P2(clamp(abs(dragV.x) * 0.0006, 0, 0.1), clamp(abs(dragV.y) * 0.0006, 0, 0.1))
let pulse = 1 + 0.05 * bump
// the floating pose's shadow stays on the ground
if shadowK > 0.05 {
var s = g0.faded(shadowK); s.translateBy(x: center.x, y: center.y); s.scaleBy(x: Self.K * sc * (1 - bob * 0.012), y: Self.K * sc)
for d in ScribbleArt.deco("11") where d.kind == 3 { s.fill(Strokes.smoothClosed(d.pts), with: .color(Self.blue)) }
}
var b = g0
b.translateBy(x: center.x + tremble + jelly.x * 0.3, y: center.y + hop.y + bob + jelly.y * 0.3)
b.rotate(by: .radians(tilt))
// jelly: stretched along the way it was thrown, narrower across
let jl = simd_length(jelly)
if jl > 0.05 {
let ja = atan2(jelly.y, jelly.x), jk = min(0.14, jl / 160)
b.rotate(by: .radians(ja)); b.scaleBy(x: 1 + jk, y: 1 - 0.6 * jk); b.rotate(by: .radians(-ja))
}
b.scaleBy(x: Self.K * sc * pulse * (1 + stretch.x - stretch.y * 0.5 - squash.k * 0.5 - breathe * 0.5 + morph),
y: Self.K * sc * pulse * (1 + stretch.y - stretch.x * 0.5 + squash.k + breathe - morph))
yarn.draw(g0, color: Self.blue)
drawDeco(b, r: r)
// the face on the ball's front (smaller as the ball gets smaller, never too small to read)
var f = g0
f.translateBy(x: yarn.center.x + faceOff.x, y: yarn.center.y + bob + faceOff.y - yarn.radius * 0.05)
f.scaleBy(x: Self.K * sc * yarn.faceK, y: Self.K * sc * yarn.faceK)
drawFace(f, r: r, pose: p)
// subagents: small balls of yarn going round it
if minis > 0.02 {
for k in 0..<3 {
let a = t * 0.75 + Double(k) * TAU / 3, c = P2(cos(a) * 84, sin(a) * 74) * minis
var m = g0.faded(minis); m.translateBy(x: center.x + c.x, y: center.y + c.y)
let rot = t * (1.2 + 0.3 * Double(k)) + Double(k)
m.scaleBy(x: Self.K * 0.24, y: Self.K * 0.24)
var ball = m; ball.rotate(by: .radians(rot))
ball.stroke(Self.mini, with: .color(Self.blue), style: StrokeStyle(lineWidth: Self.W * 1.6, lineCap: .round, lineJoin: .round))
for side in [-1.0, 1.0] { m.fill(Path(ellipseIn: CGRect(x: side * 22 - 9, y: -16, width: 18, height: 26)), with: .color(Self.faceInk)) }
}
}
}
func front(_ r: Rig, _ ctx: GraphicsContext) {}
/// The line, in one flat colour: smoothed so it never turns tighter than `minRadius`, the knot under the face with a
/// wider pass of itself underneath, so the face always sits on wire, never on a gap.
private func drawLine(_ g: GraphicsContext) {
// evenly spaced along the line, half a stroke apart, then relaxed wherever it turns too tight
var len = 0.0, lenK = 0.0
for i in 1..<pos.count { len += simd_length(pos[i] - pos[i - 1]); if i == Self.kN { lenK = len } }
guard len.isFinite && len > 1 else { return }
let n = max(64, min(1400, Int(len / Self.step)))
drawn = Strokes.resample(pos, n)
Self.relax(&drawn)
let line = StrokeStyle(lineWidth: Self.W, lineCap: .round, lineJoin: .round)
let knotW = 1 - clamp(mood[Y.swirl.rawValue], 0, 1)
if knotW > 0.05 {
var under = Path(); Self.addRun(&under, drawn, 0, Int(Double(n - 1) * lenK / max(1, len)))
g.stroke(under, with: .color(Self.blue), style: StrokeStyle(lineWidth: Self.W * (1 + 0.6 * knotW), lineCap: .round, lineJoin: .round))
}
var all = Path(); Self.addRun(&all, drawn, 0, drawn.count - 1)
g.stroke(all, with: .color(Self.blue), style: line)
}
/// The line is made smooth where it's made (loops never smaller or sharper-ended than `minRadius`, each loop always
/// turning on ahead of the hand that draws it); this only rounds off a kink the springs might fold in a fast move.
/// (Easing every tight spot toward its neighbours would shrink a small loop tighter, so loops are left alone.)
static func relax(_ p: inout [P2]) {
let n = p.count
guard n > 4 else { return }
for _ in 0..<20 {
var changed = false
for i in 1..<(n - 1) {
let a = p[i] - p[i - 1], b = p[i + 1] - p[i]
let la = simd_length(a), lb = simd_length(b)
let th = la > 1e-6 && lb > 1e-6 ? acos(clamp(simd_dot(a, b) / (la * lb), -1, 1)) : Double.pi
if th > kink {
for j in max(1, i - 1)...min(n - 2, i + 1) {
let mid: P2 = (p[j - 1] + p[j + 1]) * 0.5
p[j] += (mid - p[j]) * (j == i ? 0.5 : 0.25)
}
changed = true
}
}
if !changed { break }
}
}
/// The shortest way from `p0` heading `h0` to `p1` heading `h1` that never turns tighter than `rho` (an arc, a
/// straight, an arc: the four Dubins ways, the shortest kept), as `count` points evenly along it, the first a step on.
static func dubins(_ p0: P2, _ h0: Double, _ p1: P2, _ h1: Double, _ rho: Double, count: Int, keep: inout Int) -> [P2] {
func rot90(_ v: P2) -> P2 { P2(-v.y, v.x) }
let u0 = P2(cos(h0), sin(h0)), u1 = P2(cos(h1), sin(h1))
typealias Way = (len: Double, c0: P2, s0: Double, a0: Double, q0: P2, q1: P2, c1: P2, s1: Double, a1: Double)
var best: Way? = nil, bestKind = -1, kept: Way? = nil
for (kind, (s0, s1)) in [(1.0, 1.0), (-1.0, -1.0), (1.0, -1.0), (-1.0, 1.0)].enumerated() { // +1 turns toward +90°
let c0: P2 = p0 + rot90(u0) * (rho * s0), c1: P2 = p1 + rot90(u1) * (rho * s1)
let v: P2 = c1 - c0, d = simd_length(v)
var u: P2
if s0 == s1 {
guard d > 1e-6 else { continue }
u = v / d
} else {
guard d > 2 * rho else { continue }
let beta = atan2(v.y, v.x), phi = beta + s0 * asin(2 * rho / d)
u = P2(cos(phi), sin(phi))
}
let q0: P2 = c0 - rot90(u) * (rho * s0), q1: P2 = c1 - rot90(u) * (rho * s1)
let straight = simd_dot(q1 - q0, u)
guard straight >= -1e-6 else { continue }
func sweep(_ from: P2, _ to: P2, _ sgn: Double) -> Double {
let a = atan2(from.y, from.x), b = atan2(to.y, to.x)
var x = (b - a) * sgn; x = x.truncatingRemainder(dividingBy: TAU); if x < 0 { x += TAU }; return x
}
let a0 = sweep(u0, u, s0), a1 = sweep(u, u1, s1)
let len = rho * (a0 + a1) + straight
let way: Way = (len, c0, s0, a0, q0, q1, c1, s1, a1)
if kind == keep { kept = way }
if best == nil || len < best!.len { best = way; bestKind = kind }
}
// keep last frame's way unless another is clearly shorter (switching would make the arm jump)
if let k = kept, let b = best, k.len < b.len * 1.15 { best = k } else { keep = bestKind }
guard let b = best else { return (1...count).map { (j: Int) -> P2 in p0 + (p1 - p0) * (Double(j) / Double(count)) } }
let l0 = rho * b.a0, ls = simd_length(b.q1 - b.q0)
return (1...count).map { k in
let x = b.len * Double(k) / Double(count)
if x <= l0 {
let start: P2 = p0 - b.c0, ang = b.s0 * x / rho
return b.c0 + P2(start.x * cos(ang) - start.y * sin(ang), start.x * sin(ang) + start.y * cos(ang))
} else if x <= l0 + ls {
return b.q0 + (b.q1 - b.q0) * ((x - l0) / max(1e-9, ls))
} else {
let start: P2 = b.q1 - b.c1, ang = b.s1 * (x - l0 - ls) / rho
return b.c1 + P2(start.x * cos(ang) - start.y * sin(ang), start.x * sin(ang) + start.y * cos(ang))
}
}
}
/// Smooth value noise, −1…1, one random value at each whole `x` (the same every time for a seed), eased between.
@inline(__always) static func vn(_ x: Double, _ seed: Double) -> Double {
let i = floor(x), f = x - i, e = f * f * f * (f * (f * 6 - 15) + 10)
let a = Strokes.hash(i, seed), b = Strokes.hash(i + 1, seed)
return (a + (b - a) * e) * 2 - 1
}
/// A run of the line's points as a smooth subpath (a curve through the midpoints).
private static func addRun(_ path: inout Path, _ p: [P2], _ a: Int, _ b: Int) {
guard b > a else { return }
path.move(to: CGPoint(x: p[a].x, y: p[a].y))
if b - a == 1 { path.addLine(to: CGPoint(x: p[b].x, y: p[b].y)); return }
for i in (a + 1)..<b {
let m = (p[i] + p[i + 1]) * 0.5
path.addQuadCurve(to: CGPoint(x: m.x, y: m.y), control: CGPoint(x: p[i].x, y: p[i].y))
}
path.addLine(to: CGPoint(x: p[b].x, y: p[b].y))
}
/// The small balls: a short line wound round.
private static let mini: Path = {
var p: [P2] = []
for i in 0..<90 {
let s = Double(i) / 89, th: Double = TAU * 5 * s, c: P2 = P2(cos(TAU * 1.2 * s), sin(TAU * 1.2 * s)) * 30
let reach: Double = 52 + 10 * sin(TAU * 3 * s)
p.append(c + P2(cos(th), sin(th) * 0.8) * reach)
}
var path = Path(); addRun(&path, p, 0, p.count - 1)
return path
}()
/// The sheet's sparkles twinkle round it when it's done, its sweat when it's frazzled.
private func drawDeco(_ g: GraphicsContext, r: Rig) {
if sparkle > 0.02 {
for (i, d) in ScribbleArt.deco("01").enumerated() where d.kind == 1 {
let c = Self.centroid(d.pts), ph = t * 5 + Double(i) * 1.7
let grow: Double = state == .done ? outQ(min(1, stateT / 0.5)) : 1
let k: Double = (0.7 + 0.3 * sin(ph)) * sparkle * grow, home: P2 = c * (0.9 + 0.1 * sparkle)
let pts: [P2] = d.pts.map { (q: P2) -> P2 in home + (q - c) * k }
g.faded(sparkle * (0.75 + 0.25 * sin(ph))).fill(Strokes.smoothClosed(pts), with: .color(Self.blue))
}
}
let sweat = shown.sw.isEmpty ? 0.0 : 1.0
if sweat > 0 {
for (i, d) in ScribbleArt.deco("12").enumerated() where d.kind == 2 {
let off = P2(0, (t * 0.9 + Double(i) * 0.3).truncatingRemainder(dividingBy: 1) * 6)
g.fill(Strokes.smoothClosed(d.pts.map { $0 + off }), with: .color(Self.blue))
}
}
}
/// The dizzy eyes: a spiral, two and a half turns out from the middle.
private static let spiral: Path = {
var pts: [P2] = []
for i in 0...60 {
let u = Double(i) / 60, a = u * 1.6 * TAU
pts.append(P2(cos(a), sin(a)) * (3 + 17 * u))
}
var path = Path(); addRun(&path, pts, 0, pts.count - 1)
return path
}()
/// The face: dark marks (a light tongue) on the yarn, each on a rim of the yarn's own colour so it reads even over a
/// gap between wires; it follows the finger and the gaze, blinks, pops to each new expression and lags the body.
private func drawFace(_ g0: GraphicsContext, r: Rig, pose p: Pose) {
var e = p.eye
if let f = finger {
let d = P2(f.x, f.y) - center, l = max(1, simd_length(d))
e.gx = d.x / l * min(1, l / 30); e.gy = d.y / l * min(1, l / 30)
}
if state == .working { e.gx = sin(t * 2.4) * 0.9; e.gy = 0.35 }
let gaze = P2(clamp(e.gx, -1, 1) * 7, clamp(e.gy, -1, 1) * 5.5) * gazeK + aim
let open = r.ao ? 1 : clamp(e.open, 0, 1)
var g = g0
g.translateBy(x: gaze.x * 0.4, y: gaze.y * 0.4)
let k = Self.faceScale * (1 + 0.12 * pop.k)
g.scaleBy(x: k, y: k)
var marks = Path(), tongue: Path? = nil
for i in 0..<11 where parts[i].shown {
var pts = parts[i].shape
if i == 6 && state == .speaking && parts[6].name == "00.m" && fidget <= 0 && petT <= 0 {
pts = Strokes.mix(pts, Self.faceGlyph("[email protected]*0.85", "00"), clamp(r.voice * 1.5, 0, 1))
}
if i < 4 { // eyes: the gaze, and a blink for open ones
let c = Self.centroid(pts)
let n = parts[i].name
let isOpen = n.hasPrefix("21.e") || n.hasPrefix("01.e") || n.hasPrefix("02.e") || n.hasPrefix("12.e")
pts = pts.map { q in P2(q.x + gaze.x * 0.6, isOpen ? c.y + (q.y - c.y) * max(0.12, open) + gaze.y * 0.6 : q.y + gaze.y * 0.6) }
}
if i == 10 { tongue = Strokes.smoothClosed(pts) } else { marks.addPath(Strokes.smoothClosed(pts)) }
}
// dizzy: spiral eyes where its eyes are, turning
var spirals = Path()
if spiralK > 0.02 {
for (side, name) in [(1.0, "12.eL"), (-1.0, "12.eR")] {
let c = ScribbleArt.anchor(name) - ScribbleArt.faceOrigin("12")
let a = t * 5 * side
let tr = CGAffineTransform(rotationAngle: a).scaledBy(x: spiralK, y: spiralK)
.concatenating(CGAffineTransform(translationX: c.x, y: c.y))
spirals.addPath(Self.spiral.applying(tr))
}
}
g.fill(marks, with: .color(Self.faceInk))
if let tg = tongue { g.fill(tg, with: .color(Self.blue)) }
if spiralK > 0.02 {
g.stroke(spirals, with: .color(Self.faceInk), style: StrokeStyle(lineWidth: 5.5, lineCap: .round, lineJoin: .round))
}
}
}
/// Tangle's face marks and its decorations, traced from its character sheet (refs/scribble-reference.png), in pixels
/// of the sheet (cells 341 px), each pose's round its own middle, y down; little-endian Int16 eighths of a pixel, base64.
/// Poses by their place on the sheet: 00 calm · 01 excited · 02 worried · 10 angry · 11 floating · 12 frazzled ·
/// 20 puddle · 21 reaching · 22 swirl. Decorations: 1 sparkles, 2 sweat, 3 the floating shadow, 4 motion strokes. Face
/// marks are 64 points, leftmost first, clockwise, so any two blend; "[email protected]*0.8" is 21's left eye moved onto 00's
/// and scaled.
enum ScribbleArt {
static let N = 64
private static func values(_ s: String) -> [Double] {
guard let d = Data(base64Encoded: s) else { return [] }
let b = [UInt8](d)
return stride(from: 0, to: b.count - 1, by: 2).map { (i: Int) -> Double in
let bits: UInt16 = UInt16(b[i]) | (UInt16(b[i + 1]) << 8)
return Double(Int16(bitPattern: bits)) / 8
}
}
private static let decos: [String: [(kind: Int, pts: [P2])]] = decoRaw.mapValues { raw in
let v = values(raw.1), h = raw.0
var vi = 0, out: [(kind: Int, pts: [P2])] = []
for k in 0..<h[0] {
let kind = h[1 + 2 * k], n = h[2 + 2 * k]
out.append((kind, (0..<n).map { j in P2(v[vi + 2 * j], v[vi + 2 * j + 1]) })); vi += 2 * n
}
return out
}
static func deco(_ pose: String) -> [(kind: Int, pts: [P2])] { decos[pose] ?? [] }
private static let marks: [String: [P2]] = faceRaw.mapValues { s in
let v = values(s); return stride(from: 0, to: v.count - 1, by: 2).map { P2(v[$0], v[$0 + 1]) }
}
/// The middle of a mark's box (where another mark goes when it takes its place).
static func anchor(_ n: String) -> P2 {
if let g = marks[n] {
var lo = P2(1e9, 1e9), hi = P2(-1e9, -1e9)
for q in g { lo = simd_min(lo, q); hi = simd_max(hi, q) }
return (lo + hi) * 0.5
}
if n.hasSuffix(".eL") || n.hasSuffix(".eR") { return .zero }
let p = String(n.prefix(2)) // a pose without that mark: under its eyes
return (anchor(p + ".eL") + anchor(p + ".eR")) * 0.5 + P2(0, 26)
}
/// The eyes' places in each pose.
static let anchors: [String: (String, String)] = [
"00": ("00.eL", "00.eR"), "01": ("01.eL", "01.eR"), "02": ("02.eL", "02.eR"), "10": ("10.eLa", "10.eRa"),
"11": ("11.eL", "11.eR"), "12": ("12.eL", "12.eR"), "20": ("20.eL", "20.eR"), "21": ("21.eL", "21.eR"),
]
/// A face's middle: between its eyes.
static func faceOrigin(_ pose: String) -> P2 {
guard let a = anchors[pose] else { return .zero }
return (anchor(a.0) + anchor(a.1)) * 0.5
}
/// A mark by name: "00.m", or "[email protected]" (moved onto another's place), with "*0.8" to scale it there.
static func glyph(_ name: String) -> [P2] {
var n = Substring(name), k = 1.0
if let s = n.firstIndex(of: "*") { k = Double(n[n.index(after: s)...]) ?? 1; n = n[..<s] }
guard let at = n.firstIndex(of: "@") else { return marks[String(n)] ?? marks["00.m"]! }
let src = marks[String(n[..<at])] ?? marks["00.m"]!, to = anchor(String(n[n.index(after: at)...]))
let from = anchor(String(n[..<at]))
return src.map { to + ($0 - from) * k }
}
private static let decoRaw: [String: ([Int], String)] = [
"01": ([12, 1, 58, 1, 16, 1, 38, 1, 17, 1, 24, 1, 28, 1, 20, 1, 15, 1, 11, 1, 29, 1, 27, 1, 46], "wAPb+7wD5Pu7A/H7uAP++7QDC/yxAxf8qwMj/KUDL/ydAzn8lANC/IoDSvx/A1D8dANV/G0DW/xsA2L8cANo/HgDbfyEA3D8jwN1/JkDffyiA4b8qgOQ/LEDm/y3A6f8uwOz/L4DwPzCA838xgPW/M0D2fzUA9f82APR/NsDx/zdA7r84QOu/OUDofzqA5X88QOJ/PgDf/wBBHX8CwRt/BUEZ/weBGH8IwRa/CIEV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