Documentation

A user's-eye guide to building a game with ForgeaX. Click any item to expand the details.

1Before you start

What ForgeaX is and what games it makes

ForgeaX is an AI-native game development studio. You describe the game in plain language; an AI lead called Forge plans it, designs it, and writes it into running game code itself, hot-reloading the result into your browser — what you say is what you play.

Two in-house foundations sit underneath: an engine redesigned for the AI's point of view (see Why an AI-native engine) and a development loop that converges features on a correct result (see How AI gets a feature right).

It suits 2D / 2.5D / 3D web games. Playable FPS, Diablo-style ARPG, two-level survival and shooter demos already exist (see the showcase); the engine covers PBR / IBL / SSAO rendering, 2D/3D physics, skeletal animation and dual RHI (see "Engine capabilities" at the bottom of the showcase).

Everything runs in the browser (WebGPU), web and desktop on one stack; open source under Apache License 2.0 (see the license).

Install & launch

Prerequisites: git, bun ≥ 1.3, node ≥ 22, curl. (On a clean host, bun fx setup can also bootstrap bun / node 22+ / pnpm / the Rust+wasm toolchain — zero-prompt by default; --interactive asks per tool, --skip-bootstrap skips it.)

git clone --recurse-submodules \
  https://github.com/ForgeaX-Games/forgeax-studio.git
cd forgeax-studio
bun fx setup          # one-time setup
bun fx start          # → http://localhost:18920

What bun fx setup does: verifies prereqs → inits submodules → builds the engine packages → runs bun install in each sub-repo → builds the marketplace plugins → scaffolds $ROOT/.env from .env.example. With --interactive it also prompts for ANTHROPIC_API_KEY; otherwise it warns and you edit .env later.

bun fx start boots three services: server (:18900, the runtime core — chat / backends / sessions), interface (:18920, the Studio UI with vite HMR), and engine (:15173, the renderer). Override ports in .env via FORGEAX_{SERVER,INTERFACE,ENGINE}_PORT. Then open http://localhost:18920.

Everyday commands (one entry, bun fx): run bun fx setup once to prepare the environment; later pull updates with bun fx update (updates the root repo + syncs submodules, no reinstall / rebuild); bun fx start / bun fx start app launch web / desktop; bun fx stop and bun fx restart stop / restart; bun fx status and bun fx doctor diagnose your setup; bun fx build app packages the desktop app. Run bun fx with no arguments to list every command.

Desktop app: bun fx start app opens a native window on the live source (first run auto-installs and starts the stack; closing it stops the stack); bun fx build app packages a self-contained .app / .dmg. See Run & preview for all modes.

