eight-direction-walk

Officialneta-search/eight-direction-walk
Use it in Cohub

Paste this into your agent's chat — it fetches the skill and follows it.

Use the skill: eight-direction-walk. Run `npx -y @neta-art/neta-search-cli@latest skills use neta-search/eight-direction-walk --via site` and follow what it prints. Read its complete output, redirecting it to a temporary file first if necessary, and resolve relative paths from the skill directory it prints.
Use in Neta Studio Open it in Neta Studio and see what people made with it.
Install from a terminal
npx -y @neta-art/neta-search-cli@latest skills use neta-search/eight-direction-walk
Summary

Turn one character into a full 8-direction walk animation, with a playable page and a ready-to-use sprite pack.

  • Works for one character you name or describe, including characters from your world. Walking is the default; running is available for two-legged characters.
  • You get a full-screen page where the character walks over a ground of your choice (stone, grass, sand, snow, wood or night) with the camera following.
  • Steer with keyboard keys, a touch joystick, or by tapping a direction on a dial. Left alone, the character walks a demo circle.
  • The download pack has transparent images for all 8 directions, an animated GIF per direction, and a short guide for Godot, Unity and Phaser.
  • Best for a character with a distinctive look and legs: two-legged characters, or four-legged ones like dogs, horses and foxes.
SKILL.md
# Eight-direction walk

One character, walking (or running) in all 8 compass directions — the animation a top-down or
isometric game plays as the character moves. You generate **one** sheet with 5 directions; the
other 3 are mirrored, so a full set costs one image.

What the user gets:
1. **A playable page (web Work)**: full-screen, the character walks across a ground with the camera
   following (WASD / arrows, a drag joystick on touch, or tap a direction on the dial that shows all 8
   directions walking); left alone it walks a demo circle. This is the hand-over card.
2. **The sprite pack** (`assets.zip`, also downloadable from the page): `spritesheet-8dir.png`
   (8 rows N NE E SE S SW W NW, transparent, cells cropped to the character, feet on one line) + `.json`
   (frame size, animations), `frames/<DIR>/NN.png`, `gifs/<DIR>.gif`, `README.txt` (Godot / Unity / Phaser).

## 0. Who walks? — ask before anything else

The request must **name or describe one character** (a character in this world, a named character,
or a written description). Naming only the world, the game, or "a character" is not enough.

- Named / described → go on. A character in this world counts: find it with
  `node /mods/neta/neta atom list --type character --query <name>` (try the user's wording and the
  original-language name — atom names are often English) and read it with `atom get <id>`; never by
  file path. Its cover is the first image in `media`; media paths are relative to the atom file, so
  `world/characters/X.md` + `../media/studio/characters/X.jpeg` = `world/media/studio/characters/X.jpeg`.
  That workspace path is the identity reference in step 2. No cover → describe them in words only.
- Not named → **stop and ask, generate nothing.** One short round: offer 3–5 of this world's
  characters (prefer ones with a cover) plus a write-in, via the `questionnaire` skill if available,
  otherwise one sentence. Never pick the character yourself.

**Then look at the body.** It picks the pose rig, and the wrong rig gives legs that don't move:

| Character | Rig | Notes |
|---|---|---|
| Stands on two legs | `assets/ref-walk.png` (run: `assets/ref-run.png`) | |
| Walks on four legs: dog, horse, fox, lion, a dragon on the ground | `assets/ref-walk-quadruped.png` | Walk only. Asked to run → make the walk and say a four-legged run isn't available here |
| Neither: flies only, swims, snake, jellyfish, swarm… | none | **Stop.** Say this skill needs legs, and offer `neta-search/side-sprite-creatures` (flying and swimming creatures, side view) |

Defaults, no question needed: **walk** (run only if asked), the world's / character's own art style,
transparent background. "4 directions" is the same job — deliver all 8 and say which 4 rows are
N / E / S / W.

## 1. Set up

`<skill-dir>` is the folder this SKILL.md sits in (the directory `skills use` printed) — never
`/mods/…` or `/workspace/.agents/skills/…`. Scratch work goes in `/tmp`; generation runs **from the
world root**.

```bash
SK=<skill-dir>; SLUG=<character-slug>-walk-8dir        # kebab-case
WORK=/tmp/$SLUG; mkdir -p "$WORK"
which convert identify jq zip                          # all needed
```

## 2. Generate ONE sheet (from the world root)

- Model: `gemini-3.1-flash-image-preview` — it takes reference images and returns exactly
  2528×1696 at `aspect_ratio=3:2` + `image_size=2K`, which the layout needs. Don't use the neta default
  (`krea2` ignores reference images).
- References (workspace-relative paths, comma-separated): first the pose rig from step 0, then the
  character's cover path from step 0 if there is one. The rig must be inside the world:
  `mkdir -p .tmp-refs && cp "$SK/assets/<rig>.png" .tmp-refs/rig.png`.
  Pass the cover with `--ref-file`, not `@Name` in the prompt (`@` puts the cover first, the prompt
  expects the rig first).
- Prompt: the template in `references/prompt.md` for that body (two-legged or four-legged), with the
  character and style filled in.

```bash
cd /workspace
NETA_DEFAULT_IMAGE_MODEL=gemini-3.1-flash-image-preview node /mods/neta/neta generate image \
  --prompt "$(cat $WORK/prompt.txt)" --ref-file .tmp-refs/rig.png[,<character cover>] \
  --work-title "<SHEET_TITLE>" \
  --param aspect_ratio=3:2 --param image_size=2K
```

This saves the raw sheet as an image Work in the world (it's the source material; that's expected).
`<SHEET_TITLE>` is written in the language the user wrote in, with the character named the way the user
named them, e.g. English `Mira · 8-direction walk sheet`, Chinese `<角色名> · 8 方向行走序列帧`. Never
use a Chinese title (or a name in another script) for a user who wrote in English, and the same applies the other way. Copy the saved file (`outputs[0].mediaPath`, already downloaded) to
`$WORK/sheet.png` and run `identify` on it: it must be 2528×1696. If the model returned 2048×2048, slice with
`scripts/layout-5x8-square.json` instead. One generation per run (a `MOTION-FLICK` warning in step 3 allows one more). If it returns no image (`GENERATION_UNAPPLIED`, a one-off model
hiccup) retry once; if it fails again or on credits, say so — don't loop.

## 3. Slice, mirror, pack (bundled script — never write your own)

```bash
cd "$WORK"
bash "$SK/scripts/make-game-assets.sh" sheet.png ./out --fps 8 --cutout=chroma \
  --layout-file "$SK/scripts/layout-directional-5x8.json" \
  --rows front,front-right,side,back-right,back \
  --mirror "front-left=front-right,left=side,back-left=back-right"
```

`--cutout=chroma` keys out the magenta panels the rig asks for — about half a minute, nothing to install.
It is right for soft pink and salmon characters too, and cleaner than isnet on them. If the character is too
close to the key it stops with `KEY-CLASH` (exit 7): re-run with `--cutout=isnet` (a one-off wait of **4–9 min**
the first time in a world; tell the user). Hot pink, fuchsia or neon magenta → use isnet from the start.
Done means the script printed `[directions] ok: 8/8` and `[delivery] ok`. Judge from the `[summary]`
lines, not by eye: at most one downscaled look at `out/spritesheet-8dir-alpha.png` if you must — don't
crop or zoom into frames (it costs minutes and changes nothing you can fix without regenerating).
- `EDGE-TOUCH: k of 40` with k > 0 usually means the model drew the panels in another colour. Re-run the
  slice once with `--cutout=isnet` (ML cutout; the first use in a world installs a model, **4–9 min** —
  tell the user it's a one-off wait).
  Still touching → deliver, and name the count as an open issue.
- `MOTION-FLICK` means a row flips between two poses instead of walking. This is the one case where you
  generate again: once, same prompt, then slice again. Still there → deliver, and tell the user plainly
  which rows flicker. A `[motion] note` is only a log line: don't regenerate, don't mention it.
- A non-zero exit is not done. Don't describe files the script didn't print.

## 4. Build and publish the page

```bash
cd /workspace
node /mods/neta/neta work init web works/web/$SLUG --title "<PAGE_TITLE>"
REF=<data.workDir from that output>        # it may normalize works/web/ to works/webs/ — use what it printed
bash "$SK/scripts/make-viewer.sh" "$WORK/out" "$REF" --title "<PAGE_TITLE>" \
  --subtitle "<one line: style · walk/run · 8 directions × 8 frames>" --lang <user-lang> --ground stone [--pixel]
node /mods/neta/neta work publish web "$REF" --thumbnail-wait 4000
rm -rf .tmp-refs
```

- `<PAGE_TITLE>` (e.g. `Mira · 8-direction walk` / `<角色名> · 8 方向行走`) and `--subtitle` follow the same
  language rule as the sheet title. `--lang` is that language (zh en ja es pt ru; the page's own
  labels and steering hint follow it).
- `--ground`: what they'd walk on in their world — `stone` (castle, town, dungeon; default), `grass`
  (outdoors, fields, forest), `sand` (desert, beach), `snow`, `wood` (ship, tavern, house), `night`.
- `--pixel` for pixel art. If the slice used `--cutout=isnet`, add `--no-despill`.
- It must print `[viewer] ok`. It cleans the edges, lines the 8 rows up on one ground line (so turning
  doesn't make the character hop), builds the clean sprite pack, and writes the page's config as
  `viewer.json` next to the Work's `meta.json` — leave `meta.json` to the CLI. Don't edit `index.html`.
- `publish` says `world_slug_required` → follow the hint it prints (set a slug from the world's name), retry once.

## 5. Hand over

Reply in the user's language. Through the `interaction-components` skill, each card on its own line,
as full `<interaction-json>` link blocks:
1. The page: `{"type": "work", "workId": "<preview.workId from $REF/meta.json>"}` — never an id you
   put together, never a `studio-route` with a world id from `.neta/runtime.json`.
2. The pack: `{"type": "world-file", "path": "$REF/assets.zip"}` (the page's 素材包 / Sprite pack
   button downloads the same file).

If they asked for a run and the character has four legs, say first that this is a walk, because a
four-legged run isn't available here. Then say in one or two lines: which character, walk or run, 8 directions × 8 frames, transparent PNGs, and
that the 8-row sheet is ordered N NE E SE S SW W NW (see `README.txt` in the pack). Mention any open
EDGE-TOUCH. Don't paste the sheet into the reply.

## Don't

- Generate per direction, or more than one sheet per run except after a `MOTION-FLICK` warning. Mirroring
  covers the rest.
- Use the two-legged rig for a four-legged character, however you word the prompt: it comes out standing.
- Pick a character, or start generating before the character is settled.
- Write your own slicing / packing script, or a README / project around the job.
- Run `neta generate image` from inside `/tmp` or a sub-folder (the Work would land where Studio can't see it).

Other actions (attack, jump, idle…) or one-direction sheets are not this skill.