Inspiration

The Night Watchman was inspired by a simple, true story: a watchman who treasures his wife, and keeps his lantern burning through the darkest hours of the night to light her way home. Every ghost in the village is only an excuse for the light to matter — someone is keeping the window lit, and that is worth surviving all five watches for.

What it does

The Night Watchman is a zero-dependency, single-page browser survival game set in a haunted village. You play as a traditional Chinese night watchman (打更人) patrolling from the First Watch (一更) through the Fifth Watch (五更). Your paper lantern casts a warm circle of light into the darkness, but its oil drains steadily over time, shrinking your visible radius unless you find oil refills along the patrol route. Shadows and ghosts stalk the alleys, growing faster and more numerous with each passing watch. While lantern light slows nearby spirits, your primary defense is striking your wooden clapper (梆子), which announces the watch and sends out a shockwave that drives ghosts back on a short cooldown. Survive all five watches until dawn breaks to complete your patrol and win.

How we built it

The project runs directly in the browser via vanilla ES modules, Canvas 2D procedural rendering, and Web Audio API synthesis, with zero third-party assets or network requests. We structured the build around Kiro's spec-driven workflow:

  • Steering (.kiro/steering/): Defined the product vision (product.md) and technical constraints (tech.md enforcing plain HTML/CSS/JS, procedural audio/graphics, and small modular files) before writing code.
  • Specs (.kiro/specs/night-watchman/): Used the three-part specification suite (requirements.md with 10 EARS-style requirements, design.md for architecture and module boundaries, and tasks.md breaking the work into 26 discrete tasks) to implement systems step by step—from village movement and lantern falloff to ghost AI, watch progression, and procedural audio.
  • Agent Hooks (.kiro/hooks/): Configured two file-save hooks—on-save-syntax-check.kiro.hook to run node --check on saved src/*/.js modules, and on-save-spec-sync.kiro.hook to keep the task checkboxes in tasks.md aligned with the commit history.

Challenges we ran into

Our primary operational hurdle came from service rate-limiting and quota ceilings during generation. Mid-task throttling interrupted kiro-cli runs around Tasks 5 and 6 (src/render/lantern.js), requiring manual completion of interrupted wiring. Later in the schedule, after hitting the monthly Kiro usage cap and encountering SSO session expiration during hook authoring, the remaining tasks, hook configurations, and playtest visual fixes (such as pointer-event pass-through on the HUD and the dawn ending tableau) were completed with alternative tooling and by hand. Every hand-written intervention and fallback is documented transparently in NOTES-dev.md.

What's next for The Night Watchman (打更人夜巡)

  • Expand the village layout with distinct landmarks, shrines, and narrower alleyways that affect line of sight and ghost pathing.
  • Introduce distinct spirit behaviors per watch, requiring different combinations of lantern positioning and clapper timing.
  • Refine procedural Web Audio synthesis with richer ambient night textures and spatial cues for approaching threats.

Built With

Share this project:

Updates

Submission history