Skip to content

feat(edge): edgerunners action-drama for GBA#97

Draft
doodlewind wants to merge 15 commits into
mainfrom
feat/edge-see-you-on-the-moon
Draft

feat(edge): edgerunners action-drama for GBA#97
doodlewind wants to merge 15 commits into
mainfrom
feat/edge-see-you-on-the-moon

Conversation

@doodlewind

Copy link
Copy Markdown
Collaborator

What

A new @pocketjs/edge package — the action-genre descendant of @pocketjs/saga — plus a full fan-tribute game built on it: SEE YOU ON THE MOON《月球见》, an unaffiliated, non-commercial tribute to Cyberpunk: Edgerunners.

The user asked for a cyberpunk/Edgerunners fan game with more action, not dialogue-only, a fresh toolchain, and the song "I Really Want to Stay at Your House" as a story insert. This delivers all three.

New engine systems (on top of the inherited cine/saga vocabulary)

  • Side-scrolling action core (runtime/action.c): run/jump/shoot physics, ↑+B rising diagonal, point-blank melee; a five-behavior enemy pool (thug / gunner / drone / turret / boss with telegraphed charges, spread volleys, ground shockwaves); shared bullet pool; wave gates with checkpoints; and the Sandevistan — hold R and the world runs at 1/3 rate while the player runs full speed, the BG palette swaps to a compiler-tinted cyan duotone, and afterimage ghosts trail. Death respawns at the last gate (mercy), never failing the film.
  • DirectSound PCM music (runtime/audio.c): s8 mono @ 13379 Hz (224 samples/frame — VBlank is the stream clock) via DMA1 → FIFO A on Timer 0, embedded at link time with .incbin. yield music("stay") / music("off").
  • New op vocabulary (action(), music(), track()), spec/stage/track tables, and the SCENE_ACTION kind — all through the same partial-evaluation discipline (TS generator → cue bytecode).

The game (12 scenes, action-first)

Title → 公寓 → 诊所 → ALLEY(action) → 列车(world) → 据点(world) → WAREHOUSE(action) → 天台(★ insert song) → STREET(action) → LAB(action) → TOWER(boss) → 月球(credits + reprise).

Original Chinese dialogue throughout, grounded in a source-cited research dossier (game/dossier.md) with an echoed-lines ledger and a do-not-state-as-fact list. The insert song plays as DirectSound PCM on the rooftop and moon scenes.

Verification

  • bun run test:engine40/40 (adds action + music + sandevistan asserts).
  • bun run test33/33, one continuous mgba playthrough of all 12 scenes, asserting scene flow, both music tracks, the scripted boss phase, and film completion.
  • Every scene visually screenshot-reviewed.

Fan-work / IP hygiene

  • Generated pixel art is franchise-neutral (prompts describe the cast in plain visual language); real names appear only in private-build story text.
  • The 8-bit cover audio .raw files are git-ignored — third-party audio, private tribute only. game/music/README.md documents the fetch + ffmpeg step. The engine tests use a procedurally-generated square-wave track, so they need no external audio. Built ROMs embedding the covers are not for distribution.

🤖 Generated with Claude Code

doodlewind and others added 15 commits July 6, 2026 04:34
- runtime/ -> runtime/gba/; per-target pjgb_gen.h via spec/gen-c.ts
- target-neutral asset collection (assets.ts) + targets/gba.ts backend
- GameHeader v2: text_mode + glyph slot region; map on-enter scripts
- script VM: LT/GT/LE/GE/RND ops, while loops, varGt-family, warpTo fixups
- cjk16 text mode: Unifont 16x16 glyph subset baking, compile-time
  wrap/pagination, on-demand VRAM glyph slot streaming (GBA renderer)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- targets/gb.ts: DMG 2bpp/4-shade encoding, autobanked gen_data C arrays
  (MBC5), Unifont glyph stores, GBDK-2020 lcc build
- runtime/gb/: GBDK C runtime — window textbox with STAT-safe typewriter
  glyph streaming, WRAM script buffer VM, banked data access, 8x16 OBJ
  scene, fixed WRAM debug block (0xDE00)
