Commit Graph

27 Commits

Author SHA1 Message Date
c24a6106bf feat(docs): add custom documentation pages with AI beautify
User-created dynamic doc pages live at /docs/custom/:slug, persisted in the new
backend. The editor offers "Beautify with AI", which regenerates the page as
structured HTML with Mermaid diagrams and replaces the raw markdown source (the
beautified version becomes the page's canonical content and survives edits).

Adds a DocHtml renderer that lazily renders Mermaid blocks, a purple design
token, sidebar/topbar entries for custom pages, and routing.
2026-06-16 15:44:16 -04:00
efdc34637e feat(api): add backend with kanban, docs store, and orchestrator
Introduce the @void-nav/api Hono + SQLite backend that powers the docs site:
a persisted implementation board (kanban), a custom documentation-pages store
with AI beautify, and an agentic orchestrator that runs `pi` agents per card.

The orchestrator spawns `pi --mode rpc` inside an isolated git worktree per run,
streams slim events over SSE, and lets the agent drive the board/docs via
token-gated internal endpoints (all SQLite writes stay in-process). Interrupted
runs are reconciled to "stopped" on boot.

Workspace wiring: root `dev:api`/`dev:web` scripts with `concurrently`, the
docs Vite `/api` proxy, and `.worktrees/` gitignore.
2026-06-16 15:43:58 -04:00
57633addfe chore: sync codebase remediation, gameplay systems, and docs
Security & infrastructure:
- Remove unused services/ (auth, spacetimedb) and auth.db
- Add .env.example template, expand .gitignore for env/db files
- Add GitHub Actions CI + commitlint config and workflows
- Add manual vendor chunking and source maps to docs/site vite configs

Shared UI & docs app:
- Add ARIA props and focus-visible rings to Button/Panel
- Add ButtonAsLink primitive; use shared Button in NotFound
- Wire @void-nav/ui into docs app; refresh content pages
- Replace Todo page with Kanban board

Gameplay (Bevy):
- Add ai module (behavior, faction, navigation, perception, spawning, states)
- Add narrative module (events, history, synthesis, ui)
- Refine galaxy contents and in-system flight/scene systems
2026-06-16 11:49:13 -04:00
98c2ba59df feat(gameplay): implement in-system gameplay with camera modes and flight controls
Add comprehensive in-system gameplay features including:

Camera System:
- Orbit mode for galaxy/inspection views
- Follow mode for tracking player ship during flight
- Cinematic mode for docked/cutscene views
- Smooth interpolation and orbit controls

In-System Gameplay:
- Docked state at stations with undock functionality
- Flight mode with velocity and target-based navigation
- Point-and-click movement via ground plane projection
- Target selection system for POIs

Flight Controls:
- Flight state tracking with speed monitoring
- Automatic camera transitions between modes
- Flight HUD with speed indicator and status panel
- Contextual action system for approach/dock/mining

UI Updates:
- Docked station panel with system information
- Flight mode controls and hints
- Dynamic population display

This implementation provides the foundation for tactical
space gameplay with smooth camera transitions and
intuitive point-and-click navigation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 20:02:19 -04:00
07316dbcd7 feat(gameplay): implement in-system onboarding with docked station view
Implement the final onboarding step where the player loads into their
selected starting system docked at a station.

New features:
- Create in_system module for system-scale gameplay
- Spawn player ship docked at highest-population station
- Display station info panel with undock button
- Position camera for cinematic docked view with orbit controls

Implementation details:
- in_system/mod.rs: Plugin setup with DockedState and ActiveSystem resources
- in_system/scene.rs: System/POI spawning and player ship docked positioning
- in_system/docked.rs: Docked state management and UndockEvent
- in_system/ui.rs: Docked UI with station details and undock button
- Reuse existing POI spawning patterns from galaxy/contents.rs
- Select docking station by highest population (better for new players)

Modified files:
- Add in_system module exports to gameplay/mod.rs
- Register InSystemPlugin in main.rs
- Update orbit camera control for InGame state
- Re-export GeneratedStation and STARTING_SHIPS for use by in_system

The player now completes onboarding by loading into a system view with
their ship docked at a station, ready for gameplay.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 15:19:18 -04:00
d139dc08d9 feat(gameplay): add starting base module and refine galaxy/character creation systems
Co-Authored-By: Oz <oz-agent@warp.dev>
2026-06-12 23:40:33 -04:00
71c6d18817 fix: prevent panic on randomize when arms >= 5 causes twist floor to exceed max
Clamp effective_min to DISK_TWIST_MAX in randomize_disk() so gen_range
never receives an empty range. Also guard all params.disks.len() - 1
subtractions with saturating_sub to prevent overflow if disks is empty.
2026-06-10 11:00:40 -04:00
9395dfbede fix(camera): use orbit rotation directly, normalize quaternion each frame
Replace looking_at + with_rotation with a direct rotation assignment —
orbit.rotation already encodes the correct look direction so the
intermediate looking_at call was redundant and discarded. Also re-normalize
the quaternion every frame to prevent floating-point drift from repeated
multiplications.
2026-06-10 10:01:57 -04:00
376d6a5913 fix(galaxy): remove inner/outer radius from disks, restore original spiral sweep
The inner_radius/outer_radius parameters were added for multi-disk layer
support but broke the spiral effect: they introduced a gap between the
core and disk arms that made the galaxy look like detached floating disks.

Reverted to the original generation formula:
  r = powf(random, 0.62) * galaxy_size
  angle = arm_base + (r / galaxy_size) * twist + scatter

This sweeps systems continuously from origin to galaxy edge with density
packed near the core — arms flow naturally from the dense center outward.

Removed:
- inner_radius, outer_radius fields from DiskParams
- DISK_INNER/OUTER_RADIUS_* constants from params.rs
- 4 ParamButton variants and their handlers
- UI param rows for inner/outer radius
- randomize_disk radius logic
2026-06-10 00:35:24 -04:00
ae7926ecc6 fix(galaxy): anchor spiral arms to core cluster
Structural fix for detached disk arms. The core problem was that disk
systems generated with inner_radius=0 tried to place near the origin,
but spacing constraints blocked them (core already occupied that space),
creating a visible gap between the core and spiral arms.

Changes:
- Pass core_radius to generate_disk so arms know where the core boundary is
- When inner_radius is 0 (auto), start arms inside the core zone at
  40% of core_radius, so the density peak falls inside the core sphere
  and arms visually emerge from the core boundary
- Change density exponent from powf(0.62) to powf(0.45) for stronger
  concentration near the inner edge (~60% of systems in inner 30% of
  the radial span), creating a natural bright-core-to-faint-edge falloff
- Bias randomize_disk toward inner_radius=0 (auto) 70% of the time so
  randomized galaxies always have core-anchored arms
2026-06-10 00:27:12 -04:00
ce631b00f1 fix(galaxy): ensure spiral arms are always visible
Three fixes for circular/non-spiral galaxies produced by Randomize:

1. Raise twist range from [1.0, 6.0] to [4.0, 18.0] radians
   - Old max (~0.95 turns) could barely curve; new range covers
     0.6–2.9 full turns, matching real spiral galaxy morphology
   - Default twist raised from 3.0 to 12.0 (~1.9 turns)

2. Scale angular scatter inversely with arm count
   - Replaced hardcoded ±0.36 rad scatter with arm_scatter() that
     uses 30% of the inter-arm gap (TAU / arms × 0.30)
   - Single-arm disks use a generous 1.5 rad scatter
   - Prevents high-arm-count disks from blurring into circles

3. Bias randomize_disk toward spiral-friendly values
   - Arms weighted toward 2–4 (10%, 30%, 30%, 20%, 10% distribution)
   - Twist floored at arms × 4.0 rad so multi-arm disks always wind
     enough for distinct spiral structure
   - Outer radius defaults to "auto" 60% of the time
2026-06-10 00:13:39 -04:00
80060be5ba feat(galaxy): multi-disk galaxy generation with tab-based UI
- Add multi-disk support (up to 4 independent disk layers) with per-disk
  arms, twist, tilt, rotation, inner/outer radius
- Add polar beams (top/bottom) with taper, gravity, thickness controls
- Implement tab-based disk selector UI with add/remove disk
- Add Randomize Settings button for full param randomization
- Add Regenerate (reseed) and Center View buttons
- Add per-system contents generation (planets, belts, stations, anomalies,
  gas clouds, stargates) with orbital mechanics
- Refactor control panel into scrollable sections with value display
2026-06-10 00:11:30 -04:00
f83a0c5e59 feat(galaxy): refactor params into core/disk/beam layers, fix randomize button scaling
- Split GalaxyParams into CoreParams, DiskParams, and BeamParams sub-structs
- Add polar beam systems (top/bottom) with visual differentiation
- Add scrollable control panel with section headers for each layer
- Fix Randomize Settings button: remove explicit width (use flex auto)
  and bump height from 28px to 32px to match other action buttons
- Add mouse-wheel scroll routing for the control panel
- Add 'Randomize Settings' button that randomizes all params within bounds
- Add SystemOrigin enum for per-layer tracking
- Update AGENTS.md with new module layout and plugin pattern
2026-06-09 23:07:55 -04:00
b372a75a84 Split character creation into mod/params/ui submodules
Promote the monolithic character_creation/mod.rs into a folder per
apps/game/AGENTS.md: lays out the picker UI in ui.rs, holds presets
and the editable CharacterDraft resource in params.rs, and keeps
mod.rs as the plugin + lifecycle shell.

Re-exports CharacterDraft / Origin / StartingShip at the module root
for the (yet-to-be-wired) persistence layer.
2026-06-07 22:19:52 -04:00
8a966b9584 Slow orbital periods for readability at galaxy-inspection scale
- Introduce ORBITAL_PERIOD_SCALE = 4.0 multiplier so planets/stations/
  gas clouds/anomalies all orbit visibly slower. At inspection-scale
  zoom the un-scaled periods (≈2.5s per unit of radius) made bodies
  spin like tops; tuned for a calm browsing pace.
- Default Orbit angular_velocity 0.5 → 0.15 (≈40s per revolution).
- Update orbital_period unit tests for the new scale factor.
2026-06-07 22:19:46 -04:00
75f58bcd54 Rename galaxy_creation to galaxy; add character creation skeleton
- Rename GalaxyCreationPlugin -> GalaxyPlugin, AppState::GalaxyCreation
  -> AppState::Galaxy, module path galaxy_creation -> galaxy (folder
  rename preserves git history via git mv).
- Rename GalaxyCreationSpawned -> GalaxySpawned, despawn_galaxy_creation
  -> despawn_galaxy.
- Update AGENTS.md module layout, plugin pattern example, and naming
  table for the new names.
- Add apps/game/src/gameplay/character_creation/ skeleton: placeholder
  UI with Confirm (-> InGame) and Back (-> Galaxy) buttons plus Escape
  shortcut. Wired into main.rs via CharacterCreationPlugin.
2026-06-07 17:11:56 -04:00
031a674bd0 Add orbital path integration for POIs in galaxy map
Stateless orbital system: each Orbital's local position is recomputed
each frame from phase + (TAU/period) * elapsed_secs. No per-entity
angle accumulator means no drift, trivial save/load (component data
only), and free pause/slow-mo via Bevy's time speed multiplier.

Extended to planets, stations, anomalies, gas clouds, and individual
asteroid rocks. Inner rocks orbit proportionally faster than outer
ones, producing visible belt shearing over time. Stargates stay
stationary as navigational aids. The orbital_period(orbit, jitter)
helper consolidates the period formula in one place.

10 new unit tests (7 for orbital_position, 3 for orbital_period).
All 32 tests pass.
2026-06-07 17:03:06 -04:00
4240c2b2ef Render asteroid belts as instanced jittered icospheres
Replace the flat-grey torus asteroid belt with a swarm of 60 individual
rocks per belt — one shared jittered-icosphere mesh asset scaled, rotated,
and palette-tinted per instance (5-entry greyscale/brown material set).

- New GeneratedAsteroid data (position/scale/rotation/material_index)
  generated deterministically alongside the belt, preserving the
  same-seed-same-galaxy invariant
- New build_asteroid_mesh + asteroid_material_palette helpers
- ContentAssets drops belt_material, adds asteroid_mesh + asteroid_materials
- spawn_system_contents signature simplified (no more &mut Assets<Mesh>)
- Belt entity is now a no-mesh parent (Mineable/Identifiable/...) with
  rock meshes as children — sets the stage for per-asteroid mining
- Bundles the POI component/marker scaffolding (poi.rs) and per-system
  contents generator (contents.rs: planets, stations, anomalies, stargates,
  gas clouds) that the asteroid rendering sits on top of
- Tests: asteroid_generation_is_deterministic,
  asteroid_positions_stay_inside_annulus
2026-06-06 17:57:05 -04:00
ef07880ca3 Make XYZ reference axes grey
All three cylinders now use the same neutral grey (0.55, 0.58, 0.62) so they
read as a subtle spatial scaffold instead of competing with the colored
faction stars.
2026-06-04 13:23:22 -04:00
bc82f01ac1 Allow 360° orbit, add Center View button and XYZ reference axes
Camera (apps/game/src/camera.rs):
- Replace yaw/pitch with a single Quat rotation. Mouse drag now does
  yaw-around-world-Y * rotation * pitch-around-local-X, which is gimbal-free
  and allows true 360° tumbling in any direction.
- Remove pitch clamps (ORBIT_MIN_PITCH / ORBIT_MAX_PITCH).
- Add ResetOrbitCamera resource + apply_orbit_reset system that snaps the
  orbit camera back to default on demand.
- OrbitCamera::reset() helper.

Galaxy scene (apps/game/src/gameplay/galaxy_creation/):
- New axes.rs: spawn_axes() draws three emissive cylinders through the
  origin (X=red, Y=green, Z=blue) as children of the scene root so they
  rebuild with the rest of the galaxy.
- UI adds a 'Center View' button below Regenerate that inserts
  ResetOrbitCamera; handled by reset_view_button_handler.
- Help text now mentions drag/zoom/escape.
2026-06-04 13:08:47 -04:00
1852cafcac Flip orbit camera vertical drag to iPhone-style
Drag down now raises the camera so the galaxy shifts down with the cursor
(content follows finger). Horizontal was already correct (drag right moves
the scene right). Matches the feel of panning a map on iOS.
2026-06-04 12:33:04 -04:00
c14f684b09 Add galaxy parameter UI, star selection, and movement/physics scaffolding
Galaxy creation scene (Bevy 0.16):
- Split into module folder: params.rs, mod.rs (generation + spawn), ui.rs,
  selection.rs
- GalaxyParams resource (seed, count, arms, vertical_arms, size, twist,
  vertical_twist) with generation counter for change detection
- Control panel: 7 +/- slider rows + Regenerate button, no native Bevy slider
  widget so uses label + icon buttons
- Info panel: live-refreshes on selection change via despawn_related::<Children>
- Click-to-select: screen-space picking (project each star to viewport, closest
  within 18px threshold wins); selected star lerps scale to 2.2x
- Generation faithfully ports the docs TS reference including vertical arms
- Regeneration system: despawns GalaxyScene root only, preserves UI panels

Camera:
- Camera2d -> Camera3d + OrbitCamera (left-drag yaw/pitch, scroll zoom,
  pitch/distance clamped to avoid gimbal)
- Orbit drag suppressed when cursor over UI

New plugins (scaffolding):
- movement/: Velocity, MaxSpeed, TurnRate, Drag, MoveTarget, Player components
  + click-to-move (no player spawned yet)
- physics/: pure-data geometry (ray_vs_sphere, overlaps, separate,
  segment_vs_sphere) with 7 passing unit tests; no systems wired yet
- star_map/: plugin skeleton gated on AppState::InGame

Shared:
- ui/util.rs: cursor_over_ui helper for UI-hover detection
- docs: ARCH-9 decision record (custom movement & collision, no physics engine)
2026-06-04 12:29:33 -04:00
a7796a1394 Split Rust game src into modules; update AGENTS.md for dual toolchain
- Refactor apps/game/src/main.rs into modules: state.rs, camera.rs, ui/, gameplay/
- Add gameplay/galaxy_creation.rs scaffold (stubs only, no new logic)
- Update root AGENTS.md: separate TS workspace vs Rust game commands
- Update apps/AGENTS.md: docs/game/site use two toolchains, not one
- Add apps/game/AGENTS.md: build commands, module layout, naming conventions, Plugin pattern
2026-06-04 10:00:43 -04:00
a1717e12db Replace TS game shell with Bevy/Rust client, add auth service, purge legacy archive
- Replace apps/game (TypeScript/Vite/R3F) with a Bevy 0.16 Rust client
  featuring main menu, star map, and flight states
- Add services/auth: Express + better-auth server with SpacetimeDB
  token exchange endpoint
- Delete archive/legacy-static/ (old JS demos, CSS, assets)
- Update docs pages (architecture, gameplay, roadmap, social, overview)
  to reflect Bevy pivot
- Clean up workspace config: remove apps/game from pnpm workspace,
  update dev scripts, tsconfig, and AGENTS.md files
- Add .vscode/settings.json for Rust tooling
2026-06-04 01:10:02 -04:00
7c93b8a1ae Add game UI panels, keyboard shortcuts, docs narrative overhaul, and unified dev script
- Add MiniStarMap, NpcMarketPanel, ShipStatusPanel, useKeyboardShortcuts
- Add progress bars for approach/mining operations and cargo fill indicator
- Rewrite docs from spreadsheet-first to exploration-first open-world RPG
- Replace dev:db + dev:standalone with unified dev script (scripts/dev.sh)
- Add Vite chunk splitting for three.js and spacetimedb
- Fix displayName dependency in useSpacetimeConnection
- Remove stale usePlayerSession.ts
- Add AGENTS.md files across all packages
2026-06-02 17:32:15 -04:00
01bfaedcf3 Fix workspace setup: move build tools to devDeps, remove stale files
- Move vite, tailwindcss, @tailwindcss/vite to devDependencies in all 3 apps
- Remove orphaned tsconfig.node.json from apps/game and apps/docs
- Remove leftover root src/ directory (duplicate module_bindings)
2026-05-31 18:01:35 -04:00
316a44661b Restructure into pnpm monorepo with game shell, docs, and SpacetimeDB backend
- Restructure flat static prototype into pnpm workspace monorepo
- apps/game: playable shell with R3F 3D scene, HUD, SpacetimeDB connection
- apps/docs: design docs and prototypes
- apps/site: landing page
- packages/ui: shared Button and Panel primitives
- services/spacetimedb: backend module (9 tables, 11 reducers)
- Archive legacy static files to archive/legacy-static/
- Game loop: connect, undock, target, approach, dock, mine, sell
- Add pnpm-workspace.yaml, tsconfig.base.json, spacetime.json
2026-05-31 17:56:56 -04:00