Birdy Branch: Customization Guide

Step-by-step changes for people who do not program. Everything works with a free text editor.

1. Before you start

  1. Make a copy of the whole download. If something goes wrong, you can go back to it.
  2. Install a free code editor such as Visual Studio Code (or Notepad++ on Windows). For pictures, the free GIMP or Krita open and export WebP files. For sounds, the free Audacity exports MP3.
  3. Work inside source/. To see your changes, open a terminal in that folder and run npm run serve, then open http://localhost:5180/. Reload the page after every change (Ctrl+F5).
  4. No terminal? Edit the files of game/ directly, upload them to your host and reload the page.

2. What to edit for what

The menu of the game

Work inside source/. This table says where each part of the game lives. Change one thing at a time and look at the result before the next change.

You want to changeEdit
Every text and every languagesrc/locales/<code>.js
The name of the game<title> in index.html, title in every src/locales/ file and test/locales.test.mjs
The colours of the buttons, panels and skycss/base.css (top lines) and the pictures of assets/ui/
The logo and the iconsassets/ui/logo.webp, assets/ui/icon-32.png, icon-180.png and assets/icons/*.webp
The birdsassets/cats/ and CATS in src/config.js
The sceneries of the 10 worlds and the menuassets/bg/
Branches, balloon nests, ice, morning mist and vine bowassets/game/
Sound effects, bird voices, music and ambient soundassets/sfx/, assets/music/, assets/amb/ and the lists in src/audio/
The helps per level and the limits of the starsHELPS and stars() in src/game/rules.js
The levelstools/generate-levels.mjs and src/game/levels/world-N.js
Speeds, jumps, effects, voices and volumesFEEL in src/config.js
The names of the save in the browserSAVE and PREFS in src/lib/storage.js

3. Texts and languages

The language list

4. Colours and interface pieces

The buttons, panels and sliders

The buttons, panels, plates, ribbons and sliders are pictures in assets/ui/. The panels, the long buttons and the plates are stretched in the middle and keep their corners (nine-slice pictures): when you replace one, keep its size and its corners. The corner numbers are in the border-image lines of css/base.css and css/panels.css.

PictureSize and what it is
assets/ui/pill-violet.webp, pill-pink.webp (and -down)318 x 153, corner 76. The big buttons, normal and pressed.
assets/ui/plate.webp, band.webp, row.webp258 x 129 (corner 60), 342 x 109 (corner 38) and 507 x 128 (corner 58). The plates, the ribbon of a title and the rows of settings.
assets/ui/panel.webp337 x 340, corner 64. The frame of every panel.
assets/ui/btn-round*.webp, close.webpAbout 254 x 261. The round buttons (sound, settings, back) and the close button.
assets/ui/slider-*.webp, toggle-on.webp, toggle-off.webpThe volume sliders (corner 40) and the switches (312 x 169).
assets/ui/tile*.webp, world-banner.webp, badge.webpThe level tiles (346 x 274, locked and current), the world banner and the badge of the helps.

Colours: the first lines of css/base.css define the main colours (--violet, --violet-dk, --pink and --sky), and the colour of the browser bar on a phone is theme-color in index.html. The colour of the light, the ring and the sparkles of each bird is catColor in src/config.js.

Fonts: css/base.css loads the font Fredoka (Latin letters) and Nunito (Cyrillic) from fonts/. To use another font, put its files in fonts/, change the @font-face lines and keep its license text in THIRD-PARTY-LICENSES/.

5. Sounds and music

The Sound panel

Every effect is an MP3 in assets/sfx/, named <id>-<number>.mp3. The game picks one of the versions at random. Replace a file and keep its name and its format (MP3, mono). The number of versions of each id is in src/audio/sfx-files.js.

IdsWhen they play
pegar, soltar, voo, pousarLifting a bird, dropping it, its flight and its landing.
grupo, entrega, balao-sobe, balao-chega, vitoria, estrela, confete, comboA complete group, the delivery to the balloon nest, the balloon nest rising and arriving, the win, the stars, the confetti and the combos.
nao, sem-jogadas, dormir, acordar, misterio, neblina, neblina-conta, gelo-trinca, gelo-quebra, gelo-tinido, novelo, curinga, balao-revelaA move that is not allowed, no moves left, birds that sleep and wake, and the twists of the worlds (mystery birds, morning mist, ice, vine bow, rainbow bird, surprise nest).
desfazer, embaralhar, nuvem-extra, dica-mao, contagemThe three helps, the pointing hand of the tutorial and the count.
botao, painel, fechar, tela, chave, destravarButtons, panels, changing screen, the locked level and the unlock.
m-<bird> and v-<bird>-<say>, v-susto, v-feliz, v-nao, v-bocejo, v-ronrom, v-triste, v-tonto, v-coroThe sounds of each bird (m-robin-1...), its 5 voice sounds (levantar, voar, pousar, recusar, comemorar: lift, fly, land, refuse and cheer) and the shared reactions.

Music: assets/music/menu.mp3 is the menu and jogo-1.mp3 to jogo-10.mp3 are the 10 worlds (the link between world and file is FEEL.music.world in src/config.js). Replace a file keeping the name. The notes of some effects follow the key of the music: src/audio/music-meta.js has the key of each track, and if you use a track in another key, set tune: false in FEEL.music or write the new key there.

Ambient sound: assets/amb/amb-w1.mp3 to amb-w10.mp3 loop under each world. The length of each loop, in seconds, is in src/audio/amb-files.js, and every file carries 0.1 second of the same sound before and after the loop. If your new file has another length, write the new loop length there.

Volumes: the player has two sliders, Music and Effects. The bird voices and the ambient sound follow Effects. FEEL.mix in src/config.js has the base level of each (master, sfx, music, voice, amb) and groups lowers or raises a whole kind of effect (jogada, marco, mecanica, ui, miado, fala, reacao).

mix: {
    master: 0.9,
    sfx: 0.85,
    music: 0.42,
    voice: 0.75,
    gap: 0.04,
    sfxJitter: 0.03,
    voiceJitter: 0.06,
    voiceRest: 0.15,
    voiceDuck: 0.7,
    crossfade: 0.8,
    pan: 0.35,
    groups: { jogada: 0.55, marco: 1, mecanica: 0.65, ui: 1, miado: 1, fala: 0.45, reacao: 1 },
    ids: { 'balao-sobe': 0.45 },
    amb: 0.5,
    ambFade: 1.5,
    merge: 0.12,
    maxVoices: 10,
  },

To add an effect, put the MP3 in assets/sfx/ as <id>-1.mp3, add its id and its number of versions to SFX_FILES in src/audio/sfx-files.js and play it from the code.

6. Levels

A level of the game

The 100 levels are data: src/game/levels/world-1.js to world-10.js, 10 levels each. A level is one line with its number n, its clouds (the birds of each branch from the left to the right end, with the extra fields cap for the spots, hid, ice, tie, fog and fogT for the twists), the queue of balloon nests (the bird each one wants), the qhid positions of surprise nests, the par and the sol (a list of moves, [from, to], that solves the level). The birds are numbers: the position in CATS in src/config.js, and 16 is the rainbow bird.

{"n":11,"clouds":[{"cats":[5]},{"cats":[5,5,3,0],"hid":[0,1]},{"cats":[3,3,4]},{"cats":[0,0,0],"hid":[0,1]},{"cats":[4,4,4]},{"cats":[5,3],"hid":[0]}],"queue":[4,0,3,5],"par":6,"sol":[[1,3],[2,4],[1,2],[5,2],[0,1],[5,1]]}

Worlds 2 to 10 are made by tools/generate-levels.mjs; their files say so at the top. Run npm run levels to make all of them again, or npm run levels -- 4 for only world 4. The generator shuffles from a solved board, then the real rules and the solver check that the level can be solved, keep the best solution as sol and its length as par.

To change how a world feels, edit its recipe in spec() in tools/generate-levels.mjs: how many kinds of birds, the spots of each branch, how many shuffles, the range of the par, the chance of hidden birds and how many ice, wild, vine bow or surprise pieces. Then run the generator for that world and npm test.

export function spec(w, i) {
  const f = (i - 1) / 5,
    g = (i - 7) / 2,
    four = (n, more = []) => Array(n).fill(4).concat(more);
  if (w === 2) {
    if (!i) return { types: 4, caps: four(6), hid: 0.6, k: 7, par: [4, 9], target: 6 };
    if (i < 7) {
      const t = lerp(5, 6, f);
      return {
        types: t,
        caps: four(t + 1),
        hid: 0.3 + 0.25 * f,
        k: lerp(20, 45, f),
        par: [9, 28],
        target: lerp(11, 15, f),
      };
    }
    return { types: 6, groups: 7, caps: four(8), hid: 0.45, k: 50, par: [12, 30], target: lerp(15, 17, g) };
  }
  // ... the other worlds
}

Do not edit a level by hand in worlds 2 to 10: the generator writes the files again and the test that regenerates them would fail. A level you write yourself must keep n right and a correct par and sol, because the stars and the tests use them.

World 1 is the fixed start of the game, and a test checks its file byte by byte. If you really want to change it, edit the file, run npm test, and replace the value W1_HASH in test/levels.test.mjs with the new one that the failing test prints.

The game is built around 10 worlds of 10 levels. A new world also needs a scenery, a music track, an ambient loop, a name for the map and changes in the code of the map: that is custom work.

7. Helps, stars and rules

The three helps at the bottom of a level

Open src/game/rules.js. At the top there is HELPS = { undo: 5, shuffle: 1, extra: 1 }: how many times each help can be used on one level. Change the numbers to give more or fewer. The helps start full on every level.

export const HELPS = { undo: 5, shuffle: 1, extra: 1 };

export function stars(moves, par) {
  if (moves <= par * 1.3) return 3;
  if (moves <= par * 1.8) return 2;
  return 1;
}

The stars come from stars(moves, par) in the same file: up to 1.3 times the par gives 3 stars and up to 1.8 times gives 2. Write other multipliers to make the stars easier or harder. Run npm test: some checks use these limits.

SHOWN = 3 is how many balloon nests are shown at a time. The rules (tap, undo, shuffle, addCloud) are pure functions with tests: change them only if you also change the tests and the solver.

8. Feel numbers

A level with the effects

Open src/config.js. FEEL has every number that changes how the game feels. The most useful:

SettingWhat it does
FEEL.liftY, liftTime, flightBase, flightMax, arcHow high a bird is lifted, how long it takes, how long a flight lasts and how high its arc is.
FEEL.squash, squashTime, shakeAmpThe soft squash when a bird lands and the shake of a move that is not allowed.
FEEL.deliverFlight, balloonRise, balloonEnterThe flight of a group to the balloon nest and how long a balloon nest takes to rise and to arrive.
FEEL.combo, land, meowScaleHow close in time two deliveries must be to make a combo, and the musical notes the landings and animal sounds climb.
FEEL.fxThe particles: the most on screen (fewer on touch devices), the sparks of each moment and the confetti of a win.
FEEL.win, hitstopThe slow motion of the last delivery, how long the balloon nest celebrates and the short freeze of the image on a complete group.
FEEL.voiceHow often the birds make a sound, speak or answer each other, and the minimum time between two sounds.
FEEL.vibe, FEEL.mix, FEEL.qualityThe length of each vibration in milliseconds, the volumes, and when the game lowers its own effects on a slow device.

The numbers only change how the game looks, sounds and feels. They never change a rule or a level. Change one number at a time and play a level to see it.

9. Reskin: your own birds, scenery and logo

The birds on their branches

A reskin means replacing the art and keeping the code. The rule is simple: replace the picture keeping the file name and the size (or the same proportion). The game finds every picture by its name, so a new picture with a new name is never loaded.

Birds: every bird has 9 faces, a peek head and 8 poses, all in assets/cats/. Faces: <bird>-<face>.webp with the 9 faces idle, blink, happy, wow, sleepy, worried, dizzy, sad and yawn. Poses: <bird>-p-<pose>.webp with the 8 poses crouch, dangle, leap, fall, curl, stretch, wave and cheer. Peek head: <bird>-peek.webp. That is 18 files for each of the 17 birds. Every face and every pose is 256 x 256 pixels with a transparent background and the base of the bird at the same height (the bottom at pixel 250 of 256): the faces swap without the body moving. The peek head is a head with a straight cut at the bottom (about 232 to 256 pixels on a side; it shows over the edge of a basket or a panel).

The birds are the list CATS at the top of src/config.js: the position of a name in the list is the number of that bird in the levels, so keep the order (16 regular birds, then the rainbow bird last). To rename a bird, rename its 18 files, change the name in CATS and in the lists that follow it, and change the sound ids (m-<bird> and v-<bird>-... in assets/sfx/ and src/audio/sfx-files.js).

export const CATS = ['robin', 'bluetit', 'owl', 'canary', 'swallow', 'flamingo', 'toucan', 'parrot', 'hummingbird', 'duck', 'peacock', 'crow', 'pigeon', 'starling', 'oriole', 'lovebird', 'rainbow'];

Where else the names appear: catColor and persona in src/config.js (one entry per bird, same order); MEOW_LIKE in src/audio/ids.js (the sound a bird falls back to); the birds of the menu in index.html (data-cats and data-cat); the birds shown in the how to play cards (src/ui/howto.js) and the birds of the level map and the world banner (W_CAT and SIT in src/ui/map.js and src/ui/juice.js). Search for the old name in src/ and index.html.

The file assets/cats/poses.json holds, for each bird and pose, the box of the body inside the 256 pixel frame (w, h and y): the game uses it to place the pose over the branch. If a new pose has another shape, measure it and write the numbers.

Sceneries: assets/bg/w1-p.webp to w10-p.webp (portrait, about 941 x 1672), w1-l.webp to w10-l.webp (landscape, about 1672 x 941) and w1-xl.webp to w10-xl.webp (ultrawide, about 2560 x 1099), one set for each of the 10 worlds, and the same three shapes for the menu: menu-p.webp, menu-l.webp and menu-xl.webp. The game picks the shape that fits the window. Keep the proportions: a different proportion is cropped or stretched. bg-p.webp, bg-l.webp and bg-xl.webp are plain back-up backgrounds shown while a scenery loads. front-bottom.webp, front-left.webp and front-right.webp are the branches in front of the scene.

FileSize and what it is
assets/game/cloud.webp, cloud-glow.webp, cloud-mini.webp848 x 133 the branch with 4 spots; 1024 x 191 the glow of a valid place; 276 x 123 the little twig.
assets/game/cloud-2.webp, cloud-3.webp, cloud-5.webp436 x 132, 641 x 134 and 1024 x 132: the branches of 2, 3 and 5 spots (world 7). Their proportions are in AR in src/render/layout.js.
assets/game/balloon-purple.webp, balloon-pink.webp, balloon-mint.webpAbout 407 x 640. The three balloon nests. The white disc where the wanted bird is drawn is in FEEL.balloonDisc in src/config.js: if you change the balloon nest, measure the centre and the radius of the disc and write the numbers.
assets/game/balloon-q.webp, balloon-far.webp, win-balloon.webp, basket.webp247 x 256 the surprise nest; 211 x 235 the far balloon nest in the water; 700 x 1000 the balloon nest of the win panel; 252 x 284 the basket.
assets/game/ice.webp, ice-crack.webp, fog.webp, mystery.webp, yarn-tie.webp, yarn-snap.webp512 x 380 (ice and its crack), 512 x 178 (morning mist), 322 x 261 (the "?" bird), 384 x 112 and 384 x 99 (the vine bow and its break).
assets/ui/logo.webp1024 x 555, transparent background. It shows on the loading screen, the start screen and the menu. Also change the alt text in index.html.
assets/ui/icon-32.png, assets/ui/icon-180.png32 x 32 and 180 x 180 pixels, PNG. The icon of the browser tab and the icon of a phone home screen (index.html has the two lines that use them). There is no web manifest.
assets/icons/*.webpAbout 190 x 170 pixels each: sound, music, gear, pause, play, undo, shuffle, extra branch, home, language, vibration, full screen, hand, check, lock, arrows and replay.
assets/fx/*.webpThe sparkles, glows, hearts, stars, confetti, ice shards, puffs and the small things that float in each world (amb-*.webp). Replace them keeping the names; they are moved and tinted by the code, never redrawn.

Also change in a reskin: the name of the game (<title> in index.html, title in every file of src/locales/ and the matching line in test/locales.test.mjs), the colours (section 4), the icons above, the save names (section 10) and the texts that name the birds or the branches. The sounds follow the same rule: same name, same format (section 5).

  1. Replace the pictures keeping names and sizes.
  2. Reload with Ctrl+F5 and look at the menu, the level map and one level of each world.
  3. Run npm test: it checks that every picture, sound and text that the game asks for exists.
  4. Clear the cache of your host or CDN when you publish (see the buyer guide).

10. The save and starting over

The progress stays in the browser of each player, under two keys: birdy-branch-save (unlocked level, current level, stars) and birdy-branch-prefs (language, volumes, Reduce motion, Vibration, Tips), both in src/lib/storage.js. If you publish a very different version of the game, change both names so old saves do not mix with the new one.

To start over, delete these keys in the developer tools (F12), under Application, Local Storage, or clear the site data of the browser.

11. Publish your version

  1. In source/, run npm test. When it passes, your version is consistent.
  2. Back up the game on your website, then upload the files index.html, css/, fonts/, src/ and assets/ of source/ in place of the old files.
  3. Keep the folders as they are. Do not upload test/, tools/, package.json or the documentation.
  4. Clear the browser cache to see the new version (see the buyer guide).

Support: willian@polargames.com.br