Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spatial Registry

4-World Topology

The unified spatial registry for the entire fleet. Every room from every project lives here.

When everyone in the room agrees on the fiction, the room becomes the fiction — the orchestra that was a room. The Spatial Registry is that agreement made structural: four worlds, 33 rooms, one shared coordinate space where every door connects and every path resolves.

🎧 Listen to related stories

What This Is

A single source of truth for:

  • Room graphs — all rooms from Plato's Shell, Officers' Quarters, The Tap, and ScummVM Arcade
  • Coordinate frames — each project's coordinate system mapped to a shared space
  • Portal system — intra-world exits AND cross-world warp links
  • Pathfinding — BFS routes that span worlds
  • Raycasting — spatial queries in any direction

Architecture

spatial-registry/
├── src/
│   ├── types.ts              # Core types: Room, Portal, World, CoordinateFrame
│   ├── registry.ts           # SpatialRegistry class — the engine
│   ├── index.ts              # Public API
│   └── migrations/
│       └── import-all.ts     # Imports all fleet worlds + cross-world portals
├── lua/
│   └── spatial-registry.lua  # Lua bindings for Roblox
├── tests/
│   └── registry.test.ts      # 41 tests covering all functionality
└── tsconfig.json

Worlds

World Source Project Rooms Coordinate System
Plato's Shell platos-shell 12 Phaser screen → logical grid
Officers' Quarters officers-quarters 12 Phaser world → logical grid (offset)
The Tap (Rust) the-tap 3 D1 room IDs → logical positions
ScummVM BSS scummvm-arcade 6 MUD schema → grid layout

Total: 33 rooms across 4 worlds, connected by 6 cross-world portals. Each world contributes its rooms like instruments in an orchestra that was also a room — distinct voices, shared score.

Cross-World Connections

Three bidirectional warp links connect the worlds:

  1. Plato's bar-rail ↔ The Tap bar — the social hub link
  2. Plato's poker-room ↔ OQ poker-room — shared social space
  3. Plato's wheelhouse ↔ OQ bridge — command center link

Example path: tap-bar → bar-rail → aft-deck → wheelhouse (crosses 2 worlds)

Quick Start

npm install
npm test

# Run the migration script
npx tsx src/migrations/import-all.ts

Usage

import { SpatialRegistry } from 'spatial-registry';
import { importAll } from 'spatial-registry/migrations/import-all';

const registry = new SpatialRegistry();
importAll(registry);

// Query neighbors
const neighbors = registry.getNeighbors('bar-rail');

// Find a path (works across worlds)
const path = registry.findPath('tap-bar', 'wheelhouse');
// → ['tap-bar', 'bar-rail', 'aft-deck', 'wheelhouse']

// Find rooms near a point
const nearby = registry.findRoomsNear({ x: 0, y: 0, z: 0 }, 150, 'platos-shell');

// Transform coordinates between frames
const point = registry.transform({ x: 0, y: 0, z: 0 }, 'platos-frame', 'officers-frame');

// Import from MUD schema
const world = registry.importFromMUDSchema(mudJson);

Lua Bindings

The lua/spatial-registry.lua file provides Lua bindings for Roblox/Lua systems. Supports both HTTP mode (queries a registry API) and local cache mode (bundles room data).

API

Method Description
registerWorld(world) Register a world with rooms and frames
registerRoom(room) Register a single room
getRoom(id) Get a room by ID
getNeighbors(roomId) Get directly reachable rooms
findPath(from, to) BFS pathfinding (cross-world)
findRoomsNear(point, radius, worldId?) Radius query
transform(point, fromFrame, toFrame) Coordinate transformation
raycast(origin, direction, maxDist) Ray-sphere intersection
createPortal(portal) Create a portal (even cross-world)
importFromMUDSchema(schema) Import MUD-format world

License

MIT — part of the SuperInstance fleet.


📚 Related Stories

Concept Story Description
Rooms as Compositions The Orchestra That Was a Room A room that becomes a symphony when everyone inside agrees it is one.
Navigation Across Worlds The Girl Who Saw Time Reading the future in the bow wave — finding paths by observing patterns.

🎧 Listen at ai-writings.pages.dev

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages