Guide for finding and modifying Dyson shell segments — shell generation, orbital mechanics, shell rendering, weather layers, orientation, and interaction in The Years Between the Stars. Use this skill whenever the user wants to change how Dyson shells look, adjust shell orientation or orbit, modify weather/clouds/lightning on shells, change shell colors or geometry, add new shell behaviors, or fix shell rendering issues. Trigger on "Dyson shell", "Dyson sphere", "iron star shells", "shell segment", "shell orientation", "shell weather", "megastructure", "concave", "convex", "shell orbit".
Dyson shells are megastructure segments that orbit the iron star. They only appear in iron star systems. Each segment is a curved section of a sphere (like a panel of a Dyson sphere), with procedural weather (clouds, lightning) on its surface. Shells are distributed across multiple orbital planes to form a loose 3D shell around the star.
engine/src/types.rs — Rust data sent over WASM boundary:
DysonShellSegmentData — full segment record: id, name, band/segment index, orbit params (orbit_radius, orbit_speed, orbit_phase, orbit_inclination, orbit_node), geometry (curve_radius, arc_width, arc_height), color, interaction_mode, weather_bandsDysonInteractionMode — currently only TargetableOnlyDysonWeatherBandData — per-band weather: , , , , start_angleend_anglehas_cloudscloud_densityhas_lightningsrc/game/engine.ts — TypeScript mirror interfaces:
DysonShellSegmentData — matches Rust struct (camelCase)DysonWeatherBandDataengine/src/system_generator.rs — generate_dyson_shells():
StarType::IronDYSON_COLORS palettesrc/game/rendering/meshFactory.ts — mesh creation:
makeDysonShellSegment() (line ~578) — creates the curved shell mesh using SphereGeometry with phiStart/phiLength/thetaStart/thetaLength to cut a panel. Has a custom shader with procedural metallic surface using noise. The geometry is centered around phi=PI (the -Z direction in local space).addDysonWeatherLayer() (line ~671) — adds a translucent weather overlay on the same geometry with clouds and animated lightning via shader uniforms (uTime, uSeed, band data).src/game/rendering/SceneRenderer.ts — placement and orbit:
lookAt(0,0,0) + rotateY(Math.PI) to orient concave side toward star.updateOrbits() (~line 1060): recomputes 3D position each frame using computeDysonShellPosition(), then re-orients with lookAt + rotateY(Math.PI).computeDysonShellPosition() — private helper that converts orbital elements (angle, radius, inclination, node) to Cartesian (x, y, z) coordinates using standard orbital mechanics formulas.'dyson_shell' in the SceneEntity interface (has optional orbitInclination and orbitNode fields).The shell geometry's front face points along -Z in local space (because phiStart centers around phi=PI). When lookAt(0,0,0) is called, the group's -Z axis aims at the star — so the convex/outside face would point at the star. rotateY(Math.PI) flips it 180° so the concave/inside face points at the star instead. Both calls are needed: lookAt sets absolute rotation, rotateY applies a relative correction on top.
Each shell has orbitInclination (tilt from equatorial plane, ±1.2 rad) and orbitNode (rotation of the orbital plane around Y, 0–2π). Position is computed as:
x = r * (cos(node) * cos(angle) - sin(node) * sin(angle) * cos(incl))
y = r * sin(angle) * sin(incl)
z = r * (sin(node) * cos(angle) + cos(node) * sin(angle) * cos(incl))
This distributes shells across a sphere rather than a flat ring.
src/game/mechanics/DockingSystem.ts — dyson_shell entities count as nearby bodies for docking proximity checks.
src/ui/HUD/Scanner.tsx — scanner renders shells as #B9C2CF colored dots, size 2.5.
src/ui/HUD/HUD.tsx — when targeted, shows shell name and "DYSON SHELL" type label.
src/ui/SystemMap/SystemMap.tsx — system map draws shell orbit arcs and includes "Dyson Shell" in the legend.
Change shell colors:
engine/src/system_generator.rs — edit DYSON_COLORS arraycd engine && wasm-pack build --target webChange shell surface shader:
src/game/rendering/meshFactory.ts — edit the fragment shader in makeDysonShellSegment()Change weather/clouds/lightning:
src/game/rendering/meshFactory.ts — edit addDysonWeatherLayer() shaderengine/src/system_generator.rs — adjust cloud_density ranges or lightning flagsChange shell size or curvature:
engine/src/system_generator.rs — adjust curve_radius, arc_width, arc_height rangesChange orbital distribution (how shells are spread around the star):
engine/src/system_generator.rs — adjust orbit_inclination range (currently ±1.2 rad), orbit_node, orbit radii, segment countFix shell orientation (which side faces star):
src/game/rendering/SceneRenderer.ts — the lookAt(0,0,0) + rotateY(Math.PI) pattern in both initial placement and updateOrbits(). If shells face the wrong way, check that rotateY(Math.PI) follows every lookAt call.Change shell count or band structure:
engine/src/system_generator.rs — band_count (2–3) and segment_count (6–10)Add new interaction modes:
engine/src/types.rs — add variant to DysonInteractionModesrc/game/engine.ts — update TS enum