CREATOR PLATFORM · v0.9Read as Markdown ↗

World packages

A world package describes one region of the shared world. It places asset packages and extends shared resources. It does not create a renderer or clock.

TypeScript composition

import { defineRegion } from '@threetopia/world';
import boat from '@dgreenheck/tidewater-boat';

export default defineRegion({
  id: 'tidewater-coast',
  bounds: [-200, -200, 200, 200],
  requires: ['water.surface@2'],
  entities: [
    { id: 'fishing-boat', asset: boat, position: [40, 0, -30] }
  ],
  resources: [{
    id: 'world:north-sea',
    capability: 'water.surface@2',
    bounds: [-200, -200, 200, 0],
    extend: true,
    parameters: { level: 0 }
  }]
});

This example extends an existing sea resource. Its owner and neighboring regions must use the same parameters. Tidewater 0.3.0 has reviewed shared-world adapters; read its complete region example.

Declare the imported asset's exact version in manifest.dependencies. The compiler resolves its default import to that exact package reference.

Authoring rules

Use defineRegion, defineAsset, defineSystem, or defineWorldPolicy from @threetopia/world. Definitions support literal objects, arrays, constants, exact package imports, and TypeScript type annotations.

The compiler does not execute arbitrary JavaScript. Loops, runtime calls, computed fields, and dynamic imports fail at their source location. If a procedural generator needs a new authoring operation, preserve its source and propose that operation. Do not bake away required runtime behavior.

Coordinates are metres, with Y up. Region bounds use [minX, minZ, maxX, maxZ]. Entity IDs must be stable. Resource owners create one shared resource; neighbors use extend: true. Their shared resource parameters must agree.

Local build

threetopia create coast --shared --kind world
threetopia compile coast --policy world-policy.ts

The policy selects exact provider releases. Install dependencies first. A valid local build writes .threetopia/world.json. Server compilation and behavior review are still required before acceptance.

Legacy tiles

Schema 1 world packages keep their immutable tile.lock.json, reserved host, and world/map/overview GLBs. Existing versions stay reproducible. Use the legacy tile rules when maintaining those packages.

Publish a new schema 2 version when migrating a legacy world, or create a new region package. The old version, tile contract, placement, and thumbnails stay unchanged. A shared region uses its own bounds and canonical world review.