Sand AISand AI MAGI-2MAGI-2 現已登上 SandBase:支援原生音訊的 1080p 影片立即試用

yanwu-stage · Paint a pixel arena

Arenas only. Describe a place and your Agent paints it as one .yanwu.js plugin: a 480×270 dithered backdrop on the shared floor line, with a landmark, light sources and ambient weather. The check renders it, measures it and runs a full AI duel on it.

範例

AI duels in seven arenas, from the cloud terrace to the snowy mountain gate

Three Skills for your Agent. Make a fighter, make an arena, or take the whole game and change anything. Each one hands you a file you load into the arena above.

運作方式

  1. 01

    Plan the place and its layers

    Yanwu Stage starts with node scripts/stage.mjs new my-arena, which copies the Snow Gate example to yanwu-out/my-arena.yanwu.js. Read references/stage-design.md, then choose with the user a place and time of day, one landmark, three or four depth layers, a palette of 8 to 12 colours, the light sources and one ambient motion such as snow, rain, sparks or mist.

  2. 02

    Paint the backdrop in code

    draw paints all 480 by 270 art pixels each frame and should cache static layers made with kit.makeCanvas and ordered dither from kit.bayer. glow adds subtle light on the additive layer. Keep the floor line at y = 219 with a solid band below it, and the top 40 px calm for the HUD. Motion must be a pure function of clock.

  3. 03

    Check coverage, frame time and a duel

    After npm install, node scripts/stage.mjs check yanwu-out/my-arena.yanwu.js renders 10 seconds, checks coverage, the floor and HUD bands and frame time, then runs a full AI duel. It writes my-arena.png and my-arena-duel.png under yanwu-out/stages. Look at both images and fix anything marked with a cross before loading the file into the arena.

常見問題

What does Yanwu Stage produce?

Yanwu Stage produces one .yanwu.js ES module under 500 KB that exports stages, each with an id, a Chinese name, an English nameEn and draw and glow functions. One file can hold several arenas. After loading it, the next duel in Yanwu Arena is fought on the new stage.

Is Yanwu Stage free to use?

Yanwu Stage paints every pixel with code and kit primitives, using no image generation and no model calls, so it needs no key and nothing is billed. It needs Node and npm for the check script and for the local workshop at 127.0.0.1:4182/assets/player/, where Duel selects the loaded arena.

Can Yanwu Stage reuse a built-in arena id?

No. Yanwu Stage rejects the built-in ids night, dusk, rain, forge, canyon and bamboo, and arenas must be original places and art. Pick a new id when scaffolding, and write both the Chinese name and nameEn so the arena label shows correctly in either interface language.

Why must a Yanwu Stage keep the top band calm?

Yanwu Stage reserves the top 40 pixels for the fight HUD, so busy art there would hide the readouts. The same reasoning keeps glow subtle: skill effects must read on top of the backdrop. The check script reports stages that break the HUD band, the floor band or full pixel coverage.

Can a Yanwu Stage load data from the web?

No. A Yanwu Stage has no network, storage or DOM access, and everything comes through kit. Motion is a pure function of the clock, so the same time always draws the same frame. Snow Gate, the bundled example, shows a dawn sky, snowy ridges, pines, a red gate with lit lanterns, falling snow and mist.

Lab Skill · Games

Seagull Swoop

Build a 3D flight-and-delivery game with light fries, heavy fish, crosswinds and optional ring routes. The gull must bring lunch home; cargo weight changes which openings it can safely reach.

Lab Skill · Games

Wedding Cake Wobble

Build a 3D fragile-cargo delivery game around a wobbling wedding cake. Brake before turns, avoid crossing guests and steer around tables. Lost tiers change the score, while a partial delivery can still succeed.

Lab Skill · Games

Hermit Tide

Build a 3D route-and-timing game where a hermit crab changes shells to cross a tidal shore. Narrow gaps favour the cap, stronger shells resist waves, and dry stones provide shelter and checkpoints.

Lab Skill · Games

Clover Circuit: Estate Cut

Drive a coral ride-on mower through a fenced estate garden. Steering, braking and the moving blade cut actual grass tufts; Overview reveals the genuine trail. Edit three gardens and three scene palettes offline. Coverage counts trimmed tuft centers rather than continuous ground area.

Lab Skill · Games

Glide Gates: Lagoon Run

Flap a golden bird through emerald pipe pairs above a turquoise lagoon. Actual fixed-step gravity, swept circle contacts and full-gate scoring power both manual flight and clearly labeled practice. Edit three courses and three scene palettes offline.

Lab Skill · Games

3D Interactive Garden Islands

Walk a curved garden, harvest fruit, share gifts, catch butterflies, fish, grow flowers and craft furniture. Four lighting states and one offline HTML with bilingual keyboard and touch controls.