# WorldX

> Type one sentence, get a pixel world whose AI characters live out their own story

- Category: Agents & Automation / Multi-Agent Systems
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/YGYOOO/WorldX
- Canonical page: https://ai-tldr.dev/tools/worldx/

## In short

WorldX turns a single text prompt into a self-running AI world. It sits in the Multi-Agent Systems category of the Agents & Automation tools and is open-source, written in TypeScript and licensed MIT. To get started: clone and configure a preview run.

## Overview

WorldX turns a single text prompt into a self-running AI world. You describe a scene — the project's own example is "a cozy autumn mountain village with a blacksmith, a tavern owner, a wandering monk, and a curious child" — and the system designs the world, generates an original map and character art for it, then runs a simulation in which every character is an autonomous LLM agent. The agents make decisions, interact with the scene, form relationships, hold conversations, remember what happened and reflect on it, so the story that emerges is not scripted by anyone.

You can watch passively or step in as "god": broadcast an event to the whole world, edit a character's persona or memories, or open a sandbox chat with any character to see how they respond. Worlds run across day/night cycles for multiple days, and a timeline system lets the same world branch into separate runs that can be replayed and compared.

Under the hood the work is split across four independently configured model roles. An **Orchestrator** model designs the world structure, characters and rules; an **Image Gen** model draws the map art and character sprites; a **Vision** model reviews map quality and locates regions and interactive elements; and a **Simulation** model drives the characters' runtime behaviour — the README notes any cheap model is fine for that last role. Every role speaks the OpenAI-compatible chat/completions protocol (Image Gen can also use Google AI Studio's native image API), so OpenRouter, Google AI Studio, DeepSeek or a mix of providers can be plugged in through environment variables.

The codebase is a Node.js monorepo: an orchestrator package that turns the sentence into a world, a generators package for the multi-step map pipeline and character sprites, an Express + SQLite simulation server (using Node's built-in `node:sqlite`, with separate storage per timeline) and a Phaser 3 + React 19 game client. The project describes itself as Alpha — core features work and are still being refined.

## What it does

- One-sentence world creation: describe any scenario and WorldX designs the world, its characters and its rules
- AI-generated maps and character art made to match the description rather than assembled from templates
- Autonomous agents with memory and personality that decide, converse, build relationships and evolve across day/night cycles
- God mode: broadcast events, edit character profiles and memories, and run sandbox chats with any character
- Timeline system to branch, replay and compare different simulation runs of the same world
- Four swappable model roles over OpenAI-compatible APIs, plus a Chinese / English interface with one-click switching

## Getting started

WorldX needs Node.js 22.13+ (24 LTS recommended; versions 22.5–22.12 and 23.0–23.3 are not supported because `node:sqlite` was still behind a flag there) and API keys for the model roles you use. Two pre-built worlds ship with the repo, so you can try it with only a Simulation model key.

1. Clone and configure a preview run

   For preview mode, fill in only the three SIMULATION_* variables in .env, then install and start the dev server.

```bash
git clone https://github.com/YGYOOO/WorldX.git
cd WorldX
cp .env.example .env
# Edit .env — fill in SIMULATION_* fields only
npm install
npm run dev
```

2. Set the model roles

   Each role (ORCHESTRATOR_, IMAGE_GEN_, VISION_, SIMULATION_) takes a base URL, an API key and a model id. IMAGE_GEN_PROVIDER can be openai-compatible (the default, for OpenRouter) or google-native (for Google AI Studio image generation). Creating new worlds needs all four roles filled in.

```text
{ROLE}_BASE_URL=https://openrouter.ai/api/v1    # API base URL
{ROLE}_API_KEY=sk-or-v1-xxxx                     # API key
{ROLE}_MODEL=google/gemini-3.1-pro-preview       # Model identifier
```

3. Play a world or create your own

   Open http://localhost:3200 to pick a pre-built world and press Play. With all four roles configured, open http://localhost:3200/create, type a sentence and watch the world being built. The dev command starts both the client (port 3200) and the server (port 3100).

4. Create a world from the command line

   The same pipeline is available as a CLI command.

```bash
npm run create -- "A cyberpunk noodle shop where hackers and androids share rumors"
```

## When to use it

- Reach for it when you want to watch emergent behaviour between LLM agents in a visual, game-like setting instead of reading raw logs
- Reach for it to prototype interactive-fiction or game-narrative ideas from a one-line premise, then steer them with injected events
- Reach for it to experiment with agent memory, reflection and persona editing, replaying a world on separate timelines to compare outcomes
- Reach for it to compare how different LLM providers drive the same characters by swapping the Simulation model
