Avatar
gokaygokay
All ArticlesTwitter
Reference to Game: Turning Visual References into Playable Worlds
Games2026-11-095 min

Reference to Game: Turning Visual References into Playable Worlds

A reference can define the color, camera, characters and rules of a game. Reference to Game carries those decisions into playable worlds, with four open-source examples.

By Gökay Aydoğan

Share:
Explore the project on GitHub

A prompt like “make a colorful boat racing game” leaves almost every interesting visual decision to the model. How red are the cliffs? How close is the camera? Does the water look painted, glassy or plastic? How much screen space does the boat occupy?

A good reference answers those questions immediately. I want to carry those decisions into something I can play.

Reference to Game is an open-source skill and toolkit for coding agents built around that idea. Start from an image, a video, a design sheet, existing assets or a mixture of references. Work out which decisions matter, build a small playable scene, then compare it with the source before expanding the game.

Download video
The launch reel follows three examples from references and design sheets into gameplay: Jungle Jetboat Jump, Petal Pals and Jellyworks.

Give the agent something specific to preserve

Lovis's video-to-game helped make the value of a gameplay reference clear: a clip gives the coding agent a starting point for both appearance and behavior. I wanted to extend that approach so different references could define different parts of the game.

An illustration might govern the palette and character proportions. A video might govern acceleration, jump timing or camera movement. A full development sheet can describe objects, UI, levels and character poses that one screenshot never shows.

These sources do not always agree. The workflow asks the agent to assign authority separately for appearance, identity, mechanics, motion and UI. If a painting defines the character but a clip defines movement, the agent should preserve that distinction. Anything absent from the references has to be designed and identified as a new choice.

That makes the reference useful throughout development. It becomes something to check against when a material, camera or interface drifts.

Jungle Jetboat Jump: protect the color and motion

The boat scene has a very direct visual identity: red canyon walls, blue-green water, dense vegetation and a compact orange boat. The game needs to keep that balance while giving the player enough room to steer.

The implementation combines a 3D boat and crew, painted vegetation and procedural water. Ordered gates, pickups, boost, jumps and recovery turn the scene into a racing loop. A reference can suggest speed and danger, but the game still needs rules for what happens when a player misses a gate or leaves the course.

Jungle Jetboat Jump: the reference on the left and the playable implementation on the right. The comparison exposes changes in camera, water and environmental detail.
Jungle Jetboat Jump: the reference on the left and the playable implementation on the right. The comparison exposes changes in camera, water and environmental detail.

The useful question is how the playable camera and moving scene preserve the reference's energy. Exact placement of every leaf is less helpful than keeping the boat readable against the water and the canyon recognizable at speed.

Petal Pals: keep the painting in the game

Petal Pals starts from a softer world: a painted meadow, flower rows, small companions and cream-colored interface panels. Turning every painted element into smooth 3D geometry could make the scene feel like a different game.

This example uses directional painted characters in a 2.5D world, with 3D terrain and foliage arranged to support depth. The interactions follow the setting: observe, feed, photograph, befriend and explore. Save and restore behavior lets that progress persist.

Petal Pals: reference and implementation. Painted characters and the warm interface carry the illustration's identity into a navigable meadow.
Petal Pals: reference and implementation. Painted characters and the warm interface carry the illustration's identity into a navigable meadow.

The representation has a tradeoff. Those painted assets work best from constrained views, and the camera differs from the original painting. That is a useful limitation to make explicit. Full 3D is one option; layered art can be a better fit for the image you want to preserve.

Jellyworks: make the candy factory obey rules

Jellyworks has rounded toy machinery, wooden conveyors, translucent candy and a friendly cream-and-mint interface. The visual reference makes the factory appealing. The implementation has to make it understandable.

Its conveyor routing, ingredient mixing, molds and backpressure form a deterministic puzzle system. Edit and run modes let the player change the layout and then watch the consequences. Three puzzles provide concrete goals rather than an endless decorative conveyor animation.