Platform support (macOS / Linux / Windows, first-class): install and launch are one set of cross-platform Bun scripts, so all three systems run the same bun fx commands with identical behavior — and Windows no longer needs Git-Bash (the old dual .sh / .bat / .ps1 scripts were deleted). Specifically: web dev (bun fx start) and desktop dev (bun fx start app, a native Tauri window on live source) work on macOS / Linux / Windows; packaging a game into a double-clickable .app / .dmg (bun fx build app) is currently done on macOS. Common Windows-specific issues (black preview, a console window per turn, processes not closing cleanly, the system's stub Python) are all fixed — see Changelog · 2026-06-28.

Prefer not to do it by hand? Let your AI coding CLI clone & launch it — see Have your AI CLI clone & launch it; then build your first game with Quick start. For API keys, see Advanced · Switch / configure the AI backend.

Open the studio, learn the interface

The interface is three parts: a top bar, the chat on the left, and the preview/workbench on the right.

  • Top bar — the new menu, a project switcher (move between games — what a "project" is is covered in Core concepts), and a session switcher (review / switch past conversations).
  • Left · chat (ChatPanel) — a team rail (Forge and the sub-agents), a message stream (sub-agent cards, Forge's thinking and tool calls), and a composer at the bottom with a backend switch at its bottom-right (see Advanced).
  • Right · main area (MainArea) — toggles between the preview (your game live in an iframe) and the workbench (file editing / design docs); see Scenes & editor.

The top-right cog opens Settings: API keys, model choice, CLI backend, and plugin management. The desktop app also shows a first-run overlay that prompts for the key the first time you open it.

2Core concepts

A "project" is a game

In ForgeaX, "project" and "game" are the same thing — a game is one games/<slug>/ folder. A real game folder usually looks like this:

  • forge.json — the game manifest. Minimally three fields: id, name, and entry (pointing at the entry code, e.g. src/main.ts).
  • FORGE.md — the game's own readme / gameplay overview (controls, mechanics, story beats).
  • src/ — the game code. Besides the main.ts entry, it's usually split into modules by concern (e.g. player.ts, enemies/, effects.ts, setup.ts).
  • design/ · assets/ — design documents and art / audio assets.
  • package.json · tsconfig.json — standard TS project files.

The main.ts entry imports engine capabilities from @forgeax/engine-runtime / engine-ecs / engine-app and exports a GameEntry — the contract by which the engine loads a game. For the full capability set, see "Engine capabilities" on the showcase.

Multiple games = multiple projects, switched in the top-bar project switcher. For how scenes / levels are organized, see Scenes & editor.

Forge and its team of sub-agents

Forge (the main agent) is the only one that writes game code directly — it writes games/<slug>/src/main.ts, the preview hot-reloads, and it sees the running result to decide the next step. That edit → see → edit loop has to stay with whoever can see the preview, i.e. Forge (see Build by chatting).

Sub-agents (e.g. Iori gameplay, Suzu design, Kotone narrative, Iro art, Tsumugi build) only plan / design / make assets / write docs and never touch src/ — they have no live-preview feedback, so any code they wrote would have nothing to steer it. See the full cast in the marketplace and Chapter 10 · The agent team.

How dispatch works: Forge dispatches a sub-agent with one tool call (shaped like subagent(type="iori", task="…")); the server's /api/subagent stream bridges its output back into the main conversation in real time — that's the embedded sub-agent card you see in the message stream. A sub-agent's design docs are filed under its own section in the workbench (see Scenes & editor).

What a session is

A session is an agent's memory — an append-only stream of events (each one is a user message / assistant message / thinking / tool call / tool result). Forge (main) and each sub-agent each keep their own.

The UI splits events by who emitted them into the main thread vs sub-agents, rendering each sub-agent's slice as an embedded card. So on one screen you see both Forge's main thread and what the sub-agents it dispatched actually did.

Use the top-bar session switcher to review and switch past sessions. Switching a session restarts nothing — the UI just reads a different agent's event stream.

3Build by chatting

How to describe your idea clearly

The more specific you are, the better Forge nails it first try with fewer redos. A good prompt usually covers:

  • Genre & view — top-down / first-person / 2.5D side-scroller…
  • Core loop — the one thing the player keeps doing
  • Controls, win/lose, enemies / obstacles, and the feel

Start small, get it running, then layer mechanics on. For example:

A top-down game: a character runs around an arena,
space fires bullets, enemies keep spawning,
hits remove them and add score.

For a step-by-step first game, see Quick start; for what's achievable, browse the showcase. For heavier design, Forge pulls in design sub-agents (see Core concepts).

Watch Forge plan, code, and run it

Once you send a request, the chain is:

  • Understand + plan — Forge clarifies the requirement, dispatching design / gameplay sub-agents for heavier work (see Core concepts).
  • Write code — Forge writes itself into games/<slug>/src/main.ts (and its split-out modules).
  • Hot-reload — on save, the engine's vite detects the change and the preview hot-replaces the module in place — no full reload, the picture updates almost instantly.
  • See the result — Forge sees the running result through the preview (which also forwards the game's console back), and decides the next step.

The whole process is transparent: the message stream shows Forge's thinking, each tool call, and the cards of the sub-agents it dispatched. For switching/controlling preview vs workbench, see Scenes & editor; for how hot-reload works, see Run & preview.

Iterate: add mechanics, tune the feel

Not happy? Keep talking — each bit of feedback becomes another change, visible instantly via hot-reload:

Faster bullets, double enemy health, night background.

The preview has play / pause / reload controls for testing as you go; to pin the preview to a specific game, switch in the project switcher (see Open the studio, learn the interface).

The basic loop is describe → generate → play → describe again. Run it smoothly and you go from a sentence to a playable game — the full onboarding is in Quick start.

4Scenes & editor

Preview window & workbench

The right-hand main area toggles between two views:

  • Preview — your game runs live in an iframe, with an FPS readout and play / pause / reload controls. When Forge writes code, it hot-reloads here instantly (see Build by chatting).
  • Workbench — a file browser + editor: view / edit / save text & code, render markdown design docs, and preview images, audio, video and 3D models. It also surfaces file activity and "who's editing" locks, so you and the AI edit the same files without clobbering.

With no file open, the workbench shows entries for every creation workbench (character / animation / 3D / scene / UI / music…) — see Creation tools and the marketplace. For making assets, see Assets.

Edit the scene, changes flow back live

The scene editor saves a level's contents to a scene data file in the game folder (scene.pack.json) — the single source of truth for that level: what's on disk is what runs in the game.

When you place objects and leave edit mode, the changes are flushed to disk and the running game re-reads them, so the preview reflects your edits immediately — the edit→play round-trip. Conversely, when Forge changes code by chat it rides the same hot-reload path (see Build by chatting and Run & preview).

Organize your levels and objects

A game can have multiple scenes / levels, each its own scene data, switched and reused as needed — the "Cow Survivor" demo switches between a day pasture and a night graveyard (see the showcase).

How to organize: objects live in the scene data, while art / audio assets live in the game folder (project layout in Core concepts, asset generation in Assets). Splitting by scene keeps a growing game maintainable.

5Assets: art / animation / audio

Character portraits & turnarounds

Use the character editor (wb-character) for character concept design: write a one-line brief, get a portrait + turnaround. No drawing skills needed to get a game-ready character.

Its outputs (a character manifest + portrait / turnaround) are stored per character inside your game and feed straight into the animation workbench as downstream input — so "design the character → make it move" is one continuous pipeline (see the next item).

Each workbench is a panel plus a set of tools; you-by-hand and AI-by-dispatch edit the same artifact. Full list in the marketplace and the workbenches tutorial.

Make characters move (2D / 3D)

2D: the animation workbench (wb-anim) uses the character portrait as a template and turns it into walking, attacking, four-direction motion, even short clips — without face drift, so it stays the same character once it moves.

3D: the engine natively supports skeletal animation — import a rigged, skinned model plus animation clips from FBX, with smooth crossfades between idle / walk / run / cast / death. This pipeline is real and shipped — it's how the dark-fantasy witch in the showcase moves: see the skeletal-animation milestone and the showcase (Hellforge).

3D models, VFX, UI, music

Beyond characters, there are workbenches across the whole pipeline:

3D models

Blocky-character editor (wb-lowpoly-obj, exports engine-neutral .glb), node-graph low-poly (wb-3d-lowpoly), and text / image / multi-view-to-3D (wb-gen3d, provider-agnostic). Detailed in Chapter 9 · 3D modeling & generation.

VFX / scenes / UI / items

Skill VFX (wb-skill), scene generation and 2D scene assets (wb-scene-generator / wb-2d-scene-asset-generator), the UI workshop (wb-ui, clickable prototypes), and item icons (wb-items, art + data in one table). Detailed in Chapter 9 · Scenes / UI / items.

Music / look / narrative

Music and SFX (wb-bgm, a BGM timeline), color grading (wb-look, palette + LUT + postprocess), and narrative (wb-narrative, 117 genres × 9 templates). Detailed in Chapter 9 · Narrative / music / look / balance.

Item-by-item coverage is in Chapter 9 · Creation tools, the workbenches tutorial, and the marketplace.

6Run & preview

Run it right here (live example)

An actual ForgeaX engine example running live on this page (WebGPU — Chrome / Edge recommended). More runnable demos in Examples and Games.

Open full screen ↗

Web and desktop app modes

The same codebase runs in three forms:

  • Web devbun fx start boots three services (server / UI / engine); open http://localhost:18920 in a browser, edits hot-reload live. Works on macOS / Linux / Windows. Install in Before you start.
  • Desktop devbun fx start app opens a native window loading the same dev server, with identical live source and HMR; first run auto-installs and starts the stack, closing the window stops it. Available on macOS / Linux / Windows.
  • Desktop .app (packaged)bun fx build app produces a self-contained .app / .dmg that runs on double-click with its own sidecar (ports 18810 / 15273, deliberately offset from dev's 18900 / 15173 so both can coexist); its key lives in ~/ForgeaxProjects/.env, with a first-run overlay. Packaging is in Publish & share.

All three ports are overridable in .env via FORGEAX_{SERVER,INTERFACE,ENGINE}_PORT. ⚠️ The desktop window uses the system WebView, so 3D runs on WebKit's WebGPU — a bit weaker than Chrome's. For the best visuals, use the browser.

Hot-reload: see it as you change it

Save and it takes effect — no manual refresh:

  • Edit game code (games/<slug>/src/…) → the engine hot-swaps the module in place and the preview updates instantly (Forge's edits ride this too — see Build by chatting).
  • Changes in the scene editor flush to disk and flow back into the running game (see Scenes & editor).
Common troubleshooting
  • Blank preview / engine error — the engine isn't built; re-run bun fx setup.
  • SSL error on :18920 — access via http://localhost (WebGPU still works on localhost).
  • Port in use — a busy port errors out (it won't auto-pick another); run bun fx stop then bun fx start, or change ports in .env.
  • Chat says no API key — set ANTHROPIC_API_KEY in .env (the desktop app prompts on first run); key setup is in Advanced.
  • 3D looks weaker on desktop — a limitation of the system WebView's WebGPU; use the Chrome browser build for best rendering.

7Publish & share

Package as a desktop app

bun fx build app packages the whole studio together with your game into a self-contained desktop bundle (macOS .app / .dmg): a trimmed runtime, the server, the Studio UI, the marketplace and your game content are all inside, so it runs on double-click with zero setup for the user.

It runs on a built-in sidecar at its own ports (18810 / 15273), so it never collides with your dev stack (see Run & preview). Packaging must run on macOS; the packaged .app opens on double-click.

Share your game project

A game is one self-contained games/<slug>/ folder (forge.json + src/ + design docs + assets, see Core concepts). Share or commit that folder and someone else opens it in their studio to keep playing or building — the demo library stores several games side by side (fps, hellforge, cow-survivor, shoot-opt), see the showcase.

For now the most reliable way to hand a game to players is the desktop package above; a smoother "one-click web publish / play online" is still in the works.

8Advanced

Switch / configure the AI backend

Switch backends (swap the chip): pick the kernel from the backend switch at the composer's bottom-right, or under the CLI section of Settings — Claude Code / Codex / Cursor / Kimi Code / CodeBuddy / DeepSeek Harness / forgeax-cli. The CLI section shows each backend's health and a Test button. Switching a backend also swaps its default persona (see The agent team); details per backend in the marketplace.

Keys / models: set your model API key (e.g. ANTHROPIC_API_KEY) under Settings → Keys — it applies live, no restart (you can also edit .env directly); choose the model under Settings → Models. Missing-key troubleshooting is in Run & preview.

Write your own workbench plugin

Almost every capability in ForgeaX is a runtime-loaded plugin (overview in the marketplace), so you can add your own.

The quickest path today: copy an existing workbench plugin and adapt it, with the plugin author (wb-plugin-author) helping; a fuller in-app visual editor (file tree + code editor, save → auto-reload) is on the way. Once built, enable and reorder it in the admin panel — plugins are mounted by the CLI at runtime. See the kinds of workbench in Creation tools.

Customize agent personas

Use the persona editor (wb-agent-persona): pick an agent from the list, edit its persona in a text area, and save → hot-reload, no restart. You can give an agent a different character or voice without touching any code.

For who's the main vs sub-agents and where default personas come from, see Core concepts and The agent team; the full cast is in the marketplace.

9Creation tools (workbenches)

Character / animation / VFX
wb-character · character editor

Character concept design: a one-line brief → portrait + turnaround. It has several pipelines — turnaround (three views), video character (turnaround → AI video motion → frame extraction → spritesheet export), and monster generation (8-direction × 5-animation monster sprites). No drawing skills needed; the output then feeds the animation workbench (see Assets).

wb-anim · animation

Uses a character portrait as a template and makes it move: four-direction pixel, vehicle animation, monster sprites, Spine binding, short-video generationwithout face drift, so it stays the same character. Embedded panel with a center viewport. 3D characters use the engine's native skeletal pipeline — see the skeletal-animation milestone and Assets.

wb-skill · skill / VFX

Skill-tree editing + VFX preview, listing your skill and effect outputs in one place. The key idea: the player's clicks and AI dispatch share one skill spec — effects auto-attach to "the moment of cast", no manual alignment.

3D modeling & generation
wb-lowpoly-obj · blocky-character editor

Build rigged blocky 3D characters: either "vibe" it (say a line, AI generates) or edit by hand (Blender-style gizmo), with a built-in playground for live preview. Exports engine-neutral .glb usable in any engine.

wb-3d-lowpoly · low-poly generator

Build 3D props / mechanical assets with node-programming ("wire up blocks"): model the process as a node graph, change one parameter, regenerate the whole set. Great for batch, reusable, parametric hard-surface assets.

wb-gen3d · 3D generation

A 3D asset generation entrypoint: pick a generation service and give an input (text / image / multi-view), and get a durable, game-ready 3D asset manifest. Plugged into several top generators so you pick whichever's best — no single-vendor lock-in.

Scenes / UI / items
wb-scene-generator · scene generator

Assemble a whole game scene with node-programming: lay out composition, placement and texturing as a graph; re-run anytime to regenerate the full scene. For how scenes / levels are organized, see Scenes & editor.

wb-2d-scene-asset-generator · 2D scene assets

Also node-programming, for batch-generating the small things in a scene — props, textures, decorations, UI bits — then auto-named and filed so assets don't turn into a mess.

wb-ui · UI workshop

Generate a full interface set by genre, screen flow and visual style — UI blueprints, component assets, and clickable interactive prototypes (not just images). Menus, buttons and health bars in one go.

wb-items · items / icons

Make the game's items and icons — pixel art for weapons, potions, coins — with their data attached. Art and data in one table (items.json) that you and the AI edit together, so they never drift apart.

Narrative / music / look / balance
wb-narrative · narrative workshop

An AI-driven narrative pipeline: from a spark to a full story and world. It covers 117 genres × 9 pipeline templates with tier/mode routing and a dynamic planner — the AI picks the fitting approach and steps for your genre.

wb-bgm · music / BGM

Manage the game's music and sound effects: a BGM timeline laying out what plays when across a session, plus sound-effect naming conventions — the whole score sequenced as one list.

wb-look · color / look-dev

Unify the whole game's color mood — palette + LUT + a postprocess stack, like a filter over the entire game: warm dusk, cold night, switched in one click so the visual feel snaps into one.

wb-balance · balance

Auto-test whether the numbers are balanced: it drives battle re-simulation (balance-resim) over N trials and dashboards win rate + a 95% confidence interval, then loops with manual tweaks — let data judge the tuning. That re-simulation is also a Tool in the marketplace.

System & author tools
wb-code · code

Browse and jump through src/ files right in the workbench, collaborating with the coding agent across chat threads — you read where, the AI edits where, on one project without dropping the baton.

wb-observatory · observatory

Like a black box: live + offline replay of every agent / sub-agent turn, tool call, and slices of the system prompt. When something breaks you can pinpoint which step or which prompt caused it, and it helps manage context / skills / guardrails / cache. The session & replay concept is in Core concepts.

wb-agent-persona · persona editor

Pick an agent from a list, edit its persona in a text area, and save → hot-reload, no restart. Give an agent a new character or voice without touching code. The cast is in The agent team; the how-to is in Advanced.

wb-plugin-author · plugin author

Lets non-coders build their own workbench plugins. The path today is "copy an existing one + adapt + record actions"; a fuller in-app visual editor (file tree + code editor, save → auto-reload) is on the way. The overall how-to is in Advanced · Write your own plugin.

admin · control panel

The studio's master console, in four sections: enable / reorder workbenches, bind models, check each AI backend's auth and health, and see plugin counts. Kept in sync with the Settings panel — every plugin and model status on one screen.

All of these are loadable plugins; the full, filterable catalog is in the marketplace, and a tutorial walkthrough is in the workbenches tutorial.

10The agent team

Production & architecture

Arin · producer — an all-round producer who coordinates design / code / art / audio and owns the whole game.

Reia · reel director — interactive FMV director who forges prompts, paces QTEs and weaves branches and endings, driving the wb-reel Reel Studio to turn one idea into a clickable, playable suspense film.

These are named agents dispatched on demand by Forge (the main vs sub-agent relationship is in Core concepts); the full cast is in the marketplace.

Four design pillars
Iori · 核心玩法师 — gameplay pillar

Named after "庵" (a mountain rock). When Forge dispatches him, he guards the game's "roots" — setting a few load-bearing gameplay pillars (mechanics + numeric skeleton) that shouldn't be casually shaken, captured in one concise pillar doc. He doesn't write architecture, tune parameters, or ask questions back (Forge handled those up front). Once pillared, Suzu takes over.

Suzu · 体验设计师 — pacing & experience

Named after "鈴" (a wind-chime — rhythm). After Iori sets the pillars, Suzu expands each pillar's modules into concrete experience — player pacing, HUD, onboarding. She defines how it feels to play, then hands the parts needing assets / story to Iro / Kotone.

Kotone · 剧情师 — narrative (on demand)

Named after "琴音" (a story carried on strings). Not every game needs a narrative designer — a tower-defense might never call her; only when the game needs characters / dialogue / branches / narration does Forge bring her in to produce world, character bios and lines.

Iro · 美术师 — visual assets (on demand)

Named after "色" (everything the eye perceives). Once Suzu has framed a module's experience, Forge dispatches Iro only if it needs visual assets (characters / scenes / UI / VFX). How those assets are actually made: see Assets and Creation tools.

These specialists only plan and design — they never touch game code (Forge writes code, see Core concepts); their output lands in the workbench (see Scenes & editor), and art assets are produced as in Assets.

Coding & review crew
cc-coder · 通用编码 — spec → code

Takes Iori's gameplay pillars, Suzu's UX flows and Kotone's narrative outlines and turns them into runnable TS / React etc.; can run multiple instances on different packages in parallel. Note: the game's main code is still written by Forge itself, closed-loop with the preview (see Core concepts); cc-coder is more for general / surrounding code.

Tsumugi · 工程师 — build / toolchain

Named after "紡" (weaving threads into a system). Once Iori / Suzu / Iro have the design and assets ready, Tsumugi weaves them into a working build — build, toolchain, deployment.

Yevi · 审查 — tech-debt hunter

A gracefully composed observer, calm as deep water, always one step ahead — she knows where the code is weakest and which three-week-old issue is about to surface. A measured, gentle tone, with precise and incisive wording.

Companion personas — same skill, different character

A set of optional characters with comparable coding skill but distinct personalities — some measured, some playful, some meticulous. They have the same ability; the only difference is how it feels to work alongside them. Personalities are editable any time in the persona editor (see Advanced); the full cast is in the marketplace.

There's also a set of art / asset specialist agents (2D character / animation, 3D low-poly / VFX, interactive-film director, and more), each wired to its matching creation workbench (see Creation tools).

Swappable default personas

Each CLI backend ships with an out-of-the-box persona: Claude (Claude Code), Codex, Cursor, and ForgeaX (the self-built forgeax-cli). Switching the backend swaps the default persona — no setup needed; whichever kernel you pick comes with its default persona.

How to switch backends and edit personas is in Advanced; the full agent cast and loadable personas are in the marketplace.