@adatechnology/game-crowd 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,8 +16,8 @@ number is in `src/data/defaults.json` with its source line, and the golden `game
16
16
  - **The normal world comes first.** With no target (`target: null`) nobody chases: agents wander and pause. The target is anything with the
17
17
  `CrowdTarget` shape; `game-player`'s `Player` is one as it is.
18
18
  - **The world** is a `NavGrid` (`createNavGrid`, the game's 0.5 m grid with occupancy codes and heights) and `water(x, z)`; doors are `createDoors`.
19
- - **Every draw is in the game's order** on the stream you pass (`random`); the flow field's time budget reads `flow.clock` (pass `() => 0` to finish
20
- each field in one frame, as the golden does).
19
+ - **Every draw is in the game's order** on the stream you pass (`random`); the flow field's budget is `flow.cellsPerStep` (default 20000 cells per step, the same field on any machine);
20
+ `flow.clock` is the legacy time budget, used only when passed alone (`() => 0` finishes each field in one frame, as the golden does).
21
21
 
22
22
  ## Install
23
23
 
@@ -124,14 +124,15 @@ crowd.stats.physics // falls by cause, fallsBeyondBlast, climbers, moundMax, thr
124
124
  The worker is **one step behind**: it is handed the state at the end of step *k*, and step *k + 1* (`workerLatency: 1`, default) or *k + 2* (`workerLatency: 2`) adds what it computed as deltas of position, push and velocity and replaces the pressure field. With the same inputs per step the answer is the same whichever thread computed it: `inline` (the same kernel on the calling thread) is the reference, and the tests compare it with a worker byte for byte. Balance, mound, thrown bodies and blasts stay on the main thread.
125
125
 
126
126
  ```ts
127
- const crowd = createCrowd({ pack, seed, physics: { ...CROWD_PHYSICS_DEFAULTS, worker: 'auto', workerLatency: 2 } })
127
+ const crowd = createCrowd({ pack, seed, physics: { ...CROWD_PHYSICS_DEFAULTS, workers, workerLatency: 2 } })
128
128
  // ...
