# Tidewater in the shared world

Tidewater is published as **26 packages at 0.3.0** under `@dgreenheck/`.
Dan Greenheck remains the author. `@promontis` manages the packages until transfer.
[Open the world](https://world.threetopia.com/) or
[the package catalog](https://creators.threetopia.com/catalog?q=tidewater).

The full scene uses one renderer, camera, clock, and frame loop. Map and Walk
show the same accepted revision. Reusable logic is plain Three.js and TypeScript.
The browser uses a thin R3F host. The world definition does not depend on React.

## Package structure

All names below start with `@dgreenheck/tidewater-`. Dependencies use exact versions.
Each package has a README, composition code, attribution, and a preview.
Settings appear in the component preview or the original scene controls.

| Type | Suffixes | Purpose |
| --- | --- | --- |
| World | `world-tile` | The complete region and its entities |
| Asset | `map-tile` | Reusable reduced map and overview geometry |
| Asset | `composition` | Shared scene assembly, actors, and frame order |
| Asset | `terrain`, `village`, `vegetation`, `rocks`, `debris` | Island and objects |
| Asset | `ocean`, `reef`, `wildlife`, `whale`, `gulls` | Water and wildlife |
| Asset | `boat`, `player`, `audio`, `ui` | Interaction, sound, and controls |
| Asset | `core`, `lighting`, `sky`, `postprocessing` | Reusable rendering code |
| System | `environment`, `ground`, `render-targets`, `water`, `marine-rendering` | Providers selected by world policy |

An asset with `library: true` is reusable code. Import it in a component or
provider. It cannot be placed directly as an entity. Boat, whale, wildlife, and
player have entity adapters. Regions require capabilities; they do not choose
the global providers.

## How the parts connect

The world package declares the region. Its manifest pins the imported assets:

```ts
import {defineRegion} from '@threetopia/world';
import boat from '@dgreenheck/tidewater-boat';
import whale from '@dgreenheck/tidewater-whale';
import wildlife from '@dgreenheck/tidewater-wildlife';
import player from '@dgreenheck/tidewater-player';

export default defineRegion({
  id: 'tidewater',
  bounds: [-1024, -1024, 1024, 1024],
  requires: ['water.surface@2'],
  resources: [{
    id: 'world:tidewater-sea', capability: 'water.surface@2',
    bounds: [-1024, -1024, 1024, 1024], parameters: {},
  }],
  entities: [
    {id:'boat', asset:boat, position:[64.5, 0, 36.5],
      settings:{throttle:0, steering:0}},
    {id:'whale', asset:whale, position:[0, 0, 0]},
    {id:'wildlife', asset:wildlife, position:[0, 0, 0]},
    {id:'player', asset:player, position:[0, 0, 0]},
  ],
});
```

The policy selects five providers. They import `tidewater-composition`.
Ground composes terrain, village, vegetation, debris, rocks, and reef.
Water uses the ocean and wake modules. The player connects audio, controls,
and UI. The marine compositor keeps the original render passes and effects.

The same leaf packages also work outside this region:

```js
import {createBoat} from '@dgreenheck/tidewater-boat';

const boat = createBoat({options:{navLights:true, throttle:.3}});
await boat.ready;
scene.add(boat.object);
boat.update(deltaSeconds);
boat.setOptions({throttle:.7});
boat.dispose();
```

## Preserved behavior and agreed limits

The source is commit `d32799fcd85b79fb2fde3c4254f9d3805edecee3`, with its MIT
license and asset credits. The inventory covers 130 source files and 54 original
asset files. Fonts and their licenses are bundled locally.

The scene retains the island, village, pier, vegetation, debris, reef, fish,
birds, crabs, whale, FFT ocean, surf, wakes, sky, shadows, post effects,
walking, swimming, boat controls, 32 recordings, and original UI.

The owner accepted the renderer mip correction after the side-by-side film.
The owner also accepted the shared wake limit: up to four hulls within 340.8 m
per axis, with the original 0.4 m cells. Larger spans and dynamic fleet changes
fail explicitly. One hull keeps the original solver. These limits do not omit
features from the original single-boat scene.

`water.surface@2` preserves asynchronous samples with time and age.
`water.current@1` is separate. Tidewater does not invent currents.
A package that requires currents needs a selected current provider.
Read [the comparison method and exact limits](/tidewater-parity).

## Checks and release

```sh
corepack pnpm check:quality
corepack pnpm check:quality:gpu
node scripts/world/build-tidewater-release.mjs NEW_DIRECTORY
node scripts/world/test-tidewater-release.mjs NEW_DIRECTORY
```

The source comparison checks 28 views, gameplay, audio events, delayed samples,
and region crossings. Other tests check independent instances and GPU disposal.
The release test uploads through the CLI to an isolated registry. It loads a
candidate through the normal browser, accepts it locally, loads the public
world, then installs and compiles the packages in a fresh project.

Published versions stay frozen. A changed build needs a new exact version and
a versioned runtime adapter. The builder cannot overwrite an accepted catalog.

Production uses the same CLI `push`, `publish`, `policy`, `candidate`, and
`accept` commands. The server verifies the exact files. The client only runs
adapters whose package files match its reviewed release catalog.
`docs/reviews/tidewater-release.json` records the server acceptance and inventory.

Earlier fixed-tile releases remain installable. The original 0.1.0 world tile,
its contract, placement, and thumbnails stay unchanged. The 0.3.0 region uses
the shared world model. `/legacy/` keeps the earlier map.