- mgba_runner auto-detects GBA/GB cores (mCoreFindVF)
- test/e2e-multi.ts: one logical scenario suite driven through every
  target's emulator with per-target text pagination (36/36 green)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…argets green)

- targets/nes.ts: planar 2bpp encoding, luminance-clustered NES palettes,
  compiler-assigned UNROM banks (generated ld65 cfg + iNES header),
  CHR-RAM layout with dynamic glyph slot region
- runtime/nes/: custom crt0 (reset/NMI/bus-conflict-safe bank switch),
  NMI-owned OAM DMA + VRAM update buffer capped to the vblank budget,
  nametable-overlay textbox with map restore, fixed-bank VM,
  cc65-tuned hot paths (flat debug block writes, mul-free OAM build)
- test/harness/nes_runner.ts: jsnes headless runner speaking the same
  scenario protocol; e2e-multi drives gba+gb+nes with one suite

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- demo-shendiao/: title-screen chapter select (map onEnter menu), three
  story segments (剑冢神雕 exploration+item, 断肠之约 dialogue+choice+leap,
  襄阳大战 scripted 7-turn boss battle over HP/气 vars), epilogue unlock;
  all dialogue original fan writing per the design doc
- imagegen art pipeline: 6 generated source sheets + deterministic
  extractor (content-band cell detection, per-target quantization,
  per-tile luminance flatten + Bayer dither for the 2bpp targets)
- residualizer upgrades the demo exercised: ! negation, numeric case
  labels, break-in-while, return, <Trigger> sprite-less interactables
- NES: CJK glyphs stream one halfcell per frame so the NMI VRAM flush
  always fits vblank; GBA header gets the BIOS logo/title/checksum pass
- test/e2e-shendiao.ts: full-story scenario on gba+gb+nes (69 asserts);
  test:all = 123 cross-target assertions, all green

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New independent package @pocketjs/cine (sibling of @pocketjs/aot, GBA-only):
declarative parallax scenes + residualized cue-VM timelines, built to flex
GBA 2D — HBlank raster gradients, alpha/white fades, mosaic, affine OBJs,
WIN0 letterbox, tween engine, CJK typewriter captions, PSG micro-sfx,
interactive beats (waitA/dialog/choice/control-walk/mash+counter).

Verified headlessly via the aot mGBA runner: 2-scene smoke film exercises
every op; debug-block contract at EWRAM 0x02000000.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Typed pixflux client (Bearer key from repo .env), spec'd prompt sheet for
11 backgrounds/parallax strips + 15 sprites (franchise-neutral originals),
committed PNG cache so builds never re-bill, layer y-offset placement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The first @pocketjs/cine film: an Up-style interactive montage of 尤雨溪's
journey (486/MS-Paint childhood -> Flash aquarium -> NYC bus + HN -> naming
Vue -> the 2016 Patreon leap ('那封信') -> stars 2018 -> Vue 3 One Piece ->
Vite lightning -> VoidZero fleet -> family hill + anime-codename credits).
Chapter select boots first for real-hardware demos; ~6 min full run.

All dialogue original fan writing from verified public sources; all art
PixelLab-generated. Engine fixes found by playtesting: chip captions get a
private glyph-slot range (ring collisions garbled persistent chips), CPU
IRQ enable in crt0 (the runtime is interrupt-driven), layer y-offsets.

