Ben Llados
All projects

The Game That Builds Itself Around You

A browser game I built to present my WRIT 340 article on generative AI in games.

Role
Design, writing, and build
Course
WRIT 340, USC, Fall 2026
Format
Browser game, eight short chapters

Needs a keyboard: arrow keys or WASD to move, Space to talk. On a phone, watch the highlights below.

Pixel-art town square in the game. Ana searches for her lost bag while the player stands beside it, a label reads “Mara is watching,” and a dialogue box offers two choices: give the bag back to Ana, or keep the bag.
Chapter 3: the companion, Mara, remembers what you do with a stranger’s bag.

What it is

A browser game I built to present my WRIT 340 article on generative AI in games. You explore a coastal town while demonstrations explain character memory, interactive objects, and choices that change the world. The AI examples are scripted; no AI model runs in the game.

The game runs in eight short chapters, and slides built into it open at each checkpoint, so it doubles as the deck for my class presentation.

Highlights

The opening still: in Chapter 7, the player and Mara stand at the edge of a collapsed stone bridge at dusk, with the lighthouse island across the water.

Recorded from a scripted test run of the game and cut to key moments. No sound.

What’s real

Every line of dialogue is written in advance, and the learned-generation and 3D-car examples are prepared demonstrations, labeled as simulations on screen. The rest is computed as you play: a seeded generator builds and checks town maps, Mara ranks her memories by recency, importance, and relevance, and your choices change routes, characters, and objectives for the rest of the run.

The pixel art is drawn in code on an HTML canvas. I designed and wrote the game, and built it with help from AI coding tools.

The ideas it demonstrates
  • Procedural and learned generation

    A rule-based generator builds a new town map from a seed and checks it against three rules. Beside it, a prepared example shows what generating a place from a description might look like.

  • Character memory

    Mara stores what she sees and recalls what fits the moment, ranked the way the Generative Agents research describes.

  • From dialogue to action

    Agreeing to help isn’t enough. A request only works once it connects to a place, a route, and an action the game supports.

  • A car that works

    A car arrives in four stages, appearance, geometry, parts, and behavior, and you can only drive it after the last one.

  • Lasting consequences

    If the bridge collapses, merchants reroute, the way back becomes the ferry, and characters remember what happened.

  • Agency and authorship

    The last chapter uses the MDA framework (mechanics, dynamics, aesthetics) to ask who shapes a playthrough: the developer, the generative system, or the player.

Full playthrough

The title screen: “The Game That Builds Itself Around You” in pixel lettering over the town, labeled a scripted demonstration of generative AI concepts.

One route through all eight chapters, about five minutes, from the same scripted test run. No sound.