Dream 2

Dream describes a world the engine can build and run. An object is an assembly of parts with a separate physical body. A world places those objects, shapes the terrain and declares its roads, water and routes.

The source is text. It compiles into validated data for the engine. Dream 2 is designed around a small, regular vocabulary that a model can generate and repair.

The source of a tree beside its rendered result

Start here What you'll build or learn
Runnable examples Bouncing ball, breakable bench, hinged sign and toppling tree
Quickstart Compile a complete object, then a playable world
Compose objects Parts, materials, components, joints and physical size
People and clothing Shared anatomy, attached accessories, distinct outfits and stable physical size
Build with voxels Fill, carve, merge faces and break volumes into bounded chunks
A whole voxel world Construct the terrain, city, vehicles, plants and water from cells
City design Research, connected destinations and the source-derived map
Asset library The mock-world assemblies and their construction details
Enterable buildings Supported ground floors, real doorways, cutaway views and connected work
Connected paths Walkable park loops, named destinations and usable shared furniture
Build a world Terrain, roads, bridges, water, dedicated paths and moving vehicles
Populate streets and habitats Connected lighting, planting, destination parking, birds and transit
Day and night A shared clock, changing sunlight, window glow and street lighting
Shared meals Invite an off-duty person or accept their meal, share paid food and build remembered history
Shared seating Sit on furniture, share seats with customers and preserve occupancy
Staff shifts Physical attendance, connected rest destinations and persistent journeys
Opening hours Daily counter service, overnight suppliers and saved courier waits
Business ownership Buy the depot, transfer capital and retain its real stock and contracts
Contextual actions Icons for nearby activities; focused Shop, Work, Bag and Business views
A working market and deliveries Buy food, eat, sell, work for wages and share stock with NPCs
Planting and growth Replant fallen trees with finite saplings, paid work and persistent physical growth
NPCs and control Explicit ownership, reusable state machines, proximity and timed routines
Prompt and run scenarios Shared resources, agents, budgets, service capacity, tasks and replayable episodes
World systems roadmap Economics, ecology, education, healthcare operations and agent evaluation
Give things behavior Walking, vehicle controls, contacts, doors and destruction
Share interaction rules One table or bench rule across every matching model
Generate with a model Context, validation, repair and atomic acceptance
Language reference Every command, field, budget and compiler API

Read the highlighted documentation · Media and syntax highlighting

Rendering and performance explains how static districts load and unload, and how changes are measured without lowering visual quality. Saving and returning covers local progress, downloadable backups and compatible world updates.

Six-a-side football and basketball covers dribbling, charged shots, passes, tackles, keepers, home/away scores, camera framing and the Dream connections behind each ground.

Try it locally

From the repository root, after npm ci:

sh
node scripts/dream.mjs check docs/examples/toppling-tree.dream
node scripts/dream.mjs compile docs/examples/breakable-bench.dream
npm run dev

The game runs locally at http://127.0.0.1:5173/. The inspection tools below require that development server; their paths are copyable instructions. The public previews work without installing anything.

Tool Local path Public preview
Complete asset gallery /tests/visual/dream.html?all Full asset atlas
Shared-scale lineup /tests/visual/proportions.html Proportion lineup
Vehicle control review /tests/visual/vehicles.html Vehicle switching video
Aircraft and flight /?test-vehicle=cloudhopper Flight video, Dream source
Aircraft on a hillside /?test-movement=plane-hill Native controls on the eastern heath; contact checks
Covered market interior /?test-movement=interior Walkthrough, night view, Dream source
Regional airport /?test-driving=airport Terminal, hangar and approach; board buses with F
Eastbank medical center /?test-driving=medical Medical center and bus stop
Available scooters /?test-vehicle=airport_scooter or /?test-vehicle=medical_scooter Walk up, press F, then drive and jump
Destruction replay /tests/visual/destruction.html Destruction video

The local gallery has four viewing angles and fixed animation phases for checking connections. These inspection pages aren't part of the production build.

What's implemented

The entire playable mock is Dream 2 source, including its player, terrain, street network and placed objects. Supported behaviors run in the engine's tested simulation. The separate Dream Lab now exercises prompt → proposed Dream → validated logical scenario → mock agents → local episode records. Its interpreter is a bounded town template, and its agent travel is a logical graph. It does not yet change or control the playable city. Real prompt/sketch interpretation, photo capture and the rescan workflow remain unconnected.

Contract and compatibility

The model prompt, command export and grammar accompany these guides. The export comes from the compiler's command table and is authoritative for required fields and contexts.

Dream 1 remains readable. Its syntax, Object DSL v2 and landscape data document compatibility and compiled engine formats. Dream 2, Object DSL v2 and Scene v1 are separate versions, not interchangeable names.

Explore the planned town, suburbs, lake and sports park. The whole mock world is authored in Dream 2, including streets, ground surfaces, markings and people.

Asset construction explains the live house, bus and launch sources and the checks that keep their parts connected.