E2E: bun test (27 assertions) drives the whole film headlessly in mGBA —
menu nav, control walks, HN mash 88->100, hesitate loop + jump, white-fade
scene chaining, credits, coda->title loop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces the PixelLab 'V gem' with film/bake-logo.ts: the official logo's
two polygon paths rasterized at build time (4x4 supersampled, snapped to
green #41B883 / slate #35495E) into a native 64x64 sprite — crisper than
an affine-upscaled 32px gem. Also passes the OBJ semi-transparency flag
through the affine draw path so the coda's ghost logo actually blends.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…Lab vs gpt-image eval

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fork cine/ into saga/ and add the playable layer the montage DSL never had:
top-down WORLD scenes (64x64 tilemap on BG1, Pokémon-style 16px grid stepping,
collision bytemap, both-axis soft camera, walker sheets with facing rows, NPC
talk + examine/auto/exit triggers running sub-cues that resume the roam),
encounter meters (var-bound OBJ segment bars), and a deterministic Breakout
minigame (OBJ bricks/ball/paddle over any scene BG, pushes bricks cleared).
Cue table per scene replaces the single play blob; setVar can copy locals.
Debug block gains player cell/dir, bricks-left and scene kind; magic is SAGA.
Engine e2e: 24 asserts through mgba (roam, block, talk, spot, exit chain,
breakout launch->clear->budget) — all green on placeholder art.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…r pool

Sub-cue if/while jump targets were emitted relative to their own cue but the
VM's ip is absolute in the scene's concatenated blob — any branching NPC/spot
cue silently no-opped (the smoke film's branchless cues never caught it).
residualizeCue now takes the cue's base offset; the smoke buddy talk grew an
if-branch as the regression tripwire. Also: walkers with walkFpd>=4 play a
full 4-phase cycle (animate-with-text sheets), N_VARS 16->24 for game+local
budgets, and the debug block offsets that moved with it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…an tribute

English-language interactive biography, dossier-driven: 13 scenes from Paul
Jobs' workbench to the Flint Center launch. Four walkable top-down maps
(Mountain View garage, the fifty-boards garage, Xerox PARC, Bandley 3), the
Breakout night as a playable minigame, two conviction-meter encounters (the
parts-man net-30 call, the sugared-water terrace), and a finale where the
Macintosh speaks its documented 1984 lines. game/dossier.md carries the
source-cited research (verified/disputed ledger); disputed history is framed
as disputed, documented quotes appear verbatim, everything else is original
fan writing and the credits say so.

Art: PixelLab throughout — top-down room maps generated directly at 320x240,
walker sheets via /animate-with-text (64px minimum, 2x nearest round trip),
portraits, props; committed under game/art/ with the manifest. E2E: 42
asserts across 6 scenarios (menu, world gates, breakout, both encounters,
the Mac's line by text id, credits->title loop) — all green in headless mGBA.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ma for GBA

New @pocketjs/edge package: the action-genre descendant of @pocketjs/saga. It
keeps cine/saga's whole cinematic + walkable-world vocabulary and adds two
engine systems, then ships a full fan-tribute game on top.

Engine
- runtime/action.c: side-scrolling run-and-gun core — player physics
  (run/jump/shoot, ↑+B diagonal, point-blank melee), a five-behavior enemy
  pool (thug/gunner/drone/turret/boss with telegraphed charges, spread
  volleys, ground shockwaves), a shared bullet pool, wave gates with
  checkpoints, and the Sandevistan: hold R and the world runs at 1/3 rate
  while the player runs full speed, the BG palette swaps to a compiler-tinted
  cyan duotone, and afterimage ghosts trail. Death respawns at the last gate
  (mercy), never failing the film.
- runtime/audio.c: DirectSound A PCM streaming — s8 mono @ 13379 Hz (224
  samples/frame; VBlank is the stream clock) via DMA1→FIFO A on Timer 0,
  embedded at link time with .incbin. `yield music("stay")` / `music("off")`.
- spec/edge.ts + gen-c mirror; dsl action()/music()/track() vocabulary;
  compiler action/stage tables + sandevistan palettes + gen_music.s.

Game: SEE YOU ON THE MOON《月球见》 — 12 scenes, action-first, original
Chinese dialogue. Insert song is an 8-bit cover of "I Really Want to Stay at
Your House" streamed as PCM on the rooftop and moon scenes. Sourced from a
cited research dossier (game/dossier.md); franchise-neutral generated art
(PixelLab), real names only in private-build story text. The cover .raw files
are git-ignored (third-party audio, private tribute only).

Tests: engine E2E 40/40 (adds action + music + sandevistan asserts); full
game playthrough E2E 33/33 driving all 12 scenes, both music tracks, the
scripted boss phase and film completion. Every scene visually reviewed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@doodlewind doodlewind changed the title feat(edge): SEE YOU ON THE MOON — a Cyberpunk: Edgerunners action-drama for GBA feat(edge): edgerunners action-drama for GBA Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant