Behind the games

How we make the games

Our tools, what stays ours, and the code behind some of what you see and hear in our games. We add to this page as we go.

Our tools

How we use AI

Our games begin with us. The Legend of the Red Dragon, Math Hunt, Together and Greedy Pig were all but finished before AI came into the studio. AI helped us take them the rest of the way: rebuilt from the ground up for accessibility, with new visuals like the living backgrounds in Together and Math Hunt.

Today AI is one of our tools, and we use it where it makes the games better:

  • Testing. Before anything ships, every passage of our story games is run through an accessibility checker, every route is crawled and every colour is measured against the contrast standard. That is far more than two people could check on their own.
  • Code. More and more of it is written with AI, from our designs, and we play and test everything it writes.
  • Sound and music. We don’t use services that generate audio. We write our music and sound effects with AI as code, in Sonic Pi and SuperCollider, line by line. The source is ours, so any sound can be changed.
  • Pictures. Some of our art is drawn with AI, from our designs. In Pixel Roster, AI drew the pixel art in code. In Idle Tomb, the monsters, the heroes’ portraits and the logo were drawn with an AI image tool. Each game’s About says so.
  • Translation. AI makes the first draft. We are language teachers, and we read and correct every line before a player sees it.
  • Ideas and prototypes. We often brainstorm with AI, and a new idea can be tried quickly, so we spend our time on the ones worth making.

What stays ours: the stories and the writing, what a game is about, who it is for, how it should feel, and what it must never ask of a player. Every decision is ours, from the first idea to the finished game. And there is no AI inside the games: nothing a player does is sent to one.

From Together

Rain and snow, drop by drop

