Skip to content
1st Place

Kahani

Kahani is a browser-based adventure game where a player's one-line idea is expanded into a full "game bible": a mystery with 3 NPCs, 3 guarded clues, and fail states.

Core trick

Each screen is re-read beside its own painted frame so a second image-model pass places precise clickable hotspots.

Tags

Description

Kahani is a browser-based adventure game where a player's one-line idea is expanded into a full "game bible": a mystery with 3 NPCs, 3 guarded clues, and fail states. The overworld is generated screen-by-screen using NB as the player walks: each screen is painted, then the image model traces borders over its own frame so a second pass can read both images into precise interactive hotspots (buildings, items, actions) — an infinite, seamlessly-stitched pixel-art world. Dialogue is voiced (Gemini TTS) and refereed live: rude or reckless choices raise a heat meter and can turn NPCs hostile, closing off clues. The run ends in either a victory finale (all 3 clues resolved) or a defeat finale (heat maxes out).
harshagw/kahani★ 94 forksTypeScriptCreated Jul 11, 2026 · last push Jul 22, 2026

README excerpt

<p align="center">
  <picture>
    <img src="public/kahani-logo.png" alt="Kahani" height="50">
  </picture>
</p>

# Kahani World — describe a scene, walk into it

**An AI game studio that runs while you play.** Type one sentence — *"a
rain-flooded night market in Mumbai, I'm a courier carrying a tiffin box
someone will kill for"* — and thirty seconds later you're **walking through
that world with arrow keys**: an isometric street painted by Nano Banana 2
Lite, a player character forged in the same art style, buildings you can
enter, characters who speak to you out loud, and one hidden mystery that
converges to a finale.

## Why this needs NB2 Lite (generation is load-bearing)

This is not a prompt-box-to-image app. The game **cannot exist** without
fast, cheap, high-volume generation:

- Every visible thing is generated at play-time: the street, the player
  sprite, every interior, the finale frame. Nothing is pre-made.
- **Spatial prefetch:** the moment the street appears, all 3 interiors
  generate **in parallel while you walk** — so pressing E at a door is
  instant. The HUD shows it live: *"rooms pre-building 2/3"* → *"all rooms
  pre-built · doors open instantly."*
- A single 5-minute run fires **~20+ model calls** (level-design text,
  image renders, vision passes, dialogue turns, TTS lines) — visible in the
  in-game "AI generations this run" ticker. At $0.034 / 1k images, a full
  playthrough costs well under a rupee.



## The pipeline per scene

<img width="765" hei

Team