Skip to content

Releases: N1k4G/diving-simulator

v1.1.1

18 Jun 10:49
a197640

Choose a tag to compare

What's Changed

PR Description

Fix the release pipeline and increase the release note quality.

Commit Message

Fix release labels (#3)

  • fix: enhance release notes generation with PR details and commit messages

  • fix: add GH_REPO environment variable to release label workflow

  • fix: correct repository variable usage in release label workflow

Release Details

  • Version: v1.1.1
  • Bump: patch
  • Previous version: v1.1.0
  • Commit: a197640
  • PR: #3
  • Labels: release:patch

Created automatically after successful production deployment.

v1.1.0

18 Jun 10:34
79dd802

Choose a tag to compare

Production release v1.1.0 after deploying PR #2 (release:minor).

v1.0.0

16 Jun 13:12

Choose a tag to compare

v1.0.0 — Initial Release

A 2D HTML5 Canvas diving simulator with a fully modelled decompression algorithm, realistic buoyancy physics, and four hand-authored dive sites. No build step — open in a browser and dive.


Decompression Engine

  • Bühlmann ZHL-16C — full 16-compartment model tracking N₂ and He independently, with real-time NDL, ceiling, TTS (Time-To-Surface), and GTR (Gas Time Remaining) calculations
  • Gradient Factors — configurable GF Low / GF High (30–100%, default 35/75), linearly interpolated across the dive profile; displayed on the HUD when not at 100/100
  • Adaptive safety stop — duration scales with tissue loading (0–4 min depending on compartment saturation); "SS PEND" indicator shown between 7–15 m
  • Multi-gas — up to 5 configurable tanks (Nitrox or Trimix); automatic PO₂ monitoring with hypoxia (< 0.16 bar) and hyperoxia (> 1.6 bar) warnings

CCR Mode (Closed Circuit Rebreather)

Full rebreather simulation as a selectable dive mode:

  • Independent O₂ and diluent cylinder pressure tracking
  • PO₂ control loop with metabolic O₂ consumption and solenoid injection toward setpoint
  • Diluent auto-add on descent to maintain loop volume
  • CO₂ scrubber with countdown timer and breakthrough failure (180 s delay)
  • 5 diluent presets from Air to deep Trimix 10/70
  • Bailout to open circuit via B (irreversible — diver switches to breathing diluent as OC supply)
  • Failure modes for hypoxia, hyperoxia, and scrubber depletion with configurable delay timers
  • Bühlmann deco integration using dynamic loop gas fractions (fO₂ = PO₂ / P_ambient)

Buoyancy Physics

  • Boyle's Law BCD model — bladder gas compresses with depth, reproducing the real positive-feedback instability of scuba buoyancy control
  • Wetsuit compression modelled with depth-exponential buoyancy loss
  • Asymmetric movement: ascent ramps at 2 m/s², descent at 3.33 m/s², release-deceleration at 4 m/s²
  • Fin-kick locomotion with exertion-scaled AMV penalty; flutter kick (recreational) vs. frog kick (tec/CCR) animations
  • BCD exhaust bubbles during fast ascent (> 5 m/min) separate from breathing bubbles

Four Authored Dive Sites

Site Depth Overhead
Shore ~32 m No — sandy slope from beach entry, seagrass, boulders, sunken boat
Reef Open No — flat-topped seamount with coral gardens, gorgonians, sponges, steep flanks
Wreck ~68 m Yes — ZENOBIA-inspired Ro-Ro ferry on its side; bow, hatch, and stern penetration points; bower anchor on seabed
Cave ~106 m Yes — limestone cenote forking into shallow upper tunnel and deep lower tunnel; rejoins before surface shaft

Overhead mechanics (Wreck & Cave):

  • Limited line-of-sight — solid geometry hides the world outside the diver's visibility bubble
  • Torch (T) — lights a cone in the cave; widens the bubble in the wreck; required for navigation
  • Guideline — breadcrumb line laid automatically, marking the return route to open water
  • Bad-air pockets — unbreathable gas traps in enclosed sections
  • Overhead game-over notice — safety callout on death (training, continuous guideline, rule of thirds)

Environment & Marine Life

  • Currents — probabilistic per-dive horizontal currents (0.20–0.55 m/s) with depth-banding and gradual fade; counter with fin kicks
  • Site-aware marine life: reef fish, turtles, manta rays, sharks (Reef and Wreck only)
  • Depth-graded water colour from warm shallows to near-black abyss
  • Silt disturbance — fast fin kicks above threshold reduce visibility; recovers slowly while calm
  • Nitrogen narcosis — progressive effect from 1.5 bar N₂ partial pressure; knockout at 95% saturation sustained 30 dive-seconds

Physiological Breathing Cycle

State-machine breath cycle: Inhale (2 s) → Exhale (1.5 s) → Pause (0.5 s). Breathing bubbles emit only during exhale, rising from the diver's mouth. Gas consumption via configurable AMV (8–25 L/min, default 15).

HUD — Technical Wrist Dive Computer

  • Titanium-grey bezel with alternating dark data zones
  • Depth as the dominant centred element (42 px); ascent rate colour-coded bar
  • 3-column grid: MAX/AVG/ASC rate · AMV/GTR/TTS
  • Deco obligation shown with red-tinted zone background
  • Setpoint, actual PO₂, O₂ bar, diluent bar, and scrubber timer (CCR mode)
  • GF Low/High displayed when not at 100/100

Controls

Full keyboard controls plus on-screen button overlay for touch and mouse. Context buttons (torch, gas info, fast-forward, tank switch, CCR bailout/setpoint) appear dynamically as the dive state requires. F fast-forwards deco/safety stops at 10× speed.

Infrastructure

  • No build step — plain HTML/CSS/JS, open src/diving-simulator.html directly
  • CI (GitHub Actions): lint → Playwright tests → review screenshots on every PR; deploy to Cloudflare Pages on merge to main
  • ESLint with --max-warnings=0; Husky pre-commit hook lints staged files
  • Build version stamped at deploy time (YYYY-MM-DD-<sha>)
  • Terraform config for Cloudflare Pages infrastructure

Testing

  • In-browser test suite (src/diving-simulator-tests.html) covering deco math, gas consumption, PO₂ calculations, breathing cycle, AMV bounds, and gameAPI integration
  • Headless Playwright runner (npm test)
  • window.gameAPI exposes depth, tissue state, safety stop status, and mutable AMV/GF/tank settings for test automation

Research Corpus

Six research documents included under docs/research/:

  • Bühlmann ZHL-16C algorithm audit and realism review
  • Buoyancy / BCD physics derivation
  • CCR rebreather operations
  • Nitrogen narcosis model
  • Adaptive safety stop design
  • Deco stop time acceleration rationale