Skip to content
Tutorials menu
Tutorialscharacter-kits

Character kits and the Studio

A character kit makes many people from a few drawings. It holds bodies that walk and carry in every direction, one bare head, and parts painted over that head (hair, hats, faces, beards, glasses, held items). Every frame of every body knows where its head is, so a part goes on in the right place on any frame. The head itself is put back the same in every frame, so heads never drift in size. This page covers:

  • what a kit is made of, and making one;
  • anchors: how each frame's head is found;
  • the head lock;
  • parts: cutting them, z-order, hats over hair;
  • adding a part, and posing a still from the rig;
  • the sweep, the Studio page, and the export your game loads.

Everything on this page is free except adding a part.

What a kit is made of#

Piece What it is
Bodies Assets with their animations in every direction. A rigged model (rig_model) gives the best anchors.
The head An asset whose raw/stand/<direction> is the bare head (often the whole bare figure) at head.scale times the bodies' size, with the point where it sits on the neck (head.neck).
Slots Hair, hat, face, beard… Each has the directions its parts are drawn in, a z-order (per direction if it changes), mask folders under art/style/ saying where on the head its parts may be, tint keys, the slots it clips (a hat clips hair), or a joint to follow (a held item).
Parts An animation of an asset painted over the bare head, one per direction: hair-messy in head-parts. A part can borrow a view from another part, skip directions, or have its own z or offset.
Rules Parts that never go together, and parts to use instead under a hat (underHat).
Tints Colour bands (hue, saturation, value) whose pixels become tint layers: tint for hair or a hat, skin. The sweep uses skin. Bodies can have their own (bodyTints), such as a top and trousers.

The kit is an asset of kind kit. Its own frames are the parts, cut out at the head's size, with the neck as the pivot.

Recipe: make a kit#

Using Atelier, make a kit villager from body-tall and body-short, with head-base as the bare head (neck at 240, 339, three times the size) and the parts in head-parts: hair, hats, faces, beards, moustaches and glasses. The hair, hat and face masks are in art/style/refs/heads/.

kit_create does four things:

  1. Cuts every part out of its painting (below).
  2. Finds each body frame's head (anchors).
  3. Normalises the bodies, which locks the bare head onto every frame.
  4. Returns the parts sheet and a few random villagers.

Bodies that look alike: for pixel-art bodies, make the second and later ones with generate_character { styleFrom: '<first body>' } (page 2), so PixelLab draws each in the first one's style.

Cut settings: cut.exclude names colours that are never part of a part: what the bare head was painted wearing, such as a blue hood. Without them, the lock would paste that hood onto other bodies too. cut.minArea is the smallest piece kept, in the head's pixels. The default of 250 suits a 480 × 690 head.

Anchors#

An anchor is where the head is in one body frame: the neck point, the head's size against the stand's, and its tilt.

  • With a rig, the rig is posed at that frame of the animation's motion (the one its action names: model:motion:<id>). Its neck and head joints are projected through the asset's camera onto the drawn frame. The stand's head is then matched in a small window round that point: a few pixels, ±8% in size (wider when the best is at the edge), and the rig's tilt, half of it, or none. Ludo follows the guide closely but not exactly, and it tends to draw heads nearly upright.
  • Without a rig, the head is searched for over the top half of the figure, at 62–112% of the stand's size. This is slower.
  • Flipped directions mirror their source's anchors exactly as the frames are flipped.

Anchors are kept on the kit. Each body also gets head and head-axis attachment points, which sprite moves frame by frame and the Asset page draws. When a body's frames change (a redraw, a new animation), track again with kit_update { track: true }, or Track anchors in the Studio. Home lists bodies whose frames have no anchors.

The head lock#

On every frame that has an anchor, normalise_frames takes the drawn head out and puts the bare head back at the anchor, at the stand's size. The head is then exactly the stand's in every frame, so parts painted on it always fit and the head ratio is 1.00 by construction.

  • A few rows of skin below the neckline (head.overlap) cover the seam; the collar stays the body's.
  • The frames as they were before the lock are kept in unlocked/, which anchors are tracked on.
  • lock: { <body>: false } keeps a body's own head. Re-normalise it afterwards.

Parts#

Cutting. A part is where its painting differs from the bare head, inside its slot's masks, never in the excluded colours, in pieces big enough to keep. The cut is closed and filled, and gets a soft edge. Thin or dark pieces wholly below the neck are dropped: that's the body's outline drawn a little differently in the painting. Each part then grows a skirt a few pixels over the head (skirt), so an anchor off by under a pixel never shows the scalp.

A view redrawn rather than painted over can't be cut cleanly: if a painting differs from the bare head over most of it, the cut takes the face or outlines too. The cut says so, and so does the sweep. Redraw that view with kit_part_add.

Z-order. The body (with its head) is 0. Parts above zero are drawn over it and parts below zero behind it, per direction: a ponytail behind facing s and in front facing n, a held box in front facing s and behind facing n. Set z on the slot, or on a part to override it.

