Spielwerk 43: Knochenwerkstatt

2026-11-21
Spielwerk 43: Knochenwerkstatt - Teaser

A picture drawn by hand gets bones. Open a PNG of a character, pick a skeleton, drag its joints onto the drawing, and the character walks, runs, bites and breathes fire at once: nothing is animated by hand. Steps 38 to 42 made their characters in Blender scripts and kept them only as packed atlases; now every rigged character of the library is a folder of plain pictures and a short rig.json, so anyone can draw a new one or change an old one in a paint program. The toolbox learns to rig a picture on a skeleton template.

Play it · How to draw your own figures · Source: collection-spielwerk/43-knochenwerkstatt · Toolbox 6.3.0 or later

The workbench

There is nothing to win or lose. The drawing lies in the middle with its skeleton over it, the character plays on a small stage at the right. The editor fills its window: the side panels keep their width and the bench takes the rest, zoomed to the drawing.

Controls:

Draw your own character or monster

  1. Optional: a guide. Pick the skeleton and press Vorlage: a zip of sheets with the joints, the ground line and a scale in pixels, one per part (its own bones strong, the rest faint) and one for the whole figure, named as the editor opens them. The zip itself is to draw on: dropped back in unchanged, the editor says so. Drawn on them and exported at their full size, the layers open with the joints where the sheets show them. With a character open, it lies faint under the joints, the way to draw a new skin for it.

  2. Draw in any paint program (PhotoLine, for example) on a transparent background: the character whole, standing still, seen from the side and facing right, the feet on one line. Each part on a layer of its own, so it can be drawn again alone later; export every layer as a PNG, best all of the same size (a cropped one opens in the middle on the bottom edge and is moved into place with Shift+drag), numbered back to front:

    • Zweibeiner: 1-far_arm.png, 2-far_leg.png, 3-near_leg.png, 4-torso.png, 5-head.png, 6-near_arm.png;
    • Vierbeiner: 1-far_hind_leg.png, 2-far_front_leg.png, 3-tail.png, 4-torso.png, 5-head.png, 6-near_hind_leg.png, 7-near_front_leg.png;
    • Flieger: 1-far_wing.png, 2-far_leg.png, 3-tail.png, 4-torso.png, 5-head.png, 6-near_leg.png, 7-near_wing.png;
    • Wurm: 1-torso.png, 2-head.png; or, for anything simple, one picture.

    Fewer layers work too: the older 1-back.png, 2-body.png, 3-front.png (the far side, the body with head and tail, the near side) still follow their bones. With these names each layer moves only with its own bones.

  3. Open the PNGs together (or drop them) and click the skeleton's key. Drag every joint onto its place: shoulder, elbow, hip, knee, ankle, toes, neck, jaw, the tail. Drag the orange line under the feet.

  4. Watch the clips. Where something stretches, move the joint next to it. Gewichte shows which bone pulls which pixel; a layer's bones list, or its bones clicked on the skeleton, keeps an arm from following a leg.

  5. Export the folder. In the owner's asset library the same editor saves it straight in (library.mjs rig), and a game loads it like any puppet: catalogue_images: { wolf: "drawn/monster/<name>" } in its src/assets.ts, then logic.load_puppet("wolf").

New in the toolbox: drawn characters

The problem. The characters of steps 38 to 42 were made by Blender scripts: every part rendered alone, packed into one atlas, the bones and pivots written into JSON. A person drawing a monster in a paint program had no way in, and changing a hat meant changing a script. The owner asked how to add a monster drawn by hand. The answer is a whole picture plus a rig editor.

A skeleton template. Each of the four skeletons is plain data: the joints a person drags (with German titles), the bones between them, the anchors (soles, mouth, hands) and the chains with their roles, the same roles step 42's generator uses. A template also names its parts, one layer each: an arm, a leg, the torso, the head, the tail, a wing. With an arm and a leg on one picture the arm's pixels bound to the leg as well, and the run stretched part of the grid to eight times its length; with the limbs on layers of their own the Kobold stretches at most 2.3 times on a run. Since 0.1.4 every part is its own layer, so one arm can be drawn again and swapped alone; the bigger groups of before (back, body, front) stay as groups, and folders drawn with them follow the same bones (template_layer_bones). All fifteen rigged items of the library build the same from their folders after the change.

