Dream 2 language
Dream 2 is the text authoring language behind Muse Dream. It compiles object assemblies and complete worlds into validated engine data. Cylinder parts and endpoint beams support bounded taper for continuous trunks, branches and posts; see the wood example. Prism parts add bounded XY outlines for sloped cabins and wheel openings; rolling joints keep axles and crank assemblies rigid. See the complete car and bicycle. Start with the documentation home, or use this complete five-part table as a small composition example.
dream 2;
material wood(style=grain,colors=[#966c48,#b48c60]);
component leg(params=[h]){
part post(shape=box,material=wood,at=[0,h/2,0],size=[4,h,4]);
}
object small_table(label="Small table"){
measure(kind=table,axis=x,meters=2.2);
body(interaction=solid,radius=26,height=28);
foundation(size=[58,38],color=#68765a);
repeat ends(index=i,count=2){
repeat sides(index=j,count=2){
use leg(component=leg,args=[24],at=[i*44-22,0,j*24-12]);
}
}
part top(shape=box,material=wood,at=[0,26,0],size=[58,4,38]);
}The model-facing contract uses named fields, explicit IDs and a bounded set of commands. The reference lists them all. The object guide explains composition and scale, worlds covers layout and modules, and behavior covers interaction and destruction. NPCs and control covers placement ownership and reusable state machines.
For agent authoring, request a task-specific packet with node scripts/dream.mjs context --features objects,voxels. It includes compiler-owned vocabulary and relevant instructions, while all acceptance checks remain in force. Components now accept typed material parameters alongside numeric parameters: reuse geometry with different finishes. Humanoid mount binds accessories to an existing bone, while optional body clearance keeps furnishing space independent of clothing changes. See people and connected parts. These are compatible Dream 2 additions; existing source remains valid.
For a provider integration, use the model instructions, command export and generation/repair guide. The command export is generated from the parser table. The EBNF describes structural syntax; the compiler enforces contexts, references and geometry budgets.
The live world uses voxel_world(object_cell=1,ground_cell=8,height_step=1); to construct all assets and landscape surfaces from voxels. See whole-world construction. Explicit voxel volumes add bounded fill and cut operations, cached greedy surface meshing and optional fracture chunks. Start with the voxel guide and complete wall. Physical contacts remain explicit and separate from occupied cells.
Version policy
Dream 2 fixes existing field meanings, units, scopes and identity paths. Compatible additions require allowlisted fields, bounds, runnable examples, updated docs and regression coverage. Regenerate the command export with node scripts/dream.mjs contract. Changing existing syntax, units or identity semantics requires a new major authoring version. Unknown fields keep failing.
Dream 1 remains supported through the same compiler. See the compatibility guide. Dream source versions, Object DSL versions and Scene versions describe separate contracts. The complete live world is Dream 2; the older TypeScript fixtures remain for regression tests.
Urban districts use bounded street, surface and marking declarations. Explicit walkable surfaces connect park paths to the pedestrian network; site.label names a destination independently of the object template. They link through the same closed module registry as assets and placements. See streets, grounds and paint, the reference bounds and the runnable neighborhood.
Ground populations can use Dream 2 walk and roam motion under explicit ambient ownership. The engine derives walking portals from accepted pavement and executes nearby animal reactions at 20 Hz; full geometry and joint poses stay instanced. Population guide.
Playable markets use one bounded economy() block with good, account, market, lot, work, delivery and repair data. Player controls and NPC policies share conserved transactions, food, reserved wages and timed production. Market guide and runnable world. This is separate from the logical Lab scenario language.
Dream repair services connect category-selected damage, finite market kits/pay and bounded local worker journeys. The live fixture service now reaches all 413 lamps through declared streets and full-body verge joins. kinds shares one policy across several measured categories; delivery price pays a supplier from the receiving business, with goods and money reserved together. Rules and runnable example.
Repair grounds connects declared work areas through the existing pedestrian
network. The engine derives bounded routes, preserves work during streaming and
saves, and rejects unreachable targets. Connected repairs
includes a complete street-and-crossing example.
world(...,damage_pool=true) keeps intact break/topple props instanced and gives
them persistent independent damage with bounded active debris and mesh caches.
The live streetlights and all 345 measured trees use this path. Whole topplers may
keep part sway with matching falling color/shadow motion. Rules and complete repair example.
Tree recovery reuses repair with regrow_s and optional seed_scale. Ordered
account.repairs shares one worker across one to four services. The engine owns
claims, finite inputs/pay, growth and clearance; source remains data-only.
Planting guide · Runnable world.
The live caretaker reaches 106 trees, including every furnished street tree,
through declared work grounds and verges. The wind-tree world
combines the shared policy, voxel foliage and finite replanting.
surface(...,finish=terrain) declares natural work/activity coverage without a
paint mesh or map fill. It omits color and retains cosmetic ground plants;
ordinary painted surfaces keep their existing syntax and require color.
Geometry, furniture reservations and movement bounds still apply.
Grounds.
Multi-input work uses a bounded work block of ingredient(good=...,take=...)
statements. The existing input/take form remains valid. Both compile to the
same conserved production ledger. Recipes and the complete example.
Personal progression uses milestone(kind=work|delivery|repair,task=...,count=...)
inside economy. work.requires checks the worker's own completions; an interact
on.requires recognizes the player's contribution at the receiving market actor.
account.works orders up to four eligible production jobs. These are bounded
conditions, not scripts or authored rewards. Runnable guide.
NPC food trips use meal plus account.meal: choose food, ordered shops, convex
walking grounds and eating time. Customers share finite player transactions and
resume their paused routines after returning. Meal trips.
A staffed business combines existing ordered works, meal
and deliveries rules. The live bakery now prepares food and can fetch flour;
the complete small example works without repairs or ambient walkers.
Static furniture can declare named seat slots with local sitting surfaces,
approaches and facing. Meal customers and the player share occupancy, damage
and restoration rules. Seating contract and runnable world.
market(...,hours=[6,22]) adds daily counter service using the world's daylight
configuration and saved simulation time. Overnight pairs wrap midnight. Player
and NPC trade, work starts and delivery counters share the rule, with safe waits
for committed cargo. Hours and the complete example.
shift plus account.shift connects daily counter hours to physical staff travel,
a rest destination and an early return. Service waits for actual arrival; NPC
programs and remembered meetings continue at rest. Guide and executable example.
social and account.social connect carried food, paired seating, consent and persistent shared meals. Optional social.markets lets known NPCs buy two portions with their own money and offer to host. Interact-only shared_meals branches on actual time spent together. Guide and complete example.
Optional market(...,owner=account_id,sale=15) makes an existing counter ownable.
The base sale price plus available cash is paid to its personal seller once;
stock and commitments stay with the business. Owners can transfer available
capital locally through conserved transactions. Ownership rules and example.