Hats over hair. A slot's clips removes the clipped slots' pixels above its parts' lowest row, so hair never pokes through the crown of a hat. rules.underHat swaps a part for another under a hat: long hair for long hair under a hat.

Recipe: add a part#

Using Atelier, add a red baseball cap worn backwards to villager's hat slot, as hat-cap-red.

kit_part_add (paid: one masked edit per drawn direction):

  1. Copies the bare head into the parts asset in each direction.
  2. Paints it through the slot's masks. The edit is put back on the head outside the mask, so the face and outline stay exactly as they were.
  3. Cuts the part.

If edits are still running, job_wait collects them; then kit_update { recut: true } cuts it. In the web app, Add part in the Studio is the kit-add-part recipe: it runs on the server under the daily cap, then sweeps.

Recipe: a posed still to start a carry from#

Using Atelier, pose body-tall's stand in carry-chibi's first pose, then transfer the carry from it.

pose_still cuts the stand still into parts along the rig's bones, as they project at rest, and moves each part onto its bone in the motion's pose (at: 0–1 through it, default its first frame). It's free. The result is raw frames of <motion>-pose, one per direction. Give that to animate_transfer_motion { fromAnimation } instead of a still redrawn in the pose: Ludo starts from the character's own drawing, already holding its arms where the motion has them. Check limbs that cross the body by eye: each part is a capsule round its bone.

The sweep#

Sweep villager with 100 villagers.

kit_sweep rolls random villagers (seeded, so a sweep repeats) and checks every frame of every animation and direction:

Kind What it found
scalp Skin showing just outside a part where the bare head with that part shows none: the drawn head and the part disagree. Locked heads can't, so this is for bodies with lock: false, or anchors set by hand.
region A part's pixels outside its slot's masks, or a view redrawn rather than painted over the head.
z A part that clips another, drawn under it in some direction.
jump A head anchor that moves more than 2.5 typical steps (or 6% in size) between frames: a frame drawn off, or an anchor tracked wrong.
missing Frames with no anchors.

Each pair of a body frame and a part is checked once, however many villagers share it. 100 villagers over 2 bodies × 3 animations × 8 directions takes about 2½ minutes. The result is kept on the kit, for the Studio and for Home's next steps.

The Studio page#

Studios → Character Studio, or #/studio/<kit>:

Area What's there
Left The bodies and every slot's parts, with thumbnails. A part's tick puts it on the villager in the middle; clicking its name selects it.
Middle A villager playing any animation and direction: Roll for a random one, onion skin, the anchor's cross, and a scrubber with each frame's head size and place.
Right The selected part's z per direction and its offset (saved to the kit), its slot, what it clips, its tint layers and its under-hat part.
Below Every part in every direction, each cell flagged with what the last sweep found there, and the issues with Fix this (a task for Claude).
Actions Add part (the recipe), Add animation (for a body), Track anchors, Sweep (30 villagers).

Export#

export_asset on a kit writes the bodies' exports (head-locked frames, with head and head-axis points per frame) and the parts as one atlas. It also writes a mask sheet per tint key, cell for cell with the colour sheet, and a <kit>-kit item with each part's image, z and tint layers per direction, the slots' rules and the head's scale. The kit's content list loads the bodies first.

art/exports/kit-runtime.js (with its .d.ts) draws a villager over a body's Sprite:

import { Sprite } from '@basementuniverse/sprite';
import { KitSprite } from './art/exports/kit-runtime.js';

const kit = ContentManager.get('villager-kit');
const sprite = new Sprite(ContentManager.get('body-tall-sprite'));
const { parts } = KitSprite.roll(kit);
const villager = new KitSprite(kit, name => ContentManager.get(name), { sprite, body: 'body-tall', parts, tints: { tint: '#c0582a' } });
sprite.animation = 'walk';
sprite.direction = 'w';
// each frame
villager.update(dt);
villager.draw(context);

The head's size and tilt come from the distance and direction between the head and head-axis points. Tint masks are grey; a colour multiplies its mask, which is drawn over the image.

Troubleshooting#

You see Do this
"no humanoid rig, so each head is searched for" Rig the body (rig_model), or accept the slower search
"N frames but M anchors" The body's frames changed: kit_update { track: true }
A part's cut carries the face or body lines That view was redrawn, not painted over the head: kit_part_add it again
A hood or collar from another body on the head Add its colour to cut.exclude and re-normalise the bodies
Anchor jumps Look at the frames round it in the Studio (anchor on, scrub). A frame drawn off is a redraw; an anchor tracked wrong can be set by hand: kit_update { patch: { anchors } }
A tiny head loses whole parts Lower cut.minArea (it's in the head's pixels)

Next: The assistant, art reviews and unattended runs.

Found a mistake? Edit this page on GitHub.