Jellyworks: the reference beside the game. The factory's visual language is preserved while candy movement follows explicit routing and recipe rules.
Jellyworks: the reference beside the game. The factory's visual language is preserved while candy movement follows explicit routing and recipe rules.

Rule-driven candy spacing differs from the illustration, and translucent materials use an adaptive quality fallback. These are the kinds of differences a comparison should reveal, so a reader can judge whether they matter.

A fourth case, a different kind of world

The repository also includes Sunshine Train Battle, a first-person action example using cleaned generated meshes in a train-local world. Shooting, shielding, reloading, jumping, checkpoints and restart add a different set of interaction and collision requirements.

Sunshine Train Battle: a fourth worked example, included in the repository alongside the three games shown in the launch reel.
Sunshine Train Battle: a fourth worked example, included in the repository alongside the three games shown in the launch reel.

Across the four cases, the implementation changes with the reference. Sprites, procedural geometry, meshes and shaders can all earn a place. The common requirement is that the visual direction survives contact with gameplay.

Looking right and playing well need separate reviews

A running game can still miss its reference. A beautiful screenshot can still hide broken controls. Reference to Game keeps those questions separate.

The workflow starts with a small scene and fixes the largest visual mismatch before multiplying assets or levels. It then asks for real input-driven gameplay, state-driven UI, goals, recovery and restart. Comparison images expose visual differences; rule tests and playthrough evidence address behavior.

The CLI preserves and hashes source references, helps inspect common media, samples chosen palette regions, creates comparison sheets and ties review files to a source snapshot. It can detect stale evidence. It cannot decide whether the art direction is good, and a hash cannot prove that a claimed playthrough happened.

The four games were completed before the reusable skill was packaged. They are worked examples of the approach, not a controlled benchmark showing the skill's effect. The repository's evidence log distinguishes fresh build and rule checks from historical playthrough reports.

Run a game, then try your own reference

The examples include source and runtime assets. To run Petal Pals locally:

git clone https://github.com/gokayfem/reference-to-game.git
cd reference-to-game/examples/petal-pals/app
npm ci
npm run dev

To install the reusable skill:

npx skills add gokayfem/reference-to-game

The default implementation stack is Three.js, TypeScript and Vite. Existing examples run on local assets without a fal key. New asset generation is optional; the toolkit can record fal jobs and their estimated budgets when that is part of the brief. The repository credits distinguish the MIT toolkit code from demonstration artwork and media.

For a new game, begin with references you care about. Decide what each one should control. Build enough to move through the world and feel the rules. Then put the implementation beside the reference and look at what changed.

The more clearly you define the world first, the more useful the coding agent becomes at building the game you had in mind.

Code, all four games and workflow documentation →

GamesCreative EngineeringOpen Source

Enjoyed this article?

Follow me on Twitter for more AI experiments and insights.

Follow @gokayfem

More Articles

View All
Image 2 Sculpt: Turning a Single Image into a Measured 3D Sculpt
01
3D

Image 2 Sculpt: Turning a Single Image into a Measured 3D Sculpt

One image gives you the face, posture and proportions. Image 2 Sculpt builds a sculpt against that evidence, checks the missing views and records the work as a Blender timelapse.

Video 2 Physics: Turning AI Videos into Verified Simulations
02
Physics

Video 2 Physics: Turning AI Videos into Verified Simulations

Four seconds into the clip, a brass pendulum starts swinging wider. By the end, its amplitude has grown by 62%. Nothing is pushing it. The brass, the wood and the lighting are convincing; the motion quietly creates…

Video 2 Blender Nodes: Turning Reference Videos into Editable Node Systems
03
Blender

Video 2 Blender Nodes: Turning Reference Videos into Editable Node Systems

Video 2 GLSL showed that a reference video can become executable mathematics: one shader that plays the same 20 seconds. The next question was what an artist could do with that result. A shader is hard to open, read…

Avatar
gokaygokay

© 2026 All rights reserved.