Commit Graph

10 Commits

Author SHA1 Message Date
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