Init Main project

This commit is contained in:
tyuXX 2026-11-15 12:57:24 +03:00
commit 9e581ae67f
220 changed files with 253987 additions and 0 deletions

80
How/Plan.md Normal file
View file

@ -0,0 +1,80 @@
# Space Gaem: You Will Feel the Pain
Space mission game where you run a company/space agency sponsored by governments to run space missions and explorations, and grow your company by successfully completing missions in the most efficient way using your budget.
Needs to be as realistic as possible while being playable.
## How this will work??
- Server
- Node.js TypeScript Express server
- Multiplayer: server is already authoritative - one shared persistent world state, multiple player agencies connecting at once
- Player sessions/accounts (simple: name + token, or just pick an agency name)
- WebSocket (or SSE) channel for live events: other players' launches, market ticks, competitor actions, shared solar system time
- Takes Client input and data to simulate missions and updates game state
- Sends game state to Client
- Renders simulated animations and sends to the client
- Simulated solar system (Required) and time passing/economy?
- Other players (AI) do missions and stuff
- Market dynamics and economy
- Multiplayer hooks: shared mission contract board (contracts contested between players+AI), shared launch windows, world events (solar weather, anomalies) affect everyone
> Physics is layered by fidelity:
> - Design validation: rocket equation (dv = Isp*g0*ln(m0/mf)), dv budget vs mission requirement, structural/thermal sanity checks. Instant, player-facing.
> - Ascent simulation: custom point-mass 6-DOF-lite (thrust, drag Cd estimate, gravity loss, gravity turn pitch program, staging events). Produces believable ascent, Max-Q, heating; decides if the rocket survives. Runs server-side at high rate.
> - Orbital phase: GMAT (already compiled) for player rocket missions. .gmat script templates per canonical mission type (LEO, lunar flyby, Mars transfer...), parameterized by launch date, C3/dv, payload. Run headless on design validation, cache trajectory, stream as telemetry. GMAT is point-mass only - no staging/aero/structures.
> - Background sim: Ephemeris service (SPICE kernels / VSOP87) for accurate solar system + real probes/telescopes positions at any game time. Real spacecraft kernels = real probes for free. Kepler propagation for fictional background probes.
> - Aero scope: trajectory shape only (drag, Max-Q, stability margin CP-vs-CG). No CFD-grade lift/flutter/wind - approximation is invisible to players.
- Client
- Node.js TypeScript Express.JS+Three.js frontend server that serves the game interface and bridges the game state from the server to the client
- Renders shit
- Takes user input
- Sends user input to server
- Rocket design is modular/constrained - design surface is the SAME on all difficulties, difficulty is NOT feature-gated
- Design tiers (player-selectable, cosmetic/UX depth not gating):
- Casual: pick stages, engine, tank size from presets
- Standard: tune dimensions (diameter, length, propellant load), pick materials per part
- Expert: same + mesh import (.obj/.stl) for custom part shapes, per-material layup, structural/thermal sim active. Shapes via parametric dims/meshes, NOT STEP/IGES B-rep.
- Materials (Al 7075, carbon fiber, Inconel, ablative phenolic...) feed mass/strength/thermal params into the sim. Simplified stress checks (sigma = F/A, shell buckling, ablation) - convincing approximation, not FEA.
- Design gameplay loop: Mission briefing (hard constraints: dv, payload, launch window) -> Budget -> Design rocket (parts + live dv/mass/cost meters vs requirements) -> Validate -> Test flight (ascent sim, Max-Q, staging, failure feedback) -> Launch (GMAT trajectory + telemetry playback) -> Debrief (scored on propellant margin, cost underrun, time)
- Difficulty model: NOT feature gates. Difficulty scales via:
- Budget caps (tighter budgets = forced efficiency)
- Harder mission parameters (tighter dv margins, smaller launch windows, more extreme targets)
- AI competitor agencies get better (better designs, win more contracts)
- Requirement/approval strictness (see below)
- Requirements & maturity system (NASA CML/TRL-inspired):
- Each requirement = machine-checkable rule {id, appliesTo, check(design), severity: mandatory|waiverable}
- Design screen shows live compliance checklist, checks re-run on every edit
- Design maturity levels gate progression: rough concept -> PDR/CDR-style review gates -> flight ready. Early concepts cheap to iterate, only mature designs can fly
- Waiver system: skip a requirement = costs budget + adds risk roll at launch
- Encode ~30-50 high-impact rules per mission type (mass limits, propellant compatibility, fracture control, pyro constraints, reentry heating, planetary protection). We enforce the engineering, not the literal standards text.
## Gameplay
- Player creates agency (shared world: your agency exists alongside other players' agencies)
- Player selects who to work for from a list of offers (offers may be contested - first to accept wins?)
- Player selects mission
- Player gets paid budget
- Player designs rocket, models rocket components and mission parameters
- Player makes sure the rocket is operable and livable for the crew
- Player tests rocket (Uses up budget every test)
- Player launches rocket (other players can watch your launch live on the shared map)
- Player completes mission
- Player gets increased budget for successful missions depending on how well they did
- etc.
## Multiplayer specifics
- Shared persistent world: one server process owns solar system time, market state, all agencies (player + AI)
- Async-friendly design: missions take real/simulated time - you launch, do other things, get notified on completion (fits rocket missions naturally, no need for real-time action)
- Live spectate: any player can watch an active launch/mission playback on the solar system map
- Competition: shared contract board, leaderboards (missions completed, budget earned, efficiency rating), rival agencies poaching your offers
- Optional co-op later: joint missions, shared stations, trading payload capacity
## Non player game loop
- Simulated solar system (Required) and time passing/economy?
- Other players (AI) do missions and stuff (AI fills the world so it feels alive even with few human players)
- Market dynamics and economy (shared across all players - prices react to everyone)
- etc.