Skip to main content
EdenLive turns a simple game into a generated world, live. It accepts source video in two ways:
  • Built-in games. EdenLive runs one of seven games for you. Your app steers it with keys and mouse look.
  • Your own game. Your app renders a game in the browser and streams it as video. EdenLive generates the world from it, and your app keeps the controls, physics, and rules.
Part 1 plays a built-in game. Part 2 makes a game of your own and streams it in.
An EdenLive example app playing a built-in game

An EdenLive example app: the generated world, with the draft it was made from in the corner.

Installation and setup

Install the published typed SDK in your browser app. The snippets below build on one connected EdenLiveModel instance; provide your own video elements, token route, and game renderer. The screenshots show an example app whose starter template is not yet publicly available. You can implement the same integration with the SDK; there is no EdenLive create-reactor-app template to scaffold yet.

How EdenLive works

EdenLive reads a draft video: a built-in game, or your own. A reference image and a text prompt set how the world looks. The model sends two video tracks back: After every command and every generated chunk, the model sends a state_update message with the whole session state. Until you start a world, both tracks show the staged reference image.

Authentication

Issue a session token on your server. The browser’s getToken() helper calls that server route. Do not put an rk_ API key in browser code. See Authentication for the token exchange and limits.

Part 1: Play a built-in game

1. Connect and show the tracks

Connect, then show main_video large and draft_video small. Give both <video> elements the muted, autoplay, and playsinline attributes.
Wait for the SDK’s ready status before sending commands.

2. Choose a game

EdenLive ships seven games. Each has its own goal and controls:
game-freeze

Cryo Crossing

freeze. Freeze a path of stones across a volcanic cavern.
game-spiders

Spider Hollow

spiders. Clear a torch-lit cave of spiders with an axe.
game-tracer

Pulse Skirmish

tracer. A dual-pistol fight against robots in a sunlit street.
game-bioshock

Deepwater Shock

bioshock. A wrench and electric bolts in a flooded machine room.
game-godzilla

Kaiju Rampage

godzilla. A giant monster against the towers of a miniature city.
game-arcadeduel

Arcade Duel

arcadeduel. Two fighters, one arena, one round.
game-dust2

Desert Crossfire

dust2. Rifle combat through a desert courtyard.
select_game stages the game’s cover as the reference image and its prompt as the scene prompt:
The reply arrives once the game is loaded, about two seconds later. Until you start, both video tracks show the cover.

3. Start the world

The first frames arrive on main_video and draft_video shortly after. start always makes a new world. Calling it again replaces the current one.
The example app running Cryo Crossing

The example app running Cryo Crossing: the game picker, the generated world with its draft, the prompt, the controls, and the game status.

4. Steer with keys and mouse look

Send the full set of held keys each time it changes. A key tapped and released between two frames can be missed, so hold keys long enough to see the effect.
set_look holds a turn and tilt rate, each from -1 to 1, until you replace it. Send 0, 0 when the mouse stops. Keep one setLook call in flight at a time and send the latest value next.
Keyboard and mouse-look controls in the example app

The example app's controls light up the keys you hold. Click the world to look with the mouse.

5. Show the game’s status

Each state_update carries the game’s own status: its state, the player’s health, what just happened, and the result card when the game ends. Add an element with id="status" to your page and provide a showResult(outcome) function to display the result card.
events repeats in every state_update until the next chunk, so add it to a log once for each new chunks value. When the game ends, the world pauses. Call start for a new world.
The game status panel with the latest events

Game status: the game's state and what happened in each chunk.

6. Change the look, pause, and restart

Change the prompt at any time. The world keeps its history, so the look changes over a few seconds:
Pause and resume the same world with setPaused. To change the game or the reference image, pause first, because both end the world. Then call start again.

Part 2: Stream your own game

Build any small 3D game in the browser, draw it to a canvas, and stream that canvas to EdenLive. The game can be plain: colored boxes, simple trees, and a capsule for the player. EdenLive draws the detail from your reference image and prompt.
A capsule on a grid next to a watercolor traveler on a stone terrace

A draft made of simple shapes (left) and the appearance reference for it (right).

For help designing a playable draft, see the upstream game-prototype-turbo skill. It covers game design and rendering; use the SDK integration below to stream your game to Reactor.

1. Draft a game that reads well

  • Keep shapes simple and distinct. Give each object a clear silhouette and its own color. The model supplies the materials and lighting.
  • Make one complete round. A clear goal, a way to win, a way to lose, and a restart.
  • Use a steady camera. Smooth third-person or first-person movement works best.
  • Render at 1280 × 704. EdenLive scales source frames to fill this size and crops the center. A canvas with the same dimensions preserves your framing.
  • Keep text out of the canvas. Draw the score, health, and menus in your page, over the video.
A primitive courtyard next to a watercolor courtyard

A walled courtyard drafted from primitives, and the watercolor look it becomes.

2. Stream the canvas

Publish the canvas as source_video and switch the source to client. Keep the frame rate steady, between 10 and 60 fps. EdenLive plays the generated video at the rate you send. Run steps 2–4 in order in one async setup flow, and stop if a command is refused. If you are continuing from Part 1, disable its controls and drain the last mouse-look command before switching sources. Pause before replacing the reference; otherwise setImage is refused and the old reference remains staged.

3. Set the look

Capture your game’s opening frame, restyle it in an image tool, and upload the result as the reference. Keep the camera angle and object positions of the frame. Then describe the scene in the prompt.
The prompt guide covers references and prompts in depth.

4. Start and play

Your game keeps its own input, physics, and rules. EdenLive only sees the frames, so do not call setKeys or setLook in this mode. When your game pauses, call setPaused too, so the world pauses with it.
A generated woodland camp streamed from a local game

Your own game in the example app: the generated world, with your game's canvas in the corner.

Handle refusals

When EdenLive refuses a command, the call resolves undefined and only your client is told. The error event carries the model’s code, such as pause_required:
The schema lists every command, field, and code. The game thumbnails on this page are the games’ opening frames from the EdenLive project (Apache 2.0).