Guide for finding and modifying stations in The Years Between the Stars — docking rules, station placement, station rendering, and station interaction flow (landing, docked UI, undocking). Use this skill whenever the user wants to change docking radius/speed, docking behavior, where stations appear, station visuals, or station interaction flow. Trigger on "station", "dock", "docking", "undock", "dock radius", "landing at station", "station placement", "station model".
Station work spans four areas:
src/game/constants.ts — docking thresholds:
DOCKING.maxDistanceDOCKING.maxSpeedsrc/game/mechanics/DockingSystem.ts — core docking checks:
canDock() — distance and speed gatefindNearestStation()src/game/Game.ts — docking flow:
tryDock() — validates nearest station and docking constraintsengine/src/system_generator.rs — station placement rules:
has_station assignment on generated planetsmain_station_planet_id selectionengine/src/types.rs — station-related data fields:
PlanetData.has_stationSolarSystemData.main_station_planet_idsrc/game/rendering/meshFactory.ts — makeStation() mesh geometry
src/game/rendering/SceneRenderer.ts — station entities:
hasStationtype: 'station' for docking systemssrc/ui/LandingDialog/LandingDialog.tsx — pre-docked landing event UI and choice flow
src/ui/StationUI/StationUI.tsx — docked station screen (market and station actions)
src/ui/App.tsx — UI mode transitions and onUndock wiring
src/game/GameState.ts — UI modes ('flight', 'landing', 'docked')
Change docking radius/speed rules:
src/game/constants.ts (DOCKING)src/game/mechanics/DockingSystem.ts (if logic beyond thresholds is needed)src/game/Game.ts (optional: failure messaging)Change how stations are distributed across planets/systems:
engine/src/system_generator.rsengine/src/types.rs (only if adding/changing station-related data shape)npm run wasm:build (or cd engine && wasm-pack build --target web --out-dir pkg)Change station look/shape:
src/game/rendering/meshFactory.ts (makeStation)src/game/rendering/SceneRenderer.ts (optional: orbit/scale/spawn behavior)Change station interaction flow (dock -> landing -> docked -> undock):
src/game/Game.ts (flow control)src/ui/LandingDialog/LandingDialog.tsxsrc/ui/StationUI/StationUI.tsxsrc/ui/App.tsx and/or src/game/GameState.ts (mode plumbing)modify-trading for market prices, goods, station economy behavior, and trade UI specifics.modify-events for landing event narrative content, choices, and event selection logic.modify-ships for ship physics/handling not specific to station docking rules.