# Homeward Ducks: Herd a Flock up the Terraces Before the Storm

> Write five lines (the terraces, the herder, the animals, the shelter, the storm) and get a 3D herding game in one offline HTML file. Walk a young herder over flooded rice terraces, swing the pole to scatter strays and whistle to bunch the flock of a few hundred ducks and turn it uphill, ramp by ramp, into the shelter before the storm breaks. The rigged herder, the duck, the shelter, the props, the painted sky, the ground textures, both music tracks and twelve sounds are generated through SandBase; the flocking simulation, the terrace plan, the storm timer and the rules are code.

- Type: Lab Skill (downloadable Agent Skill)
- Category: [Game creation](https://www.sandbase.ai/skills/games)
- Version: 0.1.0
- Runs online: yes
- Page: https://www.sandbase.ai/skills/games/homeward-herd

## What you get

Bring a terrace world, a herder, the animals and their shelter, and what the storm threatens; optionally a mood. Write them in English or Chinese. The Skill returns a downloadable Skill (the herding engine with a GPU flocking simulation, a budgeted SandBase asset generator with rigging, a terrace planner, verification) and one playable example with its generated media and billed cost.

## Install

Download the Skill package from https://www.sandbase.ai/skills/games/homeward-herd (sign-in required), unzip it into your agent's skills folder, then ask your agent to use it:

```text
/homeward-herd make a game where <your herder> drives <your animals> up <your terraces> into <their shelter> before <your storm>, in a <your mood> mood
```

## How it works

1. **Write the brief** Tell your Agent the stepped terraces above a valley, the young herder with a long tool, the animals and the shelter at the top, and what the storm threatens. On your machine with Node 22.14.0 the Agent runs node scripts/new-project.mjs --out my-herd --theme <id> and npm ci, then fills themes/<id>/theme.json. A Chinese brief gives a Chinese game.
2. **Generate the flock and cut the terraces** npm run assets prints every SandBase call and its worst-case price and spends nothing until you add --confirm-real: a Claude spec with every name, subtitle group and the herd’s body and gait, a gpt-image sky panorama and ground tiles, a Tripo herder rigged by Meshy with seven clips, the instanced herd animal and six static props, two Lyria tracks and twelve ElevenLabs sounds. The planner then cuts the hill into flooded tiers, places spillway gaps, ramps and the shelter, and checks a bot can reach the door.
3. **Swing, whistle and drive them home** Swing the pole and nearby animals scatter away from you; hold the whistle and they bunch up and turn for home. At half time the wind rises and they scatter more easily, then the rain arrives. Drive the flock tier by tier through the spillways and up the ramps into the shed before the storm breaks, and the end card shows how many came home on one to three stars.

## FAQ

### Which SandBase models does Homeward Ducks use?

Claude Sonnet writes the spec (title, herd name, subtitle groups, palette, the herd’s body and gait and the prompts for everything else); gpt-image makes the sky panorama, ground tiles and reference images; Tripo turns those into the herder, the duck, the shelter and the props; Meshy rigs the herder with seven clips; Lyria writes two music tracks and ElevenLabs twelve sounds. Every call is listed with its billed amount in the theme’s CREDITS.json. The built file calls nothing at runtime.

### What if a terrace or ramp cannot be routed?

The planner re-cuts the hill and re-rolls the gaps and ramps, noting each retry; if no route to the shelter can be proven, processing stops with the reason. Changing the level seed or a terrace value in theme.json is free; otherwise the Agent regenerates only the affected part.

### Do the ducks all have to reach the shed?

No. The run ends at the timer or when nearly everyone is home, and the end card grades the count: three stars at 95%, two at 80%, one at 50%. The autopilot in the check run brought 295 of 320 home; a good human run is in the same range.

### Which languages does the game have?

The interface is in English and Simplified Chinese. The spec writes the names and subtitles in the language of the brief, so the rice-terrace example plays bilingually. The game has music and sounds but no voice acting.

### Why is the demo sandboxed?

The frame has an opaque origin and no network access, so the scene can’t read anything from this page or reach the internet.

### Can I play Homeward Ducks on a phone?

Yes. A stick on the left moves the herder, dragging on the right turns the camera, and two buttons swing the pole and whistle. The headless check drives these controls at 390×844 under touch emulation; it has not been tested on real devices. The file is about 11 MB and needs WebGL 2 and WebAssembly.

### Why is there no online generation?

Building a new scene needs a model key inside the sandbox, which the backend doesn’t support yet. Run the Skill with your own agent for now.

## Examples

- Homeward Ducks playable rice terrace (scene)
- Homeward Ducks (video)