From joints to a rig. rig_from_picture fits the template to the placed joints (bone lengths and angles), paints a bone map for every layer (each pixel in the colour of the nearest bone it may follow), cuts each layer to its pixels and packs them with their maps into one atlas. The result is step 41's soft skin, so the drawing bends as one skin. The movement comes from the template: step 42's gaits and attacks, made from the fitted bones' measurements, and for a Zweibeiner step 38's keyed clips, their angles carried over onto the new rest pose with the hip lifted so the feet still stand.

const built = rig_from_picture({
    layers: [{ name: "back", pixels: back }, { name: "body", pixels: body }, { name: "front", pixels: front }],
    joints: placed,                                    // { pelvis: [210, 250], neck: [330, 205], ... } picture pixels
    template: "vierbeiner",
});
const rig = PuppetRig.from_data(built.rig);            // idle, walk, run, bite, fire, claw
rig.image = canvas_of_pixels(built.pixels);
const wolf = rig.puppet("walk");

Every rigged item is a source folder. <item>/source/ in the library holds one picture per character, per layer, per part or per piece and a short rig.json (kit.json for a kit), and build_rig_source builds the atlas and the catalogue's rig from it. The packing is fixed (shelves sorted by height and name, 4 pixels apart), so the same folder always gives the same bytes; split_rig_atlas takes a built atlas apart into a folder again. The Blender scripts of steps 38 to 42 now write these folders instead of atlases. All twelve of their characters, kits and sheets came out of the new path with the same rig, key for key, and the same atlas, pixel for pixel, so the games did not notice.

The draw-over sheet. template_sheet draws a template on a canvas in the skeleton's own shape (upright for a Zweibeiner, wide for a Vierbeiner): the bones, the joints with their names, a scale and the ground line, and optionally a character faint under it. With bones it is one layer's sheet, those bones strong and the rest faint.

What it costs. After a joint moves, the Kobold's rig (six layers, 340 × 450 pixels, its grid and eight clips) is made again in 16 ms in headless Chromium.

Tests. The toolbox's tests check that a picture rigged on the Zweibeiner runs step 38's run with its feet on the ground, that a moved joint changes only the bones next to it, that a layer limited to the far leg never binds to the near leg, and that every kind of source folder (a puppet's parts, a soft skin, a wardrobe, a mark sheet, a part kit) splits off a built atlas and builds back into the same rig and pixels. The step's tests draw a figure in code for every template and check every clip for tears and folds, the undo, the layers, a folder that goes out and comes back, and a layer's moved picture (the same rig from the bench, from its folder and from build_rig_source). The browser check opens the Kobold from the library, drags joints, plays every clip, downloads the sheet, exports the zip and opens it again into the same rig and the same atlas, nudges the Kobold's head with the arrows and Shift+drag and resets it, then draws a monster of its own, drops it on the workbench, rigs it as a Vierbeiner and makes it walk and bite.

The modules are in src/canvas/puppet/: SkeletonTemplate.ts, RigPicture.ts, RigSource.ts and TemplateSheet.ts. The docs are the "Drawn characters" section of docs/puppet.md.

From earlier steps

The scaffold, start screen, intro and scaling are explained in Spielwerk 00: The workbench.

Embed it

<script src="https://www.game-object.de/tce-elements/tobidot/dll-tce-assets"></script>
<script src="https://www.game-object.de/tce-elements/tobidot/tce-knochenwerkstatt"></script>
<tce-knochenwerkstatt></tce-knochenwerkstatt>
Attribute Values Default
init-intro true / false: play the GO logo intro true
init-workshop true / false: in the asset workshop ("Speichern" instead of "Exportieren", no example opened) false

Next

Previous: Spielwerk 42: Bestiarium · Next: Spielwerk 44: Knopper Klopper · All steps

Comments

captcha