129
- crowd.dispose() // stops the worker
129
+ crowd.dispose() // releases the crowd.physics resident
130
130
  ```
131
131
 
132
- - `workerTransport: 'shared'` (default where `SharedArrayBuffer` is usable): frame in a `SharedArrayBuffer`, control word with `Atomics`. The main thread waits for the answer, so the run is reproducible. A browser needs the page **cross-origin isolated**: serve it with `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp` (or `credentialless`), and every cross-origin sub-resource with `Cross-Origin-Resource-Policy` or CORS. `crossOriginIsolated` is then `true`. Node has `SharedArrayBuffer` always.
133
- - `workerTransport: 'transfer'`: without isolation; the frame goes by `postMessage` with its buffer transferred. The main thread cannot wait for an event, so it applies the answer when it has arrived and runs without it otherwise (the contact then lags more): it is not reproducible. `'auto'` picks it when the page is not isolated.
134
- - `workerFactory`: the default makes a module worker from `physics-worker.js`, which sits next to `index.js` in `dist`, with `new Worker(new URL('./physics-worker.js', import.meta.url), { type: 'module' })` (Vite, webpack 5 and esbuild resolve it); the `index.global.js` build has no `import.meta`, so there give a `workerFactory`. A host that bundles its own worker (or runs node `worker_threads`) gives the factory and calls `attachPhysicsWorker(port)` inside the worker; `tests/fixtures/node-physics-worker.mjs` is a node example.
132
+ - `workers`: the `@adatechnology/game-workers` coordinator (`CLAUDE.md §14`); the crowd runs as its `crowd.physics` resident (`crowdPhysicsKind`) in lane `sim`, with a fixed due frame and a byte-identical main-thread fallback when late or absent. Without `workers` (and without `workerFactory`), `worker: 'auto'` stays on the main thread; the package never spawns `new Worker(...)` directly.
133
+ - `workerTransport: 'shared'` (only with a custom `workerFactory`, default where `SharedArrayBuffer` is usable): frame in a `SharedArrayBuffer`, control word with `Atomics`. The main thread waits for the answer, so the run is reproducible. A browser needs the page **cross-origin isolated**: serve it with `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp` (or `credentialless`), and every cross-origin sub-resource with `Cross-Origin-Resource-Policy` or CORS. `crossOriginIsolated` is then `true`. Node has `SharedArrayBuffer` always.
134
+ - `workerTransport: 'transfer'` (only with a custom `workerFactory`): without isolation; the frame goes by `postMessage` with its buffer transferred. The main thread cannot wait for an event, so it applies the answer when it has arrived and runs without it otherwise (the contact then lags more): it is not reproducible.
135
+ - `workerFactory`: optional host-provided factory for callers that manage their own worker outside `game-workers` (the worker calls `attachPhysicsWorker(port)`; `tests/fixtures/node-physics-worker.mjs` is a node example). Ignored when `workers` is passed.
135
136
  - The frame copies the grid occupancy every step (1 byte per cell, 2.4 MB for the default 768 m grid): a `NavGrid` no bigger than the playable area keeps that copy small.
136
137
 
137
138
  Measured with `bench/dense-update.mjs` (node, 2000 agents pressed against a wall, all in band R0, `WORKER=shared LATENCY=2`): `crowd.update` on the main thread goes from 3.0 to 3.8 ms to 1.6 to 2.1 ms mean (the machine was loaded); with one step of latency the main thread waits for the worker for a third of its step, so it gains little. See `specs/005-camadas-e-quadro/evidence.md`, row T4b.perf.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CorpseLedger } from '@adatechnology/game-characters';
2
- import { BlastShoveOptions } from '@adatechnology/game-contracts';
2
+ import { BlastShoveOptions, WorkerCoordinator, ResidentKind, SimModule } from '@adatechnology/game-contracts';
3
3
 
4
4
  var numbers = {
5
5
  capacity: 6000,
@@ -97,8 +97,11 @@ type NavGrid = {
97
97
  readonly cell: number;
98
98
  /** Cells per side. */
99
99
  readonly n: number;
100
- readonly occ: Uint8Array;
101
- readonly occH: Float32Array;
100
+ /** Only `fillRect` writes `occ` and `occH`: a direct write does not bump `version`, so it never reaches a worker's copy. The type stops a write by index, not `fill` or `set`. */
101
+ readonly occ: Readonly<Uint8Array>;
102
+ /** Counts the `fillRect` calls that changed a cell: a reader that keeps a copy of the occupancy knows by it when the copy is stale. */
103
+ readonly version: number;
104
+ readonly occH: Readonly<Float32Array>;
102
105
  cellOf(x: number, z: number): number;
103
106
  /** Solid for a body at height `y` (default 0.5): outside the world, or an occupied cell that is not an open door and is taller than `y`. */
104
107
  solidAt(x: number, z: number, y?: number): boolean;
@@ -347,12 +350,19 @@ type CrowdPhysicsOptions = {
347
350
  * computed from the previous step), and an error when no worker can be made. `'auto'`: the same when a worker can be made, `'off'` when it cannot. Needs `contact`.
348
351
  */
349
352
  readonly worker?: 'off' | 'auto' | 'on';
350
- /** Makes the worker (default: a module worker that loads `physics-worker.js` next to the bundle). A host that bundles its own worker gives the factory and calls `attachPhysicsWorker` in it. */
353
+ /** Optional host-provided worker factory (used only when `workers` is not given; the package never spawns a `Worker` on its own, CLAUDE.md §14). A host that bundles its own worker gives the factory and calls `attachPhysicsWorker` in it. */
351
354
  readonly workerFactory?: PhysicsWorkerFactory;
352
355
  /** `'shared'` (a `SharedArrayBuffer`, deterministic, needs `crossOriginIsolated`), `'transfer'` (`postMessage`, any host, the answer is as late as the event loop makes it), `'inline'` (no worker: the same protocol on the main thread, the reference). Default: `'shared'` when it is available, else `'transfer'`. */
353
356
  readonly workerTransport?: OffloadTransport;
354
357
  /** Steps between the state the worker is handed and the step that applies its answer (default 1). 2 gives the worker a whole step to finish in, so the main thread never waits for it, and costs one more step of lag in the contact. */
355
358
  readonly workerLatency?: 1 | 2;
359
+ /**
360
+ * The game's worker coordinator (`@adatechnology/game-workers`, CLAUDE.md §14). Given, the contact and the pressure run as its
361
+ * `crowd.physics` resident, one step behind (`workerLatency`), with no wait on the main thread: a step the worker has not answered by then is
362
+ * computed here, so the state is the same with or without workers. It turns `worker` to `'auto'` unless `worker` says otherwise;
363
+ * `workerFactory` and `workerTransport` are then not used.
364
+ */
365
+ readonly workers?: WorkerCoordinator;
356
366
  };
357
367
  /** Everything on, deterministic, the numbers of the design (`design-chain-horde.md`); the player pressure stays off, a game turns it on. */
358
368
  declare const CROWD_PHYSICS_DEFAULTS: CrowdPhysicsOptions;
@@ -372,6 +382,7 @@ type ResolvedPhysics = {
372
382
  readonly workerFactory: PhysicsWorkerFactory | undefined;
373
383
  readonly workerTransport: OffloadTransport | undefined;
374
384
  readonly workerLatency: 1 | 2;
385
+ readonly workers: WorkerCoordinator | undefined;
375
386
  };
376
387
  /** Reads `CrowdOptions.physics`: the defaults filled in, and a thrown error that lists every part whose dependency is missing. */
377
388
  declare function resolvePhysics(physics?: CrowdPhysicsOptions): ResolvedPhysics;
@@ -1104,10 +1115,10 @@ type CrowdOptions = {
1104
1115
  readonly water?: (x: number, z: number) => boolean;
1105
1116
  readonly numbers?: Partial<CrowdNumbers>;
1106
1117
  readonly bands?: readonly CrowdBand[];
1107
- /** Flow field: half window in cells (192), and the clock its time budget reads (default `performance.now`; pass `() => 0` to finish every field in one frame). */
1118
+ /** Flow field: half window in cells (192). `cellsPerStep` is the budget in fixed units per step (default 20000, about 1 ms on a desktop): the same field at any frame rate and on any machine. `clock` is the legacy time budget, used only when passed without `cellsPerStep` and without `physics.deterministic` (`() => 0` finishes every field in one frame). */
1108
1119
  readonly flow?: {
1109
1120
  readonly radius?: number;
1110
- readonly clock?: () => number; /** Flow budget in cells per step instead of the clock: the same field at any frame rate (`physics.deterministic` sets 20000). */
1121
+ readonly clock?: () => number;
1111
1122
  readonly cellsPerStep?: number;
1112
1123
  };
1113
1124
  readonly plugins?: readonly CrowdPlugin[];
@@ -1589,6 +1600,160 @@ declare const unit: (identity: number, step: number, salt: number) => number;
1589
1600
  /** The identity of the `serial`-th agent born into a crowd seeded with `seed`. */
1590
1601
  declare const identityOf: (seed: number, serial: number) => number;
1591
1602
 
1603
+ /**
1604
+ * The frame the physics step is handed to a worker in: one buffer holding every array the contact and the pressure read (the inputs), the deltas and fields they give back
1605
+ * (the outputs) and the grid occupancy. One layout for the shared buffer and for the transferred one, so the two paths run the same step over the same bytes.
1606
+ */
1607
+ declare const F32_INPUTS: readonly ["x", "z", "y", "vx", "vz", "pushX", "pushZ", "mass", "build", "aimX", "aimZ", "driveFactor", "fieldPrev"];
1608
+ declare const U8_INPUTS: readonly ["band", "balance", "state", "type"];
1609
+ declare const F32_OUTPUTS: readonly ["deltaX", "deltaZ", "deltaPushX", "deltaPushZ", "deltaVx", "deltaVz", "field", "shove", "doorLoad"];
1610
+ type FrameShape = {
1611
+ readonly capacity: number;
1612
+ readonly cells: number;
1613
+ };
1614
+ type PhysicsFrame = {
1615
+ readonly header: Float64Array;
1616
+ readonly f32: {
1617
+ readonly [K in (typeof F32_INPUTS)[number] | (typeof F32_OUTPUTS)[number]]: Float32Array;
1618
+ };
1619
+ readonly u8: {
1620
+ readonly [K in (typeof U8_INPUTS)[number]]: Uint8Array;
1621
+ };
1622
+ readonly identity: Uint32Array;
1623
+ readonly doorCell: Int32Array;
1624
+ readonly occ: Uint8Array;
1625
+ };
1626
+
1627
+ /** What the kernel needs once, to be built (it travels to the worker as a message). */
1628
+ type KernelSetup = {
1629
+ readonly capacity: number;
1630
+ readonly gridSize: number;
1631
+ readonly gridCell: number;
1632
+ readonly contact: Required<CrowdContactOptions>;
1633
+ readonly pressure: Required<CrowdPressureOptions> | null;
1634
+ readonly driveForceOfType: readonly number[];
1635
+ };
1636
+
1637
+ /** A ring of `slots` frames: the main thread writes the next step into a free one, submits it, and takes the oldest submitted one back when it is done. */
1638
+ type StepRunner = {
1639
+ readonly transport: OffloadTransport;
1640
+ /** The frame to write the inputs of the next step into; `null` when every frame is out (all in flight, or with the worker in the transfer transport). */
1641
+ frame(): PhysicsFrame | null;
1642
+ /** Sends the frame `frame()` gave. */
1643
+ submit(): void;
1644
+ /** Frames submitted and not yet taken back. */
1645
+ readonly inFlight: number;
1646
+ /**
1647
+ * The oldest submitted frame with its outputs, and it is free again for `frame()` once they are read; `null` when it is not back yet. The shared and inline transports wait for
1648
+ * it (the worker computes in step with the main thread, so the answer never depends on timing); the transfer transport cannot wait for an event, so it answers when it can.
1649
+ */
1650
+ settle(): PhysicsFrame | null;
1651
+ dispose(): void;
1652
+ };
1653
+
1654
+ /** What the crowd physics resident is built from, once per worker. */
1655
+ type CrowdPhysicsInit = {
1656
+ readonly setup: KernelSetup;
1657
+ readonly shape: FrameShape; /** The grid bytes of every step, when the frames travel without them (`shape.cells` 0). */
1658
+ readonly occupancy?: Uint8Array;
1659
+ };
1660
+ /** The grid whose bytes the runner keeps with the resident instead of copying them into every step: a new `version` means a new resident. */
1661
+ type OccupancySource = {
1662
+ readonly occ: Uint8Array;
1663
+ readonly version: number;
1664
+ };
1665
+ /**
1666
+ * The contact and the pressure of the crowd as a resident kind of the worker coordinator (`crowd.physics`): the kernel is built from the
1667
+ * setup once per worker, and each step is one frame buffer in, the same buffer with its outputs written back out. The kernel reads nothing
1668
+ * but the frame, so the main thread runs the same step when the worker is late (CLAUDE.md §14). A game's worker file hosts it:
1669
+ * `installWorkerHost(self, [crowdPhysicsKind, ...])`.
1670
+ */
1671
+ declare const crowdPhysicsKind: ResidentKind<CrowdPhysicsInit, ArrayBuffer, ArrayBuffer>;
1672
+ /**
1673
+ * The runner over the coordinator: the frame of step `k` is handed over in `submit` and read back at step `k + slots`, from the worker
1674
+ * when it answered by then and computed here otherwise, so the state never depends on timing and the main thread never waits.
1675
+ */
1676
+ declare function createCoordinatorRunner(setup: KernelSetup, shape: FrameShape, coordinator: WorkerCoordinator, slots?: number, grid?: OccupancySource): StepRunner;
1677
+
1678
+ /**
1679
+ * The horde as a simulation-thread module (spec 009, T22): the crowd is built and stepped in the simulation thread, and each step writes
1680
+ * the store into the snapshot the page draws from (`readHordeSnapshot` copies it into the page's own store). The page sends the target's
1681
+ * position and blasts as commands. Deterministic flow (cells per step, not the clock), so the inline loop gives the same bytes.
1682
+ */
1683
+ interface HordeSimInit {
1684
+ readonly pack: CrowdPack;
1685
+ readonly seed: number;
1686
+ readonly capacity: number;
1687
+ readonly physics?: CrowdPhysicsOptions;
1688
+ /** Agents born at the start, round `spawn` (ring of `radius` m); ignored with `initial`. */
1689
+ readonly count: number;
1690
+ /** The agents to start from instead: a snapshot of the page's store (`writeHordeSnapshot`), the horde the page laid out. */
1691
+ readonly initial?: Uint8Array;
1692
+ readonly spawn: {
1693
+ readonly x: number;
1694
+ readonly z: number;
1695
+ readonly radius: number;
1696
+ };
1697
+ /** Where the target stands at the start. */
1698
+ readonly target: {
1699
+ readonly x: number;
1700
+ readonly z: number;
1701
+ };
1702
+ /** Flow cells per step (default 20000, the physics' deterministic number). */
1703
+ readonly flowCellsPerStep?: number;
1704
+ }
1705
+ /** The commands of the horde module (first number of each command). */
1706
+ declare const HORDE_COMMAND: {
1707
+ /** `[TARGET, x, z, yaw, alive]` */
1708
+ readonly TARGET: 1;
1709
+ /** `[BLAST, x, y, z, radius, energy J]` */
1710
+ readonly BLAST: 2;
1711
+ };
1712
+ declare const HORDE_SIM_ID = "crowd.horde";
1713
+ /** The page's handle on a horde in its simulation thread: `startSimThread`'s `SimThread` is one. */
1714
+ interface HordeThreadLike {
1715
+ latest(): {
1716
+ readonly bytes: Uint8Array;
1717
+ } | null;
1718
+ send(command: ArrayLike<number>): boolean;
1719
+ dispose(): void;
1720
+ }
1721
+ type Field = {
1722
+ readonly key: keyof CrowdStore;
1723
+ readonly per: number;
1724
+ readonly bytes: number;
1725
+ readonly offset: number;
1726
+ };
1727
+ /** Where each field of the store sits in a snapshot of `capacity` agents (every agent field, then the two per-agent limbs). */
1728
+ declare function hordeSnapshotLayout(store: CrowdStore): {
1729
+ readonly bytes: number;
1730
+ readonly fields: readonly Field[];
1731
+ };
1732
+ /** Writes the first `store.n` agents of every field into `out`. */
1733
+ declare function writeHordeSnapshot(store: CrowdStore, out: Uint8Array, header: {
1734
+ readonly frame: number;
1735
+ readonly kills: number;
1736
+ readonly hurt: number;
1737
+ }, layout?: {
1738
+ readonly bytes: number;
1739
+ readonly fields: readonly Field[];
1740
+ }): void;
1741
+ /** Copies a snapshot into `store` (the page's crowd, which the renderer reads); returns the header. */
1742
+ declare function readHordeSnapshot(store: CrowdStore, bytes: Uint8Array, layout?: {
1743
+ readonly bytes: number;
1744
+ readonly fields: readonly Field[];
1745
+ }): {
1746
+ readonly n: number;
1747
+ readonly frame: number;
1748
+ readonly kills: number;
1749
+ readonly hurt: number;
1750
+ };
1751
+ /** Builds the crowd of the module: the same in the simulation thread and in the test's reference. */
1752
+ declare function createHordeCrowd(init: HordeSimInit, target: CrowdTarget): Crowd;
1753
+ declare const hordeSimModule: SimModule<HordeSimInit>;
1754
+ /** Bytes of one snapshot of a horde of `capacity` agents. */
1755
+ declare function hordeSnapshotBytes(capacity: number): number;
1756
+
1592
1757
  /** What a worker thread has to offer: browsers and node give it different shapes, so the host adapts them. */
1593
1758
  type WorkerPort = {
1594
1759
  postMessage(message: unknown, transfer?: ArrayBuffer[]): void;
@@ -1600,4 +1765,4 @@ type WorkerPort = {
1600
1765
  */
1601
1766
  declare function attachPhysicsWorker(port: WorkerPort): void;
1602
1767
 
1603
- export { AGENT_FIELDS, BALANCE, CELL, CIVILIAN_DEFAULTS, CROWD_DEFAULTS, CROWD_PHYSICS_DEFAULTS, type Civilian, type CivilianBuilding, type CivilianEventMap, type CivilianEventName, type CivilianNumbers, type CivilianOptions, type CivilianSpec, type CivilianState, type Civilians, type ContactParams, type ContactResult, type ContactView, type Corpse, type Crowd, type CrowdAge, type CrowdBalanceOptions, type CrowdBalanceTraits, type CrowdBand, type CrowdBlast, type CrowdBlastOptions, type CrowdCaliber, type CrowdContactOptions, type CrowdDamageResult, type CrowdDensityOptions, type CrowdEffectId, type CrowdEventMap, type CrowdEventName, type CrowdHit, type CrowdMessageId, type CrowdMoundOptions, type CrowdMovable, type CrowdNumbers, type CrowdOptions, type CrowdOutfit, type CrowdPack, type CrowdPersonalityOptions, type CrowdPhysicsOptions, type CrowdPlayerPressureOptions, type CrowdPlugin, type CrowdPressureOptions, type CrowdShove, type CrowdSoundId, type CrowdStore, type CrowdTarget, type CrowdThrownOptions, type CrowdTraits, type CrowdType, type CrowdUpdateContext, type CrowdView, DOOR_DEFAULTS, type Door, type DoorEventMap, type DoorEventName, type DoorNumbers, type Doors, FALL_CAUSE, type Flock, type FlockBird, type FlockMode, type FlockOptions, HERD_DEFAULTS, HERD_ROLES, type Herd, type HerdAnimal, type HerdAnimalSpec, type HerdEventMap, type HerdEventName, type HerdNumbers, type HerdOptions, type HerdRole, type InfectionBinding, type InfectionBindingOptions, type InfectionModelLike, MISSING, type MigrationOptions, type MovableContacts, type MovableHit, type NavGrid, type NavGridOptions, type OffloadTransport, type PhysicsStats, type PhysicsWorkerFactory, type PhysicsWorkerHandle, type PlayerCrowdLike, type Region, type ResolvedPhysics, STATE, type ThrownPool, type WorkerPort, attachPhysicsWorker, bindInfection, carrionCenter, contactStep, createCivilians, createContactView, createCrowd, createDoors, createFlock, createHerd, createMovableContacts, createNavGrid, createRng, createStore, identityOf, mix32, resolvePhysics, unit, walksInto };
1768
+ export { AGENT_FIELDS, BALANCE, CELL, CIVILIAN_DEFAULTS, CROWD_DEFAULTS, CROWD_PHYSICS_DEFAULTS, type Civilian, type CivilianBuilding, type CivilianEventMap, type CivilianEventName, type CivilianNumbers, type CivilianOptions, type CivilianSpec, type CivilianState, type Civilians, type ContactParams, type ContactResult, type ContactView, type Corpse, type Crowd, type CrowdAge, type CrowdBalanceOptions, type CrowdBalanceTraits, type CrowdBand, type CrowdBlast, type CrowdBlastOptions, type CrowdCaliber, type CrowdContactOptions, type CrowdDamageResult, type CrowdDensityOptions, type CrowdEffectId, type CrowdEventMap, type CrowdEventName, type CrowdHit, type CrowdMessageId, type CrowdMoundOptions, type CrowdMovable, type CrowdNumbers, type CrowdOptions, type CrowdOutfit, type CrowdPack, type CrowdPersonalityOptions, type CrowdPhysicsInit, type CrowdPhysicsOptions, type CrowdPlayerPressureOptions, type CrowdPlugin, type CrowdPressureOptions, type CrowdShove, type CrowdSoundId, type CrowdStore, type CrowdTarget, type CrowdThrownOptions, type CrowdTraits, type CrowdType, type CrowdUpdateContext, type CrowdView, DOOR_DEFAULTS, type Door, type DoorEventMap, type DoorEventName, type DoorNumbers, type Doors, FALL_CAUSE, type Flock, type FlockBird, type FlockMode, type FlockOptions, HERD_DEFAULTS, HERD_ROLES, HORDE_COMMAND, HORDE_SIM_ID, type Herd, type HerdAnimal, type HerdAnimalSpec, type HerdEventMap, type HerdEventName, type HerdNumbers, type HerdOptions, type HerdRole, type HordeSimInit, type HordeThreadLike, type InfectionBinding, type InfectionBindingOptions, type InfectionModelLike, MISSING, type MigrationOptions, type MovableContacts, type MovableHit, type NavGrid, type NavGridOptions, type OffloadTransport, type PhysicsStats, type PhysicsWorkerFactory, type PhysicsWorkerHandle, type PlayerCrowdLike, type Region, type ResolvedPhysics, STATE, type ThrownPool, type WorkerPort, attachPhysicsWorker, bindInfection, carrionCenter, contactStep, createCivilians, createContactView, createCoordinatorRunner, createCrowd, createDoors, createFlock, createHerd, createHordeCrowd, createMovableContacts, createNavGrid, createRng, createStore, crowdPhysicsKind, hordeSimModule, hordeSnapshotBytes, hordeSnapshotLayout, identityOf, mix32, readHordeSnapshot, resolvePhysics, unit, walksInto, writeHordeSnapshot };