In Together, the weather changes by the hour on the siblings’ long road east, and every raindrop and snowflake is drawn on its own. Each has its own distance, and from it its size, speed, brightness and softness, so the weather has depth instead of a few flat sheets. It falls at the wind’s angle, gusts, and splashes where it lands. This is the game’s own code, running here: try it.

  1. Every drop has a distance

    Each drop gets its own distance, from 0 far off to 1 close by. Most are far off and only a few come close, and that is what makes the rain look deep. The distance also decides where the drop meets the ground: the further off, the nearer the horizon.

    var ny = function (t, fart, var0, nara) {var fj = t === 'fjarr', d = fj ? Math.random() * 0.12 : Math.pow(Math.random(), nara || 1.7);   // most drops are far off, a few come close (more of them in heavy snow)var mark = hor + (H - hor) * Math.pow(d, 1.25) * 1.15 + (Math.random() - 0.5) * 6 * dpr;   // where this drop meets the ground, by its distancevar y0 = fj ? hor - BAND * H : 0;return { typ: t, d: d, x: Math.random() * W, y: var0 ? y0 + Math.random() * (mark - y0) : y0 - (fj ? Math.random() * 0.1 * H : 20 * dpr), fas: Math.random() * 6.28, fart: fart, mark: mark, l: 14 + 22 * Math.random() };};
  2. The distance decides the rest

    A near raindrop falls faster, and is longer, brighter and thicker. A far one is fine and faint, but never invisible, so the rain reaches all the way to the horizon.

    var v = Math.min(1250, (1050 + 200 * d) * p.fart) * dpr, len = (13 + 27 * d) * dpr * (0.6 + 0.4 * p.fart);if (!stilla) { p.x += sx * v * dt; p.y += sy * v * dt; }cx.strokeStyle = 'rgba(214, 224, 246, ' + (0.34 + 0.32 * d) + ')'; cx.lineWidth = (1 + 1.3 * d) * dpr;   // far drops must still show: rain all the way to the horizoncx.beginPath(); cx.moveTo(p.x, p.y); cx.lineTo(p.x - sx * len, p.y - sy * len); cx.stroke();
  3. Gusts and splashes

    The wind’s angle sways a few degrees on two slow waves, so the rain gusts. Where a drop lands, a small arc flicks up and fades within a third of a second, smaller further off.

    var by = Math.sin(nu / 2300) * 3 + Math.sin(nu / 900) * 1.2;   // gusts: the angle sways a few degreesvar a = (vinkel + by) * Math.PI / 180, sx = Math.sin(a), sy = Math.cos(a), t = nu / 1000; /* splashes: a brief small flick where a drop met the ground, smaller further off */cx.lineWidth = 1.5 * dpr;   // they show (user, 2026-10-22: barely visible before): brighter, bigger, a little longerfor (var k = stank.length - 1; k >= 0; k--) {var sp = stank[k]; sp.t += dt;if (sp.t > 0.3) { stank.splice(k, 1); continue; }var f = sp.t / 0.3, rw = (2.5 + 10 * sp.d) * dpr * (0.4 + f), rh = rw * 0.32;cx.strokeStyle = 'rgba(226, 234, 250, ' + ((0.45 + 0.45 * sp.d) * (1 - f)).toFixed(3) + ')';cx.beginPath(); cx.ellipse(sp.x, sp.y, rw, rh, 0, Math.PI, 2 * Math.PI); cx.stroke();}
More about Together →

From Mattemums

A chime, with no sound file

Mattemums is a calm counting game with fruit, for young children. A right answer gets two soft notes; five right answers earn a gold star and four notes, rising. There is no sound file: the game makes every note the moment it plays.

Each note is a pure tone, a sine wave. It swells in two hundredths of a second and fades away over seven tenths, and each starts 0.13 seconds after the one before. The code is in Swedish, like the game: ljud is sound, noter notes, stjarna star.

// ---- sound: two soft notes, made here (no files) ----var ac = null;function ljud(typ) {if (!S.ljud) return;try {ac = ac || new (window.AudioContext || window.webkitAudioContext)();if (ac.state === 'suspended') ac.resume();var noter = typ === 'stjarna' ? [523.25, 659.25, 783.99, 1046.5] : [659.25, 783.99];noter.forEach(function (f, i) {var o = ac.createOscillator(), g = ac.createGain(), t0 = ac.currentTime + i * 0.13;o.type = 'sine';o.frequency.value = f;g.gain.setValueAtTime(0, t0);g.gain.linearRampToValueAtTime(0.07, t0 + 0.02);g.gain.exponentialRampToValueAtTime(0.0001, t0 + 0.7);o.connect(g);g.connect(ac.destination);o.start(t0);o.stop(t0 + 0.75);});} catch (e) { /* no audio */ }}
Play Mattemums →

From a game in the works

A torch, from code

In a game we are still making, the torches on the walls are neither pictures nor recordings. The flame is a small simulation: heat rises from the fuel, cools at random and takes its colour from our own fire palette, so it never repeats. The crackle is written in SuperCollider and rendered to sound. Here is one torch, with the code that makes it.

  1. The colours

    The flame is a grid of heat, 32 cells across. Each cell’s heat becomes a colour from our own ramp, from dark red through orange to a yellow-white core, and the cooler a cell is, the more see-through.

    const FIRE_RAMP = [[0, [40, 8, 4]],[0.2, [110, 24, 8]],[0.34, [184, 48, 14]],[0.55, [255, 122, 26]],[0.78, [255, 179, 71]],[0.94, [255, 243, 192]],[1, [255, 250, 230]]];
  2. One step of the fire

    Forty times a second, every cell takes the heat of the cell below it, a little cooler, and now and then drifts a cell to the side. The fuel along the bottom keeps the heat coming. That is the whole flame.

    for (let y = 0; y < H - 1; y++) {const below = (y + 1) * W,here = y * W;for (let x2 = 0; x2 < W; x2++) {state = (Math.imul(state ^ (state >>> 15), 2246822519) + 0x9e3779b9) >>> 0;const q = (state / 4294967296) * 6,dk = q < 2 ? 0 : q < 4 ? 1 : 2; /* one draw for the side */state = (Math.imul(state ^ (state >>> 15), 2246822519) + 0x9e3779b9) >>> 0;const v = heat[below + x2] - dk - (state / 4294967296 < cool[x2] ? 1 : 0); /* and one for the cooling */const tx = x2 + (dk ? ((q * 1024) & 1 ? 1 : -1) : 0);heat[here + (tx < 0 ? 0 : tx >= W ? W - 1 : tx)] = v < 0 ? 0 : v;}}
  3. The sound

    SuperCollider (opens in a new tab) is a free, open-source language for making sound, used by composers, sound artists and researchers since 1996. Instead of recording a sound, you describe it: where it comes from, such as noise or a tone, and how filters and envelopes shape it. The computer builds the sound from that description. Our music is written the same way, in Sonic Pi, which plays through SuperCollider’s sound engine.

    The torch’s sound is four layers of noise, each shaped by filters: a low rumble, a flutter, small crackles and a pop now and then, mixed and softened at the top. In the code, BrownNoise, PinkNoise and WhiteNoise are noise from deep to bright; LPF keeps only the low part of a sound and BPF one band of it; LFNoise1 wanders slowly, so nothing stays the same; Dust gives clicks at random moments, and Decay2 rounds each into a short tick.

    a = LPF.ar(BrownNoise.ar, LFNoise1.kr(1.2).range(90, 160)) * LFNoise1.kr(3).range(0.7, 1) * 1.6;   // the flame's low rumbleb = BPF.ar(PinkNoise.ar, LFNoise1.kr(2).range(500, 900), 0.8) * LFNoise1.kr(6).range(0.15, 0.4) * 0.35;   // its fluttere = Dust.ar(5);c = BPF.ar(WhiteNoise.ar, TExpRand.kr(1200, 3500, e), 0.9) * Decay2.ar(e * TRand.kr(0.3, 1, e), 0.002, 0.018) * 2.2;   // small crackles, each a rounded tickd = Dust.ar(0.4); d = LPF.ar(BrownNoise.ar, 900) * Decay2.ar(d, 0.004, 0.06) * 2;   // a pitch pop now and thensig = LPF.ar(a + b + c + d, 6000);

From a game in the works

The music, from code

The music in that game is written the same way. “Stone Corridors” plays on the first floor: a low drone that never quite settles, a plucked arpeggio walking the chords like torchlight down a wall, a hollow pad, a distant bell now and then, and one deep drum a bar. It runs four minutes and sixteen seconds before it comes round.

Sonic Pi (opens in a new tab) is a free, open-source program for making music with code, created by Sam Aaron at the University of Cambridge and first made for teaching programming in schools. Its code reads almost like a score: play a note, wait a beat, play the next. Underneath, it plays through SuperCollider’s sound engine, the same one the torch’s crackle came from.

  1. The chords

    The piece walks through sixteen chords in D Dorian, an old scale that sounds neither happy nor sad, four bars each: 64 bars in all, written once as a list.

    # D Dorian: the chords the arpeggio walks, four bars each, as string voicings low to high.define :voicing do |name|{ Dm:  [:d3, :a3, :d4, :f4, :a4],Am:  [:a2, :e3, :a3, :c4, :e4],C:   [:c3, :g3, :c4, :e4, :g4],G:   [:g2, :d3, :g3, :b3, :d4],Bb:  [:bb2, :f3, :bb3, :d4, :f4],Em:  [:e3, :b3, :e4, :g4, :b4] }[name]end progression = [:Dm, :Dm, :C, :Dm, :Bb, :Am, :Dm, :Dm, :G, :Am, :Dm, :Em, :Bb, :C, :Dm, :Dm]   # 16 chords of 4 bars: the 64 bars
  2. One voice

    Each voice is a few lines. The arpeggio plays the chord’s five notes up and back, one a beat, now and then a little late, as a hand on a lute is. play sounds a note, sleep waits that many beats, and rrand picks a number at random between two, so no two notes are quite alike.

    # The arpeggio: the five strings of the chord up and back, one note a beat, every note left to# ring; a little late now and then, as a hand on a lute is. With octave: true a quiet echo an# octave up.define :arpeggio do |chords, octave|use_synth :pluckchords.each do |name|v = voicing(name)order = [0, 1, 2, 3, 4, 3, 2, 1, 0, 2, 4, 3, 1, 2, 3, 1]order.each do |i|play v[i], release: 2.2, coef: 0.3, amp: 0.21 * rrand(0.85, 1.0), pan: rrand(-0.25, 0.25)play note(v[i]) + 12, release: 1.6, coef: 0.4, amp: 0.05 if octave and i.even?sleep [1, 1, 1, 1.02, 0.98].chooseendendend
  3. The whole piece

    At the end, the voices start together, each in its own thread: the drone, the pad and the arpeggio at once, the drum and the bell after sixteen bars, all inside one reverb, like a stone hall.

    # The piece as a loop the renderer records twice and keeps the second pass of: every cycle starts the voices again.live_loop :stone_corridors dowith_fx :reverb, room: 0.85, mix: 0.4 doin_thread { drone 64 }in_thread { pad progression[0, 8], 0; pad progression[8, 4], 4; pad progression[12, 4], 0 }in_thread { arpeggio progression[0, 8], false; arpeggio progression[8, 4], true; arpeggio progression[12, 4], false }in_thread { sleep 64; drum 32, false; drum 16, false; drum 16, true }in_thread { sleep 64; bells progression[4, 12] }endsleep 256end