diff --git a/AGENTS.md b/AGENTS.md index b196b628..f0a45a6b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ ## Authority and scope -- This is U-Jagd 1.3.21 (`src/core/version.py`); current saves are v24-only. Treat these as compatibility contracts, not changelog entries. +- This is U-Jagd 1.3.22 (`src/core/version.py`); current saves are v24-only. Treat these as compatibility contracts, not changelog entries. - Resolve conflicts in this order: executable code and focused tests; packaged JSON/runtime resources; `pyproject.toml` and provenance/license notices; `README.md`; design/history documents under `docs/`. A plan or old comment is not an implementation contract. - Preserve explicit compatibility tests and user data unless a task intentionally changes the contract. Add a regression test for behavior changes. - Older phase/milestone labels under `docs/GDD.md`, `docs/implementation-plan.md`, `docs/plan-0.1.6.md`, and `docs/plan-0.1.7.md` are historical. Current resumable work is tracked in `docs/plan-1.3.md` and `docs/resume.md`. diff --git a/CHANGELOG.de.md b/CHANGELOG.de.md index 3ee0c916..a7c43da8 100644 --- a/CHANGELOG.de.md +++ b/CHANGELOG.de.md @@ -4,6 +4,16 @@ Alle Versionen von U-Jagd, die neueste zuerst. Die [README](README.de.md) zeigt nur die neueste. +## 1.3.22 + +Version 1.3.22 bringt **Atmosphäre ins besetzte Boot**: der Druckkörper knarzt in +der Tiefe und kracht, wenn er versagt, Detonationen im Wasser sind dicht beim +Boot oder in der Ferne zu hören und stehen mit Peilung im Log, und bei +**Schleichfahrt** schalten die Boot-Bildschirme am uConsole und im Browser auf +gedimmtes Rotlicht. Die Browser des Boots spielen jetzt dessen eigene Töne, und +der Alarmton einer Rettungsaufgabe stört den Browser nicht mehr. Spielstände +bleiben v24. + ## 1.3.21 Version 1.3.21 lässt das besetzte Boot **unter seine Testtiefe** tauchen, bis zur diff --git a/CHANGELOG.md b/CHANGELOG.md index ba34d5e7..64d9ca8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ Every U-Jagd release, newest first. The [README](README.md) shows only the latest one. +## 1.3.22 + +Release 1.3.22 brings **atmosphere to the crewed boat**: the pressure hull creaks +deep down and cracks when it fails, detonations in the water are heard close +aboard or far off and logged with a bearing, and **silent running** rigs the +boat's screens for dimmed red light on the uConsole and in the browser. The +boat's browsers now play its own sound cues, and a rescue task's alarm cue no +longer upsets the browser. Saves stay v24. + ## 1.3.21 Release 1.3.21 lets the crewed boat go **below its test depth**, down to crush diff --git a/README.de.md b/README.de.md index 4abce8c9..5cc5ebac 100644 --- a/README.de.md +++ b/README.de.md @@ -14,15 +14,15 @@ Sie führen eine fiktive Fregatte und wechseln zwischen neun Arbeitsplätzen, um zu navigieren, zu suchen, Kontakte zu klassifizieren, Ziele zu bekämpfen und das Schiff einsatzfähig zu halten. -Aktuelle Version: **1.3.21** +Aktuelle Version: **1.3.22** -Version 1.3.21 lässt das besetzte Boot **unter seine Testtiefe** tauchen, bis zur -Zerstörungstiefe (1,5-fache Testtiefe), mit wachsendem Risiko: gebrochene -Bolzen, versagende Wellen- oder Ventildichtungen und, tiefer, ein Riss im -Druckkörper fluten Abteilungen und erhöhen den Schaden, je tiefer, desto -häufiger; in Zerstörungstiefe bricht der Druckkörper zusammen. Die -Tiefenleitern markieren die Zerstörungstiefe, und ein roter Alarm zeigt die -Fahrt unter der Testtiefe. Spielstände bleiben v24. +Version 1.3.22 bringt **Atmosphäre ins besetzte Boot**: der Druckkörper knarzt in +der Tiefe und kracht, wenn er versagt, Detonationen im Wasser sind dicht beim +Boot oder in der Ferne zu hören und stehen mit Peilung im Log, und bei +**Schleichfahrt** schalten die Boot-Bildschirme am uConsole und im Browser auf +gedimmtes Rotlicht. Die Browser des Boots spielen jetzt dessen eigene Töne, und +der Alarmton einer Rettungsaufgabe stört den Browser nicht mehr. Spielstände +bleiben v24. Frühere Versionen: [CHANGELOG.de.md](CHANGELOG.de.md). diff --git a/README.md b/README.md index ae865d97..c33d05ca 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ around the ClockworkPi uConsole's 1280 x 720 workspace. You command a fictional frigate and move between nine workstations to navigate, search, classify, engage, and keep the ship operational. -Current release: **1.3.21** +Current release: **1.3.22** -Release 1.3.21 lets the crewed boat go **below its test depth**, down to crush -depth (1.5 x test depth), at a growing risk: sheared bolts, failed shaft or -valve seals and, deeper, a cracked pressure hull flood compartments and add -damage, far more often the deeper the boat goes; at crush depth the hull -collapses. The depth columns mark the crush depth and a red alarm shows while -the boat is below test depth. Saves stay v24. +Release 1.3.22 brings **atmosphere to the crewed boat**: the pressure hull creaks +deep down and cracks when it fails, detonations in the water are heard close +aboard or far off and logged with a bearing, and **silent running** rigs the +boat's screens for dimmed red light on the uConsole and in the browser. The +boat's browsers now play its own sound cues, and a rescue task's alarm cue no +longer upsets the browser. Saves stay v24. Earlier releases: [CHANGELOG.md](CHANGELOG.md). diff --git a/data/commander/css/components.css b/data/commander/css/components.css index d488c8e7..f8128809 100644 --- a/data/commander/css/components.css +++ b/data/commander/css/components.css @@ -169,6 +169,9 @@ body.workstation-mode .chart-panel { display: none; } } .map-tooltip strong { color: var(--live-strong); } +/* Silent running: the boat's stations rig for red, dimmed light. */ +body[data-boat-light="red"] #operations { filter: sepia(1) saturate(4) hue-rotate(-45deg) brightness(.72); } +@media (prefers-reduced-motion: no-preference) { #operations { transition: filter .8s ease; } } /* Crewed submarine: boat-mode toggles (silent running, snorkel, bottom). */ /* ---- Boat stations: dense two-column instrument panel ------------------ */ #station-uboot .uboot-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); grid-auto-flow: row dense; align-content: start; gap: .45rem; } diff --git a/data/commander/js/audio/audio.js b/data/commander/js/audio/audio.js index aa063dfe..11d3689e 100644 --- a/data/commander/js/audio/audio.js +++ b/data/commander/js/audio/audio.js @@ -43,6 +43,11 @@ function playGameEffect(kind) { // Returned echoes: CW a steady carrier tone, LFM a short 100 Hz sweep. sonar_echo_cw: [900, 900, .55, .07, "sine"], sonar_echo_cw_faint: [900, 900, .55, .025, "sine"], sonar_echo_lfm: [850, 950, .32, .08, "sine"], sonar_echo_lfm_faint: [850, 950, .32, .03, "sine"], + alarm: [880, 660, .6, .12, "square"], + // Inside the crewed boat: the hull groaning deep down, a hull failure's + // crack and detonations close by or far off. + hull_creak: [88, 70, 1.8, .10, "sawtooth"], hull_crack: [180, 46, .5, .22, "square"], + detonation_near: [60, 24, 1.6, .22, "sawtooth"], detonation_far: [42, 22, 2.4, .09, "triangle"], }[kind]; const [startHz, endHz, duration, gainLevel, type] = profile; const oscillator = S.audio.createOscillator(); @@ -50,7 +55,7 @@ function playGameEffect(kind) { const now = S.audio.currentTime; oscillator.type = type; oscillator.frequency.setValueAtTime(startHz, now); - if (kind.startsWith("sonar_echo_lfm")) oscillator.frequency.linearRampToValueAtTime(endHz, now + duration); + if (kind.startsWith("sonar_echo_lfm") || kind === "hull_creak") oscillator.frequency.linearRampToValueAtTime(endHz, now + duration); else oscillator.frequency.setValueAtTime(endHz, now + duration); gain.gain.setValueAtTime(0, now); gain.gain.linearRampToValueAtTime(volume * gainLevel, now + .012); diff --git a/data/commander/js/state/shared.js b/data/commander/js/state/shared.js index 86b62f8b..78c8d137 100644 --- a/data/commander/js/state/shared.js +++ b/data/commander/js/state/shared.js @@ -33,7 +33,8 @@ export function filteredEloka(intercepts) { // its fresh state arrives; a world/lease change clears every entry. export const roleCache = new Map(); export const gameEffectKinds = new Set(["sonar_ping", "esm_contact", "torpedo_launch", "missile_launch", "gunfire", "explosion", "water_entry", - "sonar_echo_cw", "sonar_echo_cw_faint", "sonar_echo_lfm", "sonar_echo_lfm_faint"]); + "sonar_echo_cw", "sonar_echo_cw_faint", "sonar_echo_lfm", "sonar_echo_lfm_faint", "alarm", + "hull_creak", "hull_crack", "detonation_near", "detonation_far"]); // Spoken crew reports (src/core/callouts.py KEYS); the text is the browser's own. export const calloutKinds = new Set(["torpedo", "contact", "breakup", "torpedo_away", "hit", "won", "lost", "action_stations", "mpa_on_station", "ping", "dipping", "buoy_ping", "splash", "evade", "mast_threat", "leak", "fire"]); diff --git a/data/commander/js/views/station-view.js b/data/commander/js/views/station-view.js index 8ca44613..6da81280 100644 --- a/data/commander/js/views/station-view.js +++ b/data/commander/js/views/station-view.js @@ -68,6 +68,8 @@ export function renderStationView() { if (section.hidden) for (const container of section.querySelectorAll("dl, .station-list")) container.replaceChildren(); } renderRoleVisuals(active); + // Silent running: the boat's command stations rig for red, dimmed light. + document.body.dataset.boatLight = isBoatCommand(active) && S.v2State[active]?.status?.silent === true ? "red" : ""; if (!active) return; const signature = `${S.language}:${active}:${JSON.stringify(S.v2State[active])}:${JSON.stringify(S.v2State.environment)}`; if (signature === S.stationRenderSignature) return; diff --git a/data/i18n/de.json b/data/i18n/de.json index defa7ef8..8410757f 100644 --- a/data/i18n/de.json +++ b/data/i18n/de.json @@ -5597,5 +5597,7 @@ "uboot.threat.overdepth": "UNTER TESTTIEFE {depth} m (Test {test} m, Zerstörung {crush} m)", "uboot.ladder.crush": "Zerstörung {depth} m", "commander.web.uboot_depth_mark_crush": "Zerstörung {depth} m", - "commander.web.uboot_chip_overdepth": "Unter Testtiefe {test} m (Zerstörung {crush} m)" + "commander.web.uboot_chip_overdepth": "Unter Testtiefe {test} m (Zerstörung {crush} m)", + "uboot.event.detonation_near": "Detonation dicht beim Boot, Peilung {bearing}!", + "uboot.event.detonation_far": "Entfernte Detonation, Peilung {bearing}." } diff --git a/data/i18n/en.json b/data/i18n/en.json index d6f74867..4eab624f 100644 --- a/data/i18n/en.json +++ b/data/i18n/en.json @@ -5597,5 +5597,7 @@ "uboot.threat.overdepth": "BELOW TEST DEPTH {depth} m (test {test} m, crush {crush} m)", "uboot.ladder.crush": "Crush {depth} m", "commander.web.uboot_depth_mark_crush": "Crush {depth} m", - "commander.web.uboot_chip_overdepth": "Below test depth {test} m (crush {crush} m)" + "commander.web.uboot_chip_overdepth": "Below test depth {test} m (crush {crush} m)", + "uboot.event.detonation_near": "Detonation close aboard, bearing {bearing}!", + "uboot.event.detonation_far": "Distant detonation, bearing {bearing}." } diff --git a/data/manual/10-reference.de.md b/data/manual/10-reference.de.md index 8a4ae655..477e7847 100644 --- a/data/manual/10-reference.de.md +++ b/data/manual/10-reference.de.md @@ -111,6 +111,7 @@ Eine zweite Crew kann den Gegner spielen. Das Boot hat sieben Stationen: Führun - **Tauchzellen, Trimm und Pressluft:** die Maschine zeigt unter **Tauchzellen & Trimm** (Karte im Browser mit Schnittbild des Boots, auf der uConsole Maschine Seite 3 **Zellen**) die Hauptzellen, die Regelzelle, die Trimmzellen, die Pressluft und den Trimmzustand des Boots. Jede Gewichtsänderung bringt das Boot aus dem Gleichgewicht: ein Torpedo aus einem Bugrohr macht es 1,5 t leichter und achterlastig, Wasser in vollgelaufenen Abteilungen (siehe Leckwehr) macht es schwerer und trimmt es zum gefluteten Ende; die Trimmautomatik gleicht davon aus, was ihre Zellen fassen. Mit der **Trimmautomatik** pumpt der LI die Regelzelle (±8 t, 25 kg/s) und die Trimmzellen (±3 t vorn und achtern, 15 kg/s) zurück ins Gleichgewicht; von Hand verschiebt jeder Befehl die Regelzelle um 0,5 t oder das Trimmwasser um 0,25 t (und schaltet die Automatik aus). Laufende Trimmpumpen sind hörbar (+3 dB und eine Linie bei 120 Hz). Was die Zellen nicht aufnehmen, lässt das Boot mit 0,03 m/s je Tonne sinken oder steigen, und ein Trimmwinkel (1° je Tonne Moment, + vorlastig) drückt es mit Fahrt nach unten oder oben; die Tiefenruder halten das nur mit Fahrt, ein schweres Boot sinkt bei wenig Fahrt unter seine befohlene Tiefe; das Log warnt ab 2 t und ab 3°. Die **Pressluft** (200 bar) reicht für drei Notanblasungen zu je 60 bar; Anblasen leert die Hauptzellen in 20 s, das Boot steigt auf 10 m und bleibt dort, die befohlene Tiefe steht dann auf 10 m. Der nächste Befehl unter 12 m öffnet die Entlüftung: die Hauptzellen fluten in 40 s, erst dann kann das Boot tauchen. Schnorcheln auf Diesel betreibt den Kompressor (0,05 bar/s); mit nur lüften läuft er nicht. Ohne Strom laufen weder Trimmpumpen noch Kompressor. Die KI-Boote halten sich selbst im Trimm und behalten ihr eines Notanblasen. - **Leckwehr:** die Maschine zeigt unter **Leckwehr** (Karte im Browser mit den Abteilungen und einer Tabelle, auf der uConsole Maschine Seite 4 **Leckwehr**) den Druckkörper in sechs Abteilungen: Bugraum, Zentrale, Wohnraum, Batterieraum, Maschinenraum und Heckraum. Ein Treffer auf das besetzte Boot schlägt ein Leck in die getroffene Abteilung (1,5 % Leck je % Trefferschaden, höchstens ein volles Leck; ab 50 % Schaden auch in die Nachbarabteilung mit halbem Leck) und kann dort einen Brand auslösen (Wahrscheinlichkeit = Schaden / 150); ein Versagen des Druckkörpers unter der Testtiefe schlägt ebenfalls ein Leck (siehe Unter der Testtiefe). Durch ein volles Leck dringen in 100 m Tiefe 40 kg/s ein, mit der Wurzel der Tiefe mehr; über halbvoll läuft das Wasser in offene Nachbarabteilungen über (20 kg/s) und erstickt einen Brand. Ein Brand wächst in 2 min zum Vollbrand und greift dann durch offene Schotten über; Seewasser im Batterieraum (ab 2 t) setzt Chlorgas frei, das durch offene Schotten zieht und erst langsam abzieht, wenn die Batterie trocken ist. Wasser im Batterieraum (ab 5 t) oder ein Brand dort legen den **Strom** lahm: der Motor steht (keine Fahrt, also halten die Tiefenruder ein schweres Boot nicht), Trimmpumpen, Kompressor und elektrische Lenzpumpen stehen still. **Schotten schließen** hält Wasser, Brand und Gas in der Abteilung und erstickt einen Brand dort in 3 min. Zwei **Leckwehrtrupps** gehen durchs Boot (8 s je Abteilung) und **dichten ein Leck ab** (ein volles in 60 s), **lenzen** (30 kg/s, ohne Strom ein Viertel von Hand) oder **löschen einen Brand** (einen Vollbrand in 60 s); im Gas arbeiten sie halb so schnell, und in einer zu 90 % vollen Abteilung können sie nur lenzen. Eine Abteilung, die zur Hälfte voll Wasser ist, halb brennt oder halb vergast ist, legt ihre Station lahm: der Bugraum die Torpedorohre, die Zentrale Mast und Sehrohr, der Maschinenraum die Diesel, der Heckraum die halbe Höchstfahrt. Das Wasser ist Gewicht und Moment für den Trimm (siehe oben); ein Boot, das unter die 1,5-fache Testtiefe sinkt, wird zerdrückt. Das Log meldet Lecks, Brände, abgedichtete Lecks, gelöschte Brände, vollgelaufene Abteilungen, Chlorgas und den Strom. - **Unter der Testtiefe:** die Crew darf das besetzte Boot unter seine Testtiefe befehlen, bis zur Zerstörungstiefe (1,5-fache Testtiefe); die Stufe "tief" und das Auf-Grund-Legen bleiben bei der sicheren Tiefe. Die Tiefenleiter am uConsole und im Browser markieren die Zerstörungstiefe, und solange das Boot unter der Testtiefe ist, zeigen die Führung am uConsole den roten Alarm **UNTER TESTTIEFE** und der Browser einen roten Alarmchip, beide mit Test- und Zerstörungstiefe. Ab 90 % der Testtiefe ermüdet der Druckkörper wie bisher (ein Versagen in etwa 30 min bei Testtiefe); unter der Testtiefe versagt er viel schneller, mit dem Quadrat der Überschreitung: etwa alle 6 min bei 110 %, jede Minute bei 125 % und alle 20 s bei 140 %. Jedes Versagen ist eines von dreien: **gebrochene Bolzen** einer Armatur (ein Viertelleck in einer zufälligen Abteilung, 6 % Schaden), eine **versagende Dichtung** an Welle oder Ventil (ein halbes Leck im Maschinen- oder Heckraum, 12 % Schaden) oder ein **Riss im Druckkörper** (ein volles Leck und ein 60-%-Leck in der Nachbarabteilung, 30 % Schaden). Knapp unter der Testtiefe reißt der Druckkörper nicht; die Wahrscheinlichkeit steigt um 15 % je 10 % Überschreitung, bis 60 %, und vom Rest versagt in 30 % eine Dichtung. Das Log meldet jedes Versagen mit der Abteilung, und in Zerstörungstiefe bricht der Druckkörper zusammen und das Boot ist verloren. Die Boote der KI halten ihre Testtiefe. +- **Atmosphäre:** das Boot hat eigene Geräusche, am uConsole, wenn er das Boot spielt, und in den Browsern des Boots bei eingeschaltetem Ton (nie auf der Fregatte). Ab 60 % der Testtiefe knarzt der Rumpf, erst ab und zu, ab der Testtiefe alle 4 s; ein Versagen des Druckkörpers kracht. Jede Detonation im Wasser im Umkreis von 30 sm (ein Torpedo- oder Flugkörpertreffer, ein torpediertes Handelsschiff) ist zu hören: innerhalb von 2 sm als schwerer Schlag dicht beim Boot, weiter weg als dumpfes, fernes Grollen, und das Log meldet sie mit der Peilung, die die Ohren der Crew liefern (einige Grad daneben). Bei **Schleichfahrt** schaltet das Boot auf Rotlicht: die Boot-Bildschirme am uConsole und die Führungsstationen des Boots im Browser werden gedimmt rot, bis die Schleichfahrt endet. - **Besatzung:** das Boot hat einen eigenen Wachplan mit den Regeln der Fregatte (siehe Schadensabwehr, Besatzung und Wachen): drei Wachen, Ermüdung, Gefechtsstationen und Moral. Maschine und Führung befehlen Gefechtsstationen (`B` auf der uConsole, eine Taste in der Leckwehr-Karte im Browser) und lösen die Wache ab (`M` auf der Seite Leckwehr oder die Taste). Die Moral steigt, wenn ein Schiff sinkt, und sinkt mit je 10 % Rumpfschaden. Eine müde Besatzung hört am Sonar später, sichtet durch das Sehrohr später und ihre Leckwehrtrupps dichten und löschen langsamer (die Pumpen sind Maschinen und behalten ihre Leistung). - **Lagebild:** ein gehörter Aktivping oder Torpedo wird mit der Peilung protokolliert, die das Boot selbst gemessen hat (einige Grad ungenau), und mit seinem Alter in den Alarmen angezeigt. Auf Sehrohrtiefe lässt sich der **Mast** ausfahren; sein ESM meldet dann die Radare, die das Boot überstreichen, mit Peilung (Log und ESM-Liste), und beim Tieferkommen fährt der Mast selbst ein. Mit ausgefahrenem Mast zeigt die Seite **Sehrohr** (Führung Seite 3, Mast & ESM Seite 2; `P` fährt an beiden den Mast aus) das Okular: Himmel und See im Licht der Stunde, den mit der See bewegten Horizont, eine Skala rechtweisender Peilungen und ein Fadenkreuz; das Rohr schwenkt in 2°-Schritten (`←`/`→`, `Umschalt`: 10°). Alles, was die Optik im Kontrastmodell des Fregattenausgucks bei 2,5 m Augenhöhe ausmacht (Tag/Nacht, Mond, Sicht, Seegang, Land im Weg), erscheint als Silhouette und als reine Peilungs-**Sichtung** mit grober Klasse (Kriegsschiff, Handelsschiff, Fahrzeug, Luftfahrzeug, Torpedolaufbahn) und scheinbarer Länge; das Log meldet jede neue Sichtung. `Enter` liest das **Stadimeter** an der Sichtung unter dem Fadenkreuz ab: die Entfernung folgt aus der scheinbaren Länge und der angenommenen Rumpflänge der Klasse (130 m für ein Kriegsschiff oder ein nicht erkanntes Fahrzeug, 150 m für ein Handelsschiff), ein nicht erkanntes oder bugwärts stehendes Ziel misst sich also zu weit; die Ablesung ist ±25 % und wird für 120 s zu einem VISUAL-Fix am Sonarkontakt des Boots auf dieses Ziel, für einen Schuss nutzbar wie ein Ping-Fix. Luftfahrzeuge und Laufbahnen lassen sich nicht messen. Jede Ablesung ist zugleich eine **Marke** für den **Angriffsrechner**: aus zwei oder mehr Marken im Abstand von mindestens einer Minute (die letzten sechs innerhalb von 15 Minuten) legt er eine Gerade durch Kurs und Fahrt des Ziels und zeigt mit der Torpedogeschwindigkeit den Vorhaltewinkel (links oder rechts der Peilung) und die Laufzeit unter dem Sehrohr (Browser: Spalte Lösung); die Güte wächst mit der Zeit zwischen erster und letzter Marke (voll nach 5 Minuten) und mit der Zahl der Marken. `Strg+Enter` auf der Sehrohrseite (Browser: Schuss nach Lösung, nur die Führung) schießt nach der Lösung der Sichtung unter dem Fadenkreuz: der Torpedo läuft auf dem Abfangkurs zu dem Punkt, an dem Ziel und Torpedo zusammentreffen. Ein Schuss auf den Sonarkontakt eines markierten Ziels nutzt die Lösung ebenfalls. Ein Ziel, das nach der letzten Marke dreht, lässt die Lösung hinter sich; eine Anpassung schneller als 40 kn wird als schlechte Marke verworfen. Die Marken gehören zum Spielstand. Die kartierte Küste steht auf dem Horizont des Sehrohrs, so weit seine niedrige Optik Land sieht (Hügel mit 25 bis 70 m angenommen). Die Führung kann auch ohne Sonarbediener pingen und eine BT-Messung nehmen. Die Karte zeigt das Schussfeld der Rohre, wo sie nicht rundum schießen, und das vom Sonar zugewiesene Ziel ist für den Schuss vorausgewählt. - **Mast & ESM:** mit ausgefahrenem Mast auf Sehrohrtiefe hört die ESM-Antenne des Boots (3 m über Wasser) einmal pro Sekunde die Radare ringsum: das der Fregatte, anderer Schiffe und von Flugzeugen innerhalb des Radarhorizonts, über Land nur, wo die Küste die Linie nicht verdeckt. Der Hubschrauber der Fregatte strahlt sein X-Band-Suchradar, solange er fliegt und nicht taucht (Antenne in 150 m), der Seefernaufklärer sein frequenzagiles Suchradar, solange die OPZ es eingeschaltet hat. Jede Erfassung trägt die gemessene Peilung (±4°), Band, Trägerfrequenz, PRF, Modulation und Empfangspegel, nie die Identität oder Position des Senders. Die Crew führt eine **Emitterliste** (`E1`, `E2` …) über mehrere Mastperioden: eine Erfassung gehört zu einem Emitter, wenn Peilung, Band und Signalform passen (ein frequenzagiles Radar nur nach Peilung und Band), und die Liste vergisst einen Emitter 30 Minuten nach seiner letzten Erfassung. Die **Einstufung** ist die Annotation der Crew aus der Bibliothek: die Emitter, deren veröffentlichte Frequenz- und PRF-Bereiche die Messung enthalten, ungewichtet, wie an der ELOKA der Fregatte ohne Assistenz; die Wahl legt die Leistungsklasse für die **Entfernungsschätzung** aus dem Pegel fest (ohne Einstufung die kürzeste Entfernung, die die Bibliothek zulässt). Alle 30 s behält jeder Emitter eine **Peilung** von der eigenen Position des Boots (20 Minuten); die Karte zeigt die letzten Peillinien, und sobald die eigene Fahrt die Peilung um mindestens 8° gedreht hat, ist die **Kreuzpeilung** ihr bester Schnittpunkt mit einer 95-%-Fehlerellipse, die einen seit jeder Linie bis zu 8 kn versetzten Sender einrechnet (eine schnelle Fregatte ergibt meist keine; eine Kreuzpeilung, deren Linien nicht zusammenpassen, wird markiert). Der **Stärketrend** zeigt steigend, gleichbleibend oder fallend über fünf Minuten. Die **Mastwarnung** („Radar kann Mast sehen“) kommt, wenn die geschätzte Entfernung eines erfassten Suchradars innerhalb der Entfernung liegt, auf der ein Seeraumradar bei diesem Seegang und Regen einen ausgefahrenen Mast sieht (der Wert der Wetterseite); die **empfohlene Mastzeit** ist 60 s bei ruhiger See, bis zu 300 s, wenn die Seegangsechos den Mast verbergen, und 20 s unter dieser Warnung, und das Log meldet, wenn sie überschritten ist. Ab Seegang 3 überspülen Wellen die Antenne, und manche Durchläufe hören nichts. Die Karte Mast & ESM im Browser hat die Rose, die Emittertabelle und die Auswertung des gewählten Emitters; **In den Plot übernehmen** trägt die Kreuzpeilung (Markierung und Fehlerkreis) oder sonst die letzte Peillinie in den Plot des Boots ein. Auf der Seite Mast & ESM der uConsole wählen `↑`/`↓` einen Emitter, `←`/`→` schalten seine Einstufung aus der Bibliothek weiter und `Enter` übernimmt ihn in den Plot. @@ -156,6 +157,7 @@ Wenn niemand die Fregatte fährt (die uConsole spielt das Boot oder ein Solo-Bro - Der Funkraum kennt nur den Rundspruchplan der Führung und Lagemeldungen: keine Befehle oder Nachrichten der Führung, kein Empfang in der Tiefe (kein VLF/ELF), keine Kurzsignale und keine anderen Einheiten im Netz; die Feindlage der Führung ist modellierte Aufklärung, kein eigener Sensor. - Die Leckwehr kennt sechs Abteilungen und zwei Trupps: keine getrennten Schäden an Druck- und Außenhülle, keine Verletzten, keine Ausbreitung von Rauch oder Hitze, kein Brand in den Luftvorräten und kein Sauerstoffverbrauch durch Feuer; der Gesamtschaden des Boots (Lärm, Höchstfahrt, Untergang bei 100 %) summiert sich weiter aus Treffern, und die KI-Boote haben nur diesen Wert. - Unter der Testtiefe kennt der Druckkörper keine einzelnen Armaturen, kein allmähliches Zusammendrücken und keine verstärkten Nähte aus einer Werftzeit; ein Versagen wählt Art und Abteilung zufällig, und ein zerdrücktes Boot ist sofort verloren. +- Die Geräusche des Boots sind einfache Signale: keine Richtung (Stereo) einer Detonation, keine Entfernungsschätzung daraus und kein Knarzen aus einer bestimmten Abteilung; der Sonarraum des Boots hat kein Rotlicht. - Das Trimmmodell kennt ein Gewicht und ein Moment: keinen Effekt freier Oberflächen, keine Kompressibilität des Druckkörpers mit der Tiefe und keine eigene Schnelltauchzelle; das Boot taucht nicht ganz auf. Proviant und Frischwasser gehen nicht aus. - Ein ausgefahrener Mast oder Schnorchelkopf erscheint auf dem Fregattenradar nur als bloßer Punkt (siehe Kapitel OPZ). - Das ESM des Boots hört keine Radare anderer U-Boote und keine Flugkörpersucher; es hat keine gewichtete Bibliotheksanalyse, keine Messung der Umlaufzeit und keine Bewegungsanalyse eines Senders (die Kreuzpeilung nimmt einen langsamen Sender an). diff --git a/data/manual/10-reference.en.md b/data/manual/10-reference.en.md index 869c0da0..e78ba02d 100644 --- a/data/manual/10-reference.en.md +++ b/data/manual/10-reference.en.md @@ -111,6 +111,7 @@ A second crew can play the enemy. The boat has seven stations: Command, Sonar, W - **Tanks, trim and air:** the engine room's **Tanks & trim** (browser card with a cross-section of the boat, uConsole Engine room page 3 **Tanks**) shows the main ballast, the regulating tank, the trim tanks, the high-pressure air and the trim the boat is in. Every weight change moves the boat off neutral: a torpedo leaving a bow tube makes it 1.5 t lighter and bow light, water in flooded compartments (see damage control) makes it heavier and trims it toward the flooded end; the automatic trim takes up what its tanks can of that weight and moment. With the **automatic trim** on, the engineer pumps the regulating tank (±8 t, 25 kg/s) and the trim tanks (±3 t fore and aft, 15 kg/s) back to neutral; by hand, each order moves the regulating tank 0.5 t or the trim water 0.25 t (and switches the automatic off). Running trim pumps are audible (+3 dB and a 120 Hz line). Whatever the tanks cannot take up sinks or lifts the boat by 0.03 m/s per tonne, and a trim angle (1° per tonne of moment, + bow down) drives it down or up with speed; the hydroplanes hold that only with way on, so a heavy boat hovering at low speed sinks below its ordered depth; the log warns from 2 t and from 3°. The **high-pressure air** (200 bar) holds three emergency blows of 60 bar each; a blow empties the main ballast in 20 s and the boat rises to 10 m and stays there, the ordered depth reset to 10 m. The next order below 12 m opens the vents: the main ballast floods in 40 s before the boat can dive. Snorkelling on the diesels runs the compressor (0.05 bar/s); with the air only on the fans it does not. Without power neither the trim pumps nor the compressor run. The AI's boats keep themselves trimmed and keep their one legacy blow. - **Damage control:** the engine room's **Damage control** (browser card with the compartments and a table, uConsole Engine room page 4 **Damage**) divides the pressure hull into six compartments: bow room, control room, quarters, battery room, engine room and stern room. A hit on the crewed boat holes the compartment it strikes (a leak of 1.5 % per % of hit damage, up to a full hole; from 50 % damage the neighbour too, with half the leak) and may start a fire there (chance = damage / 150); a hull failure below test depth holes it as well (see Below test depth). Water comes in at 40 kg/s through a full hole at 100 m, growing with the square root of depth; above half a compartment it spills into open neighbours (20 kg/s) and smothers a fire. A fire grows to full in 2 min and then spreads through open bulkheads; seawater in the battery room (from 2 t) gives off chlorine gas that drifts through open bulkheads and clears slowly once the battery is dry. Water in the battery room (from 5 t) or a fire there cuts the **power**: the motor stops (no way on, so the hydroplanes do not hold a heavy boat), and the trim pumps, compressor and electric bilge pumps stand still. **Shutting the bulkheads** of a compartment keeps water, fire and gas in it and starves a fire there in 3 min. Two **damage-control teams** walk the boat (8 s per compartment) and **seal a leak** (a full hole in 60 s), **pump out** (30 kg/s, a quarter by hand without power) or **fight a fire** (a full fire in 60 s); in gas they work at half rate, and in a compartment 90 % full they can only pump. A compartment half full of water, half on fire or half gassed takes its station out: the bow room the torpedo tubes, the control room the mast and periscope, the engine room the diesels, the stern room half the top speed. The floodwater is weight and moment for the trim (see above); a boat that sinks below 1.5 x test depth is crushed. The log reports leaks, fires, sealed leaks, fires out, flooded compartments, chlorine and power. - **Below test depth:** the crew may order the crewed boat below its test depth, down to crush depth (1.5 x test depth); the "deep" step and lying on the bottom stay at the safe depth. The uConsole's and the browser's depth columns mark the crush depth, and while the boat is below test depth Command on the uConsole shows a red **BELOW TEST DEPTH** alarm and the browser a red alarm chip, both with the test and crush depths. From 90 % of test depth the hull fatigues as before (one failure in about 30 min at test depth); below test depth failures come far faster, growing with the square of the excess: about one every 6 min at 110 %, one a minute at 125 % and one every 20 s at 140 %. Each failure is one of three: **sheared bolts** of a fitting (a quarter leak in a random compartment, 6 % damage), a **failed seal** of a shaft or valve (half a leak in the engine or stern room, 12 % damage) or a **cracked pressure hull** (a full leak and a 60 % leak in the neighbour, 30 % damage). Just past test depth a crack does not happen; its chance grows by 15 % per 10 % of excess, up to 60 %, and a seal fails in 30 % of the rest. The log reports every failure with its compartment, and at crush depth the hull collapses and the boat is lost. The AI's boats keep to their test depth. +- **Atmosphere:** the boat has its own sounds, on the uConsole when it plays the boat and in the boat's browsers with sound on (never on the frigate's). From 60 % of test depth the hull creaks, now and then at first and every 4 s at test depth and below; a hull failure cracks. Every detonation in the water within 30 NM (a torpedo or missile hit, a merchant torpedoed) is heard: within 2 NM as a heavy blast close aboard, farther off as a dull distant rumble, and the log reports it with the bearing the crew's ears give (a few degrees off). In **silent running** the boat rigs for red: the uConsole's boat screens and the browser's boat command stations turn to dimmed red light until silent running ends. - **Crew:** the boat has its own watch bill with the frigate's rules (see Damage control, Crew and watches): three watches, fatigue, action stations and morale. The Engine room and Command order action stations (`B` on the uConsole, a button in the browser's Damage control card) and relieve the watch (`M` on the Damage page, or the button). Morale rises when a ship sinks and falls with every 10 % of hull damage. A tired crew hears later on sonar, sights later through the periscope and its damage-control teams seal and fight fire more slowly (the pumps are machinery and keep their rate). - **Situation picture:** an intercepted active ping or torpedo is logged with the bearing the boat's own ears measured (a few degrees off) and shown with its age in the alarms. At periscope depth the **mast** can be raised; its ESM then reports the radars sweeping the boat with bearing (log and ESM list), and the mast lowers by itself when the boat goes deeper. With the mast up the **periscope** page (Command page 3, Mast & ESM page 2; `P` raises the mast at both) shows the eyepiece: sky and sea in the light of the hour, the horizon moving with the sea, a true-bearing scale and a crosshair; the scope trains in 2° steps (`←`/`→`, `Shift`: 10°). Everything the optics make out within the frigate lookout's contrast model at 2.5 m eye height (day/night, moon, visibility, sea state, land in the way) appears as a silhouette and as a bearing-only **sighting** with a coarse class (warship, merchant ship, vessel, aircraft, torpedo wake) and its apparent length; the log reports each new sighting. `Enter` reads the **stadimeter** on the sighting under the crosshair: the range follows from its apparent length and the assumed hull length of the class (130 m for a warship or an unrecognized vessel, 150 m for a merchant), so an unrecognized or bow-on target reads long; the reading is ±25 % and becomes a VISUAL fix on the boat's sonar contact of that target for 120 s, usable for a shot like a ping fix. Aircraft and wakes cannot be ranged. Each reading is also a **mark** for the **attack computer**: from two or more marks at least a minute apart (the last six within 15 minutes) it fits the target's course and speed in a straight line and, with the torpedo's speed, shows the lead angle (left or right of the bearing) and the running time under the periscope (browser: the Solution column); the quality grows with the time between the first and last mark (full at 5 minutes) and the number of marks. `Ctrl+Enter` on the periscope page (browser: Fire on solution, Command only) fires on the solution of the sighting under the crosshair: the torpedo runs on the intercept course to the point where target and torpedo meet. A shot at the sonar contact of a marked target uses the solution as well. A target turning after the last mark leaves the solution behind; a faster fit than 40 kn is rejected as a bad mark. The marks are part of the saved game. The charted coast stands on the periscope's horizon as far as its low optics see land (hills assumed 25 to 70 m). Command can also ping and take a BT without a sonar operator. The chart shows the tube firing arc where the tubes cannot fire all round, and the sonar room's assigned target is preselected for the shot. - **Mast & ESM:** with the mast up at periscope depth the boat's own ESM antenna (3 m above the water) hears the radars around it once a second: the frigate's, other ships' and aircraft radars inside the radar horizon, over land only where the coast does not block the line. The frigate's helicopter radiates its X-band search radar while it flies and is not dipping (antenna at 150 m), the patrol aircraft its frequency-agile search radar while the OPZ has it switched on. Each intercept carries the measured bearing (±4°), band, carrier frequency, PRF, modulation and received level, never the emitter's identity or position. The crew keeps an **emitter list** (`E1`, `E2` …) across mast periods: an intercept joins an emitter when bearing, band and waveform agree (a frequency-agile radar by bearing and band only), and the list forgets an emitter 30 minutes after its last intercept. **Classification** is the crew's annotation from the library: the emitters whose published frequency and PRF ranges hold the measurement, unranked, as at the frigate's ELOKA without assistance; the choice sets the power class for the **range estimate** from the level (unclassified: the shortest range the library allows). Every 30 s each emitter keeps a **bearing** from the boat's own position (20 minutes); the chart shows the latest bearing lines, and once the boat's own motion has swung the bearing by at least 8°, the **cross-fix** is their best crossing with a 95 % error ellipse that allows for an emitter drifting up to 8 kn since each line (a fast frigate usually gives none; a fix whose lines disagree is marked). The **level trend** reads rising, steady or falling over five minutes. The **mast warning** ("radar can see the mast") comes when a live search radar's estimated range is inside the range at which a surface radar sees a raised mast in this sea and rain (the weather page's value); the **recommended mast time** is 60 s in a calm sea, up to 300 s when sea clutter hides the mast and 20 s under that warning, and the log reports when it is exceeded. From sea state 3 waves wash over the antenna and some scans hear nothing. The browser's Mast & ESM card has the rose, the emitter table and the selected emitter's evaluation; **Transfer to plot** puts the cross-fix (mark and error circle) or else the latest bearing line into the boat's plot. On the uConsole's Mast & ESM page `↑`/`↓` select an emitter, `←`/`→` step through its library classification and `Enter` transfers it to the plot. @@ -156,6 +157,7 @@ When nobody sails the frigate (the uConsole plays the boat, or a solo browser pl - The radio room knows only HQ's broadcast schedule and situation reports: no orders or messages from HQ, no reception while deep (no VLF/ELF), no burst transmission and no other units on the net; HQ's contact report is modelled intelligence, not a sensor of its own. - Damage control is six compartments and two teams: no separate pressure-hull and outer-hull damage, no casualties, no smoke or heat spreading, no fire in the air stores and no fire consuming oxygen; the boat's overall damage (noise, top speed, sinking at 100 %) still adds up from hits, and the AI's boats keep only that value. - Below test depth the hull has no individual fittings, no gradual shrinking of the hull and no stronger welds from a refit; a failure picks its kind and compartment at random, and a crushed boat is lost at once. +- The boat's sounds are simple cues: no direction (stereo) for a detonation, no range estimate from it and no creak from a particular compartment; the boat's sonar room has no red light. - The trim model is one weight and one moment: no free-surface effect, no compressibility of the hull with depth and no separate negative tank; the boat does not surface fully. Food and fresh water do not run out. - A raised mast or snorkel head is seen by the frigate's radar only as a bare blip (see the OPZ chapter). - The boat's ESM hears no other submarine's radar and no missile seeker; it has no scored library analysis, no scan-period measurement and no target motion analysis of an emitter (the cross-fix assumes a slow emitter). diff --git a/docs/manual/handbuch.de.pdf b/docs/manual/handbuch.de.pdf index a5bfa5b1..a41cb90f 100644 Binary files a/docs/manual/handbuch.de.pdf and b/docs/manual/handbuch.de.pdf differ diff --git a/docs/manual/manual.de.md b/docs/manual/manual.de.md index 41e37688..5a1d037e 100644 --- a/docs/manual/manual.de.md +++ b/docs/manual/manual.de.md @@ -1110,6 +1110,7 @@ Eine zweite Crew kann den Gegner spielen. Das Boot hat sieben Stationen: Führun - **Tauchzellen, Trimm und Pressluft:** die Maschine zeigt unter **Tauchzellen & Trimm** (Karte im Browser mit Schnittbild des Boots, auf der uConsole Maschine Seite 3 **Zellen**) die Hauptzellen, die Regelzelle, die Trimmzellen, die Pressluft und den Trimmzustand des Boots. Jede Gewichtsänderung bringt das Boot aus dem Gleichgewicht: ein Torpedo aus einem Bugrohr macht es 1,5 t leichter und achterlastig, Wasser in vollgelaufenen Abteilungen (siehe Leckwehr) macht es schwerer und trimmt es zum gefluteten Ende; die Trimmautomatik gleicht davon aus, was ihre Zellen fassen. Mit der **Trimmautomatik** pumpt der LI die Regelzelle (±8 t, 25 kg/s) und die Trimmzellen (±3 t vorn und achtern, 15 kg/s) zurück ins Gleichgewicht; von Hand verschiebt jeder Befehl die Regelzelle um 0,5 t oder das Trimmwasser um 0,25 t (und schaltet die Automatik aus). Laufende Trimmpumpen sind hörbar (+3 dB und eine Linie bei 120 Hz). Was die Zellen nicht aufnehmen, lässt das Boot mit 0,03 m/s je Tonne sinken oder steigen, und ein Trimmwinkel (1° je Tonne Moment, + vorlastig) drückt es mit Fahrt nach unten oder oben; die Tiefenruder halten das nur mit Fahrt, ein schweres Boot sinkt bei wenig Fahrt unter seine befohlene Tiefe; das Log warnt ab 2 t und ab 3°. Die **Pressluft** (200 bar) reicht für drei Notanblasungen zu je 60 bar; Anblasen leert die Hauptzellen in 20 s, das Boot steigt auf 10 m und bleibt dort, die befohlene Tiefe steht dann auf 10 m. Der nächste Befehl unter 12 m öffnet die Entlüftung: die Hauptzellen fluten in 40 s, erst dann kann das Boot tauchen. Schnorcheln auf Diesel betreibt den Kompressor (0,05 bar/s); mit nur lüften läuft er nicht. Ohne Strom laufen weder Trimmpumpen noch Kompressor. Die KI-Boote halten sich selbst im Trimm und behalten ihr eines Notanblasen. - **Leckwehr:** die Maschine zeigt unter **Leckwehr** (Karte im Browser mit den Abteilungen und einer Tabelle, auf der uConsole Maschine Seite 4 **Leckwehr**) den Druckkörper in sechs Abteilungen: Bugraum, Zentrale, Wohnraum, Batterieraum, Maschinenraum und Heckraum. Ein Treffer auf das besetzte Boot schlägt ein Leck in die getroffene Abteilung (1,5 % Leck je % Trefferschaden, höchstens ein volles Leck; ab 50 % Schaden auch in die Nachbarabteilung mit halbem Leck) und kann dort einen Brand auslösen (Wahrscheinlichkeit = Schaden / 150); ein Versagen des Druckkörpers unter der Testtiefe schlägt ebenfalls ein Leck (siehe Unter der Testtiefe). Durch ein volles Leck dringen in 100 m Tiefe 40 kg/s ein, mit der Wurzel der Tiefe mehr; über halbvoll läuft das Wasser in offene Nachbarabteilungen über (20 kg/s) und erstickt einen Brand. Ein Brand wächst in 2 min zum Vollbrand und greift dann durch offene Schotten über; Seewasser im Batterieraum (ab 2 t) setzt Chlorgas frei, das durch offene Schotten zieht und erst langsam abzieht, wenn die Batterie trocken ist. Wasser im Batterieraum (ab 5 t) oder ein Brand dort legen den **Strom** lahm: der Motor steht (keine Fahrt, also halten die Tiefenruder ein schweres Boot nicht), Trimmpumpen, Kompressor und elektrische Lenzpumpen stehen still. **Schotten schließen** hält Wasser, Brand und Gas in der Abteilung und erstickt einen Brand dort in 3 min. Zwei **Leckwehrtrupps** gehen durchs Boot (8 s je Abteilung) und **dichten ein Leck ab** (ein volles in 60 s), **lenzen** (30 kg/s, ohne Strom ein Viertel von Hand) oder **löschen einen Brand** (einen Vollbrand in 60 s); im Gas arbeiten sie halb so schnell, und in einer zu 90 % vollen Abteilung können sie nur lenzen. Eine Abteilung, die zur Hälfte voll Wasser ist, halb brennt oder halb vergast ist, legt ihre Station lahm: der Bugraum die Torpedorohre, die Zentrale Mast und Sehrohr, der Maschinenraum die Diesel, der Heckraum die halbe Höchstfahrt. Das Wasser ist Gewicht und Moment für den Trimm (siehe oben); ein Boot, das unter die 1,5-fache Testtiefe sinkt, wird zerdrückt. Das Log meldet Lecks, Brände, abgedichtete Lecks, gelöschte Brände, vollgelaufene Abteilungen, Chlorgas und den Strom. - **Unter der Testtiefe:** die Crew darf das besetzte Boot unter seine Testtiefe befehlen, bis zur Zerstörungstiefe (1,5-fache Testtiefe); die Stufe "tief" und das Auf-Grund-Legen bleiben bei der sicheren Tiefe. Die Tiefenleiter am uConsole und im Browser markieren die Zerstörungstiefe, und solange das Boot unter der Testtiefe ist, zeigen die Führung am uConsole den roten Alarm **UNTER TESTTIEFE** und der Browser einen roten Alarmchip, beide mit Test- und Zerstörungstiefe. Ab 90 % der Testtiefe ermüdet der Druckkörper wie bisher (ein Versagen in etwa 30 min bei Testtiefe); unter der Testtiefe versagt er viel schneller, mit dem Quadrat der Überschreitung: etwa alle 6 min bei 110 %, jede Minute bei 125 % und alle 20 s bei 140 %. Jedes Versagen ist eines von dreien: **gebrochene Bolzen** einer Armatur (ein Viertelleck in einer zufälligen Abteilung, 6 % Schaden), eine **versagende Dichtung** an Welle oder Ventil (ein halbes Leck im Maschinen- oder Heckraum, 12 % Schaden) oder ein **Riss im Druckkörper** (ein volles Leck und ein 60-%-Leck in der Nachbarabteilung, 30 % Schaden). Knapp unter der Testtiefe reißt der Druckkörper nicht; die Wahrscheinlichkeit steigt um 15 % je 10 % Überschreitung, bis 60 %, und vom Rest versagt in 30 % eine Dichtung. Das Log meldet jedes Versagen mit der Abteilung, und in Zerstörungstiefe bricht der Druckkörper zusammen und das Boot ist verloren. Die Boote der KI halten ihre Testtiefe. +- **Atmosphäre:** das Boot hat eigene Geräusche, am uConsole, wenn er das Boot spielt, und in den Browsern des Boots bei eingeschaltetem Ton (nie auf der Fregatte). Ab 60 % der Testtiefe knarzt der Rumpf, erst ab und zu, ab der Testtiefe alle 4 s; ein Versagen des Druckkörpers kracht. Jede Detonation im Wasser im Umkreis von 30 sm (ein Torpedo- oder Flugkörpertreffer, ein torpediertes Handelsschiff) ist zu hören: innerhalb von 2 sm als schwerer Schlag dicht beim Boot, weiter weg als dumpfes, fernes Grollen, und das Log meldet sie mit der Peilung, die die Ohren der Crew liefern (einige Grad daneben). Bei **Schleichfahrt** schaltet das Boot auf Rotlicht: die Boot-Bildschirme am uConsole und die Führungsstationen des Boots im Browser werden gedimmt rot, bis die Schleichfahrt endet. - **Besatzung:** das Boot hat einen eigenen Wachplan mit den Regeln der Fregatte (siehe Schadensabwehr, Besatzung und Wachen): drei Wachen, Ermüdung, Gefechtsstationen und Moral. Maschine und Führung befehlen Gefechtsstationen (`B` auf der uConsole, eine Taste in der Leckwehr-Karte im Browser) und lösen die Wache ab (`M` auf der Seite Leckwehr oder die Taste). Die Moral steigt, wenn ein Schiff sinkt, und sinkt mit je 10 % Rumpfschaden. Eine müde Besatzung hört am Sonar später, sichtet durch das Sehrohr später und ihre Leckwehrtrupps dichten und löschen langsamer (die Pumpen sind Maschinen und behalten ihre Leistung). - **Lagebild:** ein gehörter Aktivping oder Torpedo wird mit der Peilung protokolliert, die das Boot selbst gemessen hat (einige Grad ungenau), und mit seinem Alter in den Alarmen angezeigt. Auf Sehrohrtiefe lässt sich der **Mast** ausfahren; sein ESM meldet dann die Radare, die das Boot überstreichen, mit Peilung (Log und ESM-Liste), und beim Tieferkommen fährt der Mast selbst ein. Mit ausgefahrenem Mast zeigt die Seite **Sehrohr** (Führung Seite 3, Mast & ESM Seite 2; `P` fährt an beiden den Mast aus) das Okular: Himmel und See im Licht der Stunde, den mit der See bewegten Horizont, eine Skala rechtweisender Peilungen und ein Fadenkreuz; das Rohr schwenkt in 2°-Schritten (`←`/`→`, `Umschalt`: 10°). Alles, was die Optik im Kontrastmodell des Fregattenausgucks bei 2,5 m Augenhöhe ausmacht (Tag/Nacht, Mond, Sicht, Seegang, Land im Weg), erscheint als Silhouette und als reine Peilungs-**Sichtung** mit grober Klasse (Kriegsschiff, Handelsschiff, Fahrzeug, Luftfahrzeug, Torpedolaufbahn) und scheinbarer Länge; das Log meldet jede neue Sichtung. `Enter` liest das **Stadimeter** an der Sichtung unter dem Fadenkreuz ab: die Entfernung folgt aus der scheinbaren Länge und der angenommenen Rumpflänge der Klasse (130 m für ein Kriegsschiff oder ein nicht erkanntes Fahrzeug, 150 m für ein Handelsschiff), ein nicht erkanntes oder bugwärts stehendes Ziel misst sich also zu weit; die Ablesung ist ±25 % und wird für 120 s zu einem VISUAL-Fix am Sonarkontakt des Boots auf dieses Ziel, für einen Schuss nutzbar wie ein Ping-Fix. Luftfahrzeuge und Laufbahnen lassen sich nicht messen. Jede Ablesung ist zugleich eine **Marke** für den **Angriffsrechner**: aus zwei oder mehr Marken im Abstand von mindestens einer Minute (die letzten sechs innerhalb von 15 Minuten) legt er eine Gerade durch Kurs und Fahrt des Ziels und zeigt mit der Torpedogeschwindigkeit den Vorhaltewinkel (links oder rechts der Peilung) und die Laufzeit unter dem Sehrohr (Browser: Spalte Lösung); die Güte wächst mit der Zeit zwischen erster und letzter Marke (voll nach 5 Minuten) und mit der Zahl der Marken. `Strg+Enter` auf der Sehrohrseite (Browser: Schuss nach Lösung, nur die Führung) schießt nach der Lösung der Sichtung unter dem Fadenkreuz: der Torpedo läuft auf dem Abfangkurs zu dem Punkt, an dem Ziel und Torpedo zusammentreffen. Ein Schuss auf den Sonarkontakt eines markierten Ziels nutzt die Lösung ebenfalls. Ein Ziel, das nach der letzten Marke dreht, lässt die Lösung hinter sich; eine Anpassung schneller als 40 kn wird als schlechte Marke verworfen. Die Marken gehören zum Spielstand. Die kartierte Küste steht auf dem Horizont des Sehrohrs, so weit seine niedrige Optik Land sieht (Hügel mit 25 bis 70 m angenommen). Die Führung kann auch ohne Sonarbediener pingen und eine BT-Messung nehmen. Die Karte zeigt das Schussfeld der Rohre, wo sie nicht rundum schießen, und das vom Sonar zugewiesene Ziel ist für den Schuss vorausgewählt. - **Mast & ESM:** mit ausgefahrenem Mast auf Sehrohrtiefe hört die ESM-Antenne des Boots (3 m über Wasser) einmal pro Sekunde die Radare ringsum: das der Fregatte, anderer Schiffe und von Flugzeugen innerhalb des Radarhorizonts, über Land nur, wo die Küste die Linie nicht verdeckt. Der Hubschrauber der Fregatte strahlt sein X-Band-Suchradar, solange er fliegt und nicht taucht (Antenne in 150 m), der Seefernaufklärer sein frequenzagiles Suchradar, solange die OPZ es eingeschaltet hat. Jede Erfassung trägt die gemessene Peilung (±4°), Band, Trägerfrequenz, PRF, Modulation und Empfangspegel, nie die Identität oder Position des Senders. Die Crew führt eine **Emitterliste** (`E1`, `E2` …) über mehrere Mastperioden: eine Erfassung gehört zu einem Emitter, wenn Peilung, Band und Signalform passen (ein frequenzagiles Radar nur nach Peilung und Band), und die Liste vergisst einen Emitter 30 Minuten nach seiner letzten Erfassung. Die **Einstufung** ist die Annotation der Crew aus der Bibliothek: die Emitter, deren veröffentlichte Frequenz- und PRF-Bereiche die Messung enthalten, ungewichtet, wie an der ELOKA der Fregatte ohne Assistenz; die Wahl legt die Leistungsklasse für die **Entfernungsschätzung** aus dem Pegel fest (ohne Einstufung die kürzeste Entfernung, die die Bibliothek zulässt). Alle 30 s behält jeder Emitter eine **Peilung** von der eigenen Position des Boots (20 Minuten); die Karte zeigt die letzten Peillinien, und sobald die eigene Fahrt die Peilung um mindestens 8° gedreht hat, ist die **Kreuzpeilung** ihr bester Schnittpunkt mit einer 95-%-Fehlerellipse, die einen seit jeder Linie bis zu 8 kn versetzten Sender einrechnet (eine schnelle Fregatte ergibt meist keine; eine Kreuzpeilung, deren Linien nicht zusammenpassen, wird markiert). Der **Stärketrend** zeigt steigend, gleichbleibend oder fallend über fünf Minuten. Die **Mastwarnung** („Radar kann Mast sehen“) kommt, wenn die geschätzte Entfernung eines erfassten Suchradars innerhalb der Entfernung liegt, auf der ein Seeraumradar bei diesem Seegang und Regen einen ausgefahrenen Mast sieht (der Wert der Wetterseite); die **empfohlene Mastzeit** ist 60 s bei ruhiger See, bis zu 300 s, wenn die Seegangsechos den Mast verbergen, und 20 s unter dieser Warnung, und das Log meldet, wenn sie überschritten ist. Ab Seegang 3 überspülen Wellen die Antenne, und manche Durchläufe hören nichts. Die Karte Mast & ESM im Browser hat die Rose, die Emittertabelle und die Auswertung des gewählten Emitters; **In den Plot übernehmen** trägt die Kreuzpeilung (Markierung und Fehlerkreis) oder sonst die letzte Peillinie in den Plot des Boots ein. Auf der Seite Mast & ESM der uConsole wählen `↑`/`↓` einen Emitter, `←`/`→` schalten seine Einstufung aus der Bibliothek weiter und `Enter` übernimmt ihn in den Plot. @@ -1199,6 +1200,7 @@ Wenn niemand die Fregatte fährt (die uConsole spielt das Boot oder ein Solo-Bro - Der Funkraum kennt nur den Rundspruchplan der Führung und Lagemeldungen: keine Befehle oder Nachrichten der Führung, kein Empfang in der Tiefe (kein VLF/ELF), keine Kurzsignale und keine anderen Einheiten im Netz; die Feindlage der Führung ist modellierte Aufklärung, kein eigener Sensor. - Die Leckwehr kennt sechs Abteilungen und zwei Trupps: keine getrennten Schäden an Druck- und Außenhülle, keine Verletzten, keine Ausbreitung von Rauch oder Hitze, kein Brand in den Luftvorräten und kein Sauerstoffverbrauch durch Feuer; der Gesamtschaden des Boots (Lärm, Höchstfahrt, Untergang bei 100 %) summiert sich weiter aus Treffern, und die KI-Boote haben nur diesen Wert. - Unter der Testtiefe kennt der Druckkörper keine einzelnen Armaturen, kein allmähliches Zusammendrücken und keine verstärkten Nähte aus einer Werftzeit; ein Versagen wählt Art und Abteilung zufällig, und ein zerdrücktes Boot ist sofort verloren. +- Die Geräusche des Boots sind einfache Signale: keine Richtung (Stereo) einer Detonation, keine Entfernungsschätzung daraus und kein Knarzen aus einer bestimmten Abteilung; der Sonarraum des Boots hat kein Rotlicht. - Das Trimmmodell kennt ein Gewicht und ein Moment: keinen Effekt freier Oberflächen, keine Kompressibilität des Druckkörpers mit der Tiefe und keine eigene Schnelltauchzelle; das Boot taucht nicht ganz auf. Proviant und Frischwasser gehen nicht aus. - Ein ausgefahrener Mast oder Schnorchelkopf erscheint auf dem Fregattenradar nur als bloßer Punkt (siehe Kapitel OPZ). - Das ESM des Boots hört keine Radare anderer U-Boote und keine Flugkörpersucher; es hat keine gewichtete Bibliotheksanalyse, keine Messung der Umlaufzeit und keine Bewegungsanalyse eines Senders (die Kreuzpeilung nimmt einen langsamen Sender an). diff --git a/docs/manual/manual.en.md b/docs/manual/manual.en.md index bd014554..c7f5258f 100644 --- a/docs/manual/manual.en.md +++ b/docs/manual/manual.en.md @@ -1109,6 +1109,7 @@ A second crew can play the enemy. The boat has seven stations: Command, Sonar, W - **Tanks, trim and air:** the engine room's **Tanks & trim** (browser card with a cross-section of the boat, uConsole Engine room page 3 **Tanks**) shows the main ballast, the regulating tank, the trim tanks, the high-pressure air and the trim the boat is in. Every weight change moves the boat off neutral: a torpedo leaving a bow tube makes it 1.5 t lighter and bow light, water in flooded compartments (see damage control) makes it heavier and trims it toward the flooded end; the automatic trim takes up what its tanks can of that weight and moment. With the **automatic trim** on, the engineer pumps the regulating tank (±8 t, 25 kg/s) and the trim tanks (±3 t fore and aft, 15 kg/s) back to neutral; by hand, each order moves the regulating tank 0.5 t or the trim water 0.25 t (and switches the automatic off). Running trim pumps are audible (+3 dB and a 120 Hz line). Whatever the tanks cannot take up sinks or lifts the boat by 0.03 m/s per tonne, and a trim angle (1° per tonne of moment, + bow down) drives it down or up with speed; the hydroplanes hold that only with way on, so a heavy boat hovering at low speed sinks below its ordered depth; the log warns from 2 t and from 3°. The **high-pressure air** (200 bar) holds three emergency blows of 60 bar each; a blow empties the main ballast in 20 s and the boat rises to 10 m and stays there, the ordered depth reset to 10 m. The next order below 12 m opens the vents: the main ballast floods in 40 s before the boat can dive. Snorkelling on the diesels runs the compressor (0.05 bar/s); with the air only on the fans it does not. Without power neither the trim pumps nor the compressor run. The AI's boats keep themselves trimmed and keep their one legacy blow. - **Damage control:** the engine room's **Damage control** (browser card with the compartments and a table, uConsole Engine room page 4 **Damage**) divides the pressure hull into six compartments: bow room, control room, quarters, battery room, engine room and stern room. A hit on the crewed boat holes the compartment it strikes (a leak of 1.5 % per % of hit damage, up to a full hole; from 50 % damage the neighbour too, with half the leak) and may start a fire there (chance = damage / 150); a hull failure below test depth holes it as well (see Below test depth). Water comes in at 40 kg/s through a full hole at 100 m, growing with the square root of depth; above half a compartment it spills into open neighbours (20 kg/s) and smothers a fire. A fire grows to full in 2 min and then spreads through open bulkheads; seawater in the battery room (from 2 t) gives off chlorine gas that drifts through open bulkheads and clears slowly once the battery is dry. Water in the battery room (from 5 t) or a fire there cuts the **power**: the motor stops (no way on, so the hydroplanes do not hold a heavy boat), and the trim pumps, compressor and electric bilge pumps stand still. **Shutting the bulkheads** of a compartment keeps water, fire and gas in it and starves a fire there in 3 min. Two **damage-control teams** walk the boat (8 s per compartment) and **seal a leak** (a full hole in 60 s), **pump out** (30 kg/s, a quarter by hand without power) or **fight a fire** (a full fire in 60 s); in gas they work at half rate, and in a compartment 90 % full they can only pump. A compartment half full of water, half on fire or half gassed takes its station out: the bow room the torpedo tubes, the control room the mast and periscope, the engine room the diesels, the stern room half the top speed. The floodwater is weight and moment for the trim (see above); a boat that sinks below 1.5 x test depth is crushed. The log reports leaks, fires, sealed leaks, fires out, flooded compartments, chlorine and power. - **Below test depth:** the crew may order the crewed boat below its test depth, down to crush depth (1.5 x test depth); the "deep" step and lying on the bottom stay at the safe depth. The uConsole's and the browser's depth columns mark the crush depth, and while the boat is below test depth Command on the uConsole shows a red **BELOW TEST DEPTH** alarm and the browser a red alarm chip, both with the test and crush depths. From 90 % of test depth the hull fatigues as before (one failure in about 30 min at test depth); below test depth failures come far faster, growing with the square of the excess: about one every 6 min at 110 %, one a minute at 125 % and one every 20 s at 140 %. Each failure is one of three: **sheared bolts** of a fitting (a quarter leak in a random compartment, 6 % damage), a **failed seal** of a shaft or valve (half a leak in the engine or stern room, 12 % damage) or a **cracked pressure hull** (a full leak and a 60 % leak in the neighbour, 30 % damage). Just past test depth a crack does not happen; its chance grows by 15 % per 10 % of excess, up to 60 %, and a seal fails in 30 % of the rest. The log reports every failure with its compartment, and at crush depth the hull collapses and the boat is lost. The AI's boats keep to their test depth. +- **Atmosphere:** the boat has its own sounds, on the uConsole when it plays the boat and in the boat's browsers with sound on (never on the frigate's). From 60 % of test depth the hull creaks, now and then at first and every 4 s at test depth and below; a hull failure cracks. Every detonation in the water within 30 NM (a torpedo or missile hit, a merchant torpedoed) is heard: within 2 NM as a heavy blast close aboard, farther off as a dull distant rumble, and the log reports it with the bearing the crew's ears give (a few degrees off). In **silent running** the boat rigs for red: the uConsole's boat screens and the browser's boat command stations turn to dimmed red light until silent running ends. - **Crew:** the boat has its own watch bill with the frigate's rules (see Damage control, Crew and watches): three watches, fatigue, action stations and morale. The Engine room and Command order action stations (`B` on the uConsole, a button in the browser's Damage control card) and relieve the watch (`M` on the Damage page, or the button). Morale rises when a ship sinks and falls with every 10 % of hull damage. A tired crew hears later on sonar, sights later through the periscope and its damage-control teams seal and fight fire more slowly (the pumps are machinery and keep their rate). - **Situation picture:** an intercepted active ping or torpedo is logged with the bearing the boat's own ears measured (a few degrees off) and shown with its age in the alarms. At periscope depth the **mast** can be raised; its ESM then reports the radars sweeping the boat with bearing (log and ESM list), and the mast lowers by itself when the boat goes deeper. With the mast up the **periscope** page (Command page 3, Mast & ESM page 2; `P` raises the mast at both) shows the eyepiece: sky and sea in the light of the hour, the horizon moving with the sea, a true-bearing scale and a crosshair; the scope trains in 2° steps (`←`/`→`, `Shift`: 10°). Everything the optics make out within the frigate lookout's contrast model at 2.5 m eye height (day/night, moon, visibility, sea state, land in the way) appears as a silhouette and as a bearing-only **sighting** with a coarse class (warship, merchant ship, vessel, aircraft, torpedo wake) and its apparent length; the log reports each new sighting. `Enter` reads the **stadimeter** on the sighting under the crosshair: the range follows from its apparent length and the assumed hull length of the class (130 m for a warship or an unrecognized vessel, 150 m for a merchant), so an unrecognized or bow-on target reads long; the reading is ±25 % and becomes a VISUAL fix on the boat's sonar contact of that target for 120 s, usable for a shot like a ping fix. Aircraft and wakes cannot be ranged. Each reading is also a **mark** for the **attack computer**: from two or more marks at least a minute apart (the last six within 15 minutes) it fits the target's course and speed in a straight line and, with the torpedo's speed, shows the lead angle (left or right of the bearing) and the running time under the periscope (browser: the Solution column); the quality grows with the time between the first and last mark (full at 5 minutes) and the number of marks. `Ctrl+Enter` on the periscope page (browser: Fire on solution, Command only) fires on the solution of the sighting under the crosshair: the torpedo runs on the intercept course to the point where target and torpedo meet. A shot at the sonar contact of a marked target uses the solution as well. A target turning after the last mark leaves the solution behind; a faster fit than 40 kn is rejected as a bad mark. The marks are part of the saved game. The charted coast stands on the periscope's horizon as far as its low optics see land (hills assumed 25 to 70 m). Command can also ping and take a BT without a sonar operator. The chart shows the tube firing arc where the tubes cannot fire all round, and the sonar room's assigned target is preselected for the shot. - **Mast & ESM:** with the mast up at periscope depth the boat's own ESM antenna (3 m above the water) hears the radars around it once a second: the frigate's, other ships' and aircraft radars inside the radar horizon, over land only where the coast does not block the line. The frigate's helicopter radiates its X-band search radar while it flies and is not dipping (antenna at 150 m), the patrol aircraft its frequency-agile search radar while the OPZ has it switched on. Each intercept carries the measured bearing (±4°), band, carrier frequency, PRF, modulation and received level, never the emitter's identity or position. The crew keeps an **emitter list** (`E1`, `E2` …) across mast periods: an intercept joins an emitter when bearing, band and waveform agree (a frequency-agile radar by bearing and band only), and the list forgets an emitter 30 minutes after its last intercept. **Classification** is the crew's annotation from the library: the emitters whose published frequency and PRF ranges hold the measurement, unranked, as at the frigate's ELOKA without assistance; the choice sets the power class for the **range estimate** from the level (unclassified: the shortest range the library allows). Every 30 s each emitter keeps a **bearing** from the boat's own position (20 minutes); the chart shows the latest bearing lines, and once the boat's own motion has swung the bearing by at least 8°, the **cross-fix** is their best crossing with a 95 % error ellipse that allows for an emitter drifting up to 8 kn since each line (a fast frigate usually gives none; a fix whose lines disagree is marked). The **level trend** reads rising, steady or falling over five minutes. The **mast warning** ("radar can see the mast") comes when a live search radar's estimated range is inside the range at which a surface radar sees a raised mast in this sea and rain (the weather page's value); the **recommended mast time** is 60 s in a calm sea, up to 300 s when sea clutter hides the mast and 20 s under that warning, and the log reports when it is exceeded. From sea state 3 waves wash over the antenna and some scans hear nothing. The browser's Mast & ESM card has the rose, the emitter table and the selected emitter's evaluation; **Transfer to plot** puts the cross-fix (mark and error circle) or else the latest bearing line into the boat's plot. On the uConsole's Mast & ESM page `↑`/`↓` select an emitter, `←`/`→` step through its library classification and `Enter` transfers it to the plot. @@ -1198,6 +1199,7 @@ When nobody sails the frigate (the uConsole plays the boat, or a solo browser pl - The radio room knows only HQ's broadcast schedule and situation reports: no orders or messages from HQ, no reception while deep (no VLF/ELF), no burst transmission and no other units on the net; HQ's contact report is modelled intelligence, not a sensor of its own. - Damage control is six compartments and two teams: no separate pressure-hull and outer-hull damage, no casualties, no smoke or heat spreading, no fire in the air stores and no fire consuming oxygen; the boat's overall damage (noise, top speed, sinking at 100 %) still adds up from hits, and the AI's boats keep only that value. - Below test depth the hull has no individual fittings, no gradual shrinking of the hull and no stronger welds from a refit; a failure picks its kind and compartment at random, and a crushed boat is lost at once. +- The boat's sounds are simple cues: no direction (stereo) for a detonation, no range estimate from it and no creak from a particular compartment; the boat's sonar room has no red light. - The trim model is one weight and one moment: no free-surface effect, no compressibility of the hull with depth and no separate negative tank; the boat does not surface fully. Food and fresh water do not run out. - A raised mast or snorkel head is seen by the frigate's radar only as a bare blip (see the OPZ chapter). - The boat's ESM hears no other submarine's radar and no missile seeker; it has no scored library analysis, no scan-period measurement and no target motion analysis of an emitter (the cross-fix assumes a slow emitter). diff --git a/docs/manual/manual.en.pdf b/docs/manual/manual.en.pdf index 6dd45f62..726bc431 100644 Binary files a/docs/manual/manual.en.pdf and b/docs/manual/manual.en.pdf differ diff --git a/docs/station-shortcuts.de.md b/docs/station-shortcuts.de.md index cb6ab899..91e56c5f 100644 --- a/docs/station-shortcuts.de.md +++ b/docs/station-shortcuts.de.md @@ -1,4 +1,4 @@ -# U-Jagd 1.3.21 - Stations- und Tastenkürzel +# U-Jagd 1.3.22 - Stations- und Tastenkürzel Druckfassung: [`station-shortcuts.de.pdf`](station-shortcuts.de.pdf). Maßgeblich ist die implementierte lokale Bedienung. Stationsnummern und diff --git a/docs/station-shortcuts.de.pdf b/docs/station-shortcuts.de.pdf index 1225af27..9a520bde 100644 Binary files a/docs/station-shortcuts.de.pdf and b/docs/station-shortcuts.de.pdf differ diff --git a/src/audio/engine.py b/src/audio/engine.py index 20cd013a..0263ff59 100644 --- a/src/audio/engine.py +++ b/src/audio/engine.py @@ -11,7 +11,7 @@ import numpy as np import pygame from src.audio.receiver import smooth_limit -from src.audio.synthesis import (active_sonar_ping, combat_effect, +from src.audio.synthesis import (active_sonar_ping, boat_effect, combat_effect, sonar_echo, stereo_bearing, tone) from src.core import config from src.core.debuglog import append_bounded_log @@ -281,6 +281,37 @@ class AudioEngine: except (TypeError, ValueError, OverflowError): return False + BOAT_CUES = frozenset({"hull_creak", "hull_crack", "detonation_near", + "detonation_far"}) + + def play_boat_cue(self, kind: str) -> bool: + """One atmosphere cue inside the crewed boat (the uConsole as the boat; + ``local_effects`` is off there, so this is the boat's only effect).""" + if kind not in self.BOAT_CUES: + return False + if not self.enabled or not self.available or self._alert_channel is None: + return False + try: + if (self._alert_channel.get_busy() + and self._alert_channel.get_queue() is not None): + self.alert_dropped_events += 1 + return False + sound = self._sound( + lambda: boat_effect(kind, self.sample_rate, self.SOURCE_LIMITS["alert"]), + ("alert", "boat", kind, self.sample_rate)) + if sound is None: + return False + if self._alert_channel.get_busy(): + self._alert_channel.queue(sound) + else: + self._alert_channel.play(sound) + return True + except pygame.error: + self._latch_device_error() + return False + except (TypeError, ValueError, OverflowError): + return False + def play_alert(self, kind: str = "danger") -> bool: """Kurze priorisierte Meldung fuer Stations- und Gefahrenaudio.""" tones = { diff --git a/src/audio/synthesis.py b/src/audio/synthesis.py index 86d66fa3..2d117a0d 100644 --- a/src/audio/synthesis.py +++ b/src/audio/synthesis.py @@ -173,6 +173,47 @@ def combat_effect(kind: str, sample_rate: int, return np.clip(np.nan_to_num(signal), -1, 1).astype(np.float32) +def boat_effect(kind: str, sample_rate: int, amplitude: float = .28) -> np.ndarray: + """Deterministic atmosphere cues heard inside the crewed boat: the hull + creaking deep down, a hull failure's crack and near/distant detonations.""" + if kind == "hull_creak": + duration = 1.8 + count = int(duration * sample_rate) + t = np.arange(count, dtype=np.float64) / sample_rate + noise = filtered_noise_event(duration, sample_rate, 60.0, 420.0, + amplitude, 433).astype(np.float64) + # A slow groan: a low tone sagging in pitch under a rasping band. + phase = 2 * np.pi * (88.0 * t - 9.0 * t * t) + rasp = 1.0 + .6 * np.sin(2 * np.pi * 11.0 * t) + envelope = np.sin(np.pi * np.minimum(1.0, t / duration)) ** 1.5 + signal = envelope * (.55 * noise * rasp + amplitude * .5 * np.sin(phase)) + elif kind == "hull_crack": + duration = .9 + count = int(duration * sample_rate) + t = np.arange(count, dtype=np.float64) / sample_rate + noise = filtered_noise_event(duration, sample_rate, 300.0, 5200.0, + amplitude, 457).astype(np.float64) + signal = noise * 2.2 * np.exp(-30.0 * t) + signal += amplitude * .8 * np.sin(2 * np.pi * 46.0 * t) * np.exp(-6.0 * t) + else: + near = kind == "detonation_near" + duration = 1.6 if near else 2.4 + count = int(duration * sample_rate) + t = np.arange(count, dtype=np.float64) / sample_rate + noise = filtered_noise_event(duration, sample_rate, 20.0, + 1400.0 if near else 260.0, + amplitude * (1.0 if near else .55), + 461 if near else 463).astype(np.float64) + envelope = np.minimum(1.0, t * (120.0 if near else 18.0)) \ + * np.exp(-(2.6 if near else 1.6) * t) + signal = noise * envelope + signal += amplitude * (.7 if near else .35) * np.sin(2 * np.pi * 38.0 * t) * envelope + edge = min(count // 2, max(1, round(.006 * sample_rate))) + signal[:edge] *= np.linspace(0.0, 1.0, edge) + signal[-edge:] *= np.linspace(1.0, 0.0, edge) + return np.clip(np.nan_to_num(signal), -1, 1).astype(np.float32) + + def stereo_bearing(samples: np.ndarray, bearing_deg: float, listener_bearing_deg: float = 0.0) -> np.ndarray: """Pannt ein Monosignal nach relativer Peilung mit konstanter Leistung.""" diff --git a/src/commander/projections.py b/src/commander/projections.py index d532bb37..ba87c383 100644 --- a/src/commander/projections.py +++ b/src/commander/projections.py @@ -1255,7 +1255,7 @@ def build_role_states(game, status, rows, target_ref, focus_ref, ref_by_track, def _opfor_common(game, status, role, boat): """Common block of a submarine role: the boat's own instruments only. - No frigate plot, audio cue, autocrew or mission framing ever reaches the + No frigate plot, frigate audio cue, autocrew or mission framing ever reaches the opposing side; the weather block is read through the boat's workstation. """ with game.sonar_perspective(boat.station): @@ -1265,7 +1265,10 @@ def _opfor_common(game, status, role, boat): dict(objects=[], max_objects=plot.MAX_OBJECTS, max_label=plot.MAX_LABEL)) common["mission"]["objective"] = localize(boat_missions.objective(game, boat), game.tr) - common["audio"] = dict(events=[], callouts=boat.callouts.detached()) + # The boat's own atmosphere cues (hull, detonations), never the frigate's. + common["audio"] = dict(events=[dict(seq=int(row["seq"]), cue=str(row["kind"])) + for row in list(boat.sound_events)[-16:]], + callouts=boat.callouts.detached()) common["autocrew"] = dict(enabled=False, status="off") common["autocrew_overview"] = [] return common diff --git a/src/core/boat_missions.py b/src/core/boat_missions.py index 647d16d2..24587dc7 100644 --- a/src/core/boat_missions.py +++ b/src/core/boat_missions.py @@ -132,7 +132,7 @@ def merchant_struck(game, ship) -> None: if ship is None or ship.sunk: return ship.hit(config.BOAT_CONVOY_WARHEAD) - game._emit_sound("explosion") + game._emit_sound("explosion", at=(ship.x, ship.y)) game.feed.add(game.world.format_time(), "schaden", message("runtime.merchant_torpedoed")) if ship.sunk: diff --git a/src/core/config.py b/src/core/config.py index 2a826d72..097e6ba1 100644 --- a/src/core/config.py +++ b/src/core/config.py @@ -374,6 +374,21 @@ UBOOT_HULL_SEAL_CHANCE = 0.3 UBOOT_HULL_FRACTURE_DAMAGE = 30.0 UBOOT_HULL_SEAL_DAMAGE = 12.0 UBOOT_HULL_BOLTS_DAMAGE = 6.0 +# Boat atmosphere (cues only, never simulation): the hull creaks from +# UBOOT_CREAK_START of test depth, a check every UBOOT_CREAK_TICK_S with a +# chance growing to 1 at test depth; detonations are heard out to +# UBOOT_DETONATION_HEARD_NM, "close" inside UBOOT_DETONATION_NEAR_NM, with a +# bearing error of UBOOT_DETONATION_BEARING_SD_DEG. +UBOOT_CREAK_START = 0.6 +UBOOT_CREAK_TICK_S = 4.0 +UBOOT_CREAK_MIN_CHANCE = 0.1 +UBOOT_DETONATION_HEARD_NM = 30.0 +UBOOT_DETONATION_NEAR_NM = 2.0 +UBOOT_DETONATION_BEARING_SD_DEG = 3.0 +UBOOT_SOUND_EVENTS_MAX = 16 +# Silent running: red, dimmed light (multiply, then a red floor so dark blues redden). +UBOOT_SILENT_LIGHT = (255, 110, 95) +UBOOT_SILENT_LIGHT_FLOOR = (36, 0, 0) UBOOT_DC_SPILL_FRACTION = 0.5 # water above this spills (and smothers fire) UBOOT_DC_SPILL_KG_S = 20.0 UBOOT_DC_FIRE_GROW_S = 120.0 diff --git a/src/core/game_sim.py b/src/core/game_sim.py index b699cf31..26f3c251 100644 --- a/src/core/game_sim.py +++ b/src/core/game_sim.py @@ -245,8 +245,12 @@ class SimMixin: break self._sonar_audio_sequence = sequence - def _emit_sound(self, kind: str) -> None: - """Play locally and publish a bounded, detached browser sound cue.""" + def _emit_sound(self, kind: str, at=None) -> None: + """Play locally and publish a bounded, detached browser sound cue. + + ``at``: where a detonation happened, so a crewed boat hears it too.""" + if at is not None and self._opfor is not None: + opfor.hear_detonation(self, self._opfor, float(at[0]), float(at[1])) if kind == "sonar_ping": self.audio.play_ping() elif kind == "esm_contact": @@ -610,7 +614,7 @@ class SimMixin: chaff_target=clouds.get(asm.chaff_cloud)) if asm.state == "TREFFER": hit = self.damage.missile_hit(*self._hull_impact(asm.x, asm.y)) - self._emit_sound("explosion") + self._emit_sound("explosion", at=(asm.x, asm.y)) self.announce(message("runtime.hit.asm", compartments=", ".join( self.damage.compartments[k].name for k in hit)), "schaden", 5.0) @@ -732,7 +736,7 @@ class SimMixin: hit = self.damage.torpedo_hit( impact=self._hull_impact(torpedo.x, torpedo.y), hole_scale=config.clamp(20.0 / distance_m, 0.5, 3.0)) - self._emit_sound("explosion") + self._emit_sound("explosion", at=(torpedo.x, torpedo.y)) text = ", ".join(self.damage.compartments[k].name for k in hit) self.flash(message("runtime.hit.torpedo", compartments=text), 5.0) self.feed.add(self.world.format_time(), "schaden", @@ -883,7 +887,7 @@ class SimMixin: continue if torpedo.state != "HIT": continue - self._emit_sound("explosion") + self._emit_sound("explosion", at=(torpedo.x, torpedo.y)) if (isinstance(torpedo.target, SurfaceShip) and torpedo.target.side != "hostile"): torpedo.target.sunk = True diff --git a/src/core/opfor.py b/src/core/opfor.py index 525c85e2..8e0c63ec 100644 --- a/src/core/opfor.py +++ b/src/core/opfor.py @@ -86,7 +86,8 @@ class CrewOrders: "dc_flooded": "schaden", "dc_chlorine": "schaden", "dc_power_lost": "schaden", "dc_power_restored": "schaden", "radio_sending": "funk", "radio_sent": "funk", "radio_aborted": "funk", - "radio_copied": "funk", "radio_copied_report": "funk"} + "radio_copied": "funk", "radio_copied_report": "funk", + "detonation_near": "sonar", "detonation_far": "sonar"} def __init__(self): self.silent = False @@ -271,6 +272,12 @@ class CrewedBoat: # Spoken crew reports from this feed (transient, like the frigate's). self.callouts = CalloutLog("boat") self.evaded_t = None # last evasion order (sim s, transient) + # Atmosphere cues the boat hears (hull creaks, cracks, detonations): + # transient like the frigate's, played locally when the uConsole is + # the boat and published to the boat's browsers. + self.sound_events = deque(maxlen=config.UBOOT_SOUND_EVENTS_MAX) + self.sound_seq = 0 + self._creak_tick = None # Cached radiating adapters (identity stays stable between updates). self._ownship_source = None self._torpedo_sources = {} @@ -522,6 +529,59 @@ def obstacle_ahead_nm(world, sub): return None +BOAT_CUES = ("hull_creak", "hull_crack", "detonation_near", "detonation_far") +_HULL_FAILURES = ("hull_bolts", "hull_seal", "hull_fracture", "hull_collapse") + + +def boat_sound(game, boat, cue: str) -> None: + """One atmosphere cue in the boat: played on the uConsole when it is the + boat and published to the boat's browsers (never to the frigate).""" + boat.sound_seq += 1 + boat.sound_events.append(dict(seq=boat.sound_seq, kind=cue)) + if game.local_side == "uboot" and game.opfor is boat: + game.audio.play_boat_cue(cue) + + +def creak_chance(depth_m: float, test_depth_m: float) -> float: + """Chance per creak check: none shallow, rising to 1 at test depth.""" + ratio = depth_m / max(test_depth_m, 1.0) + if ratio < config.UBOOT_CREAK_START: + return 0.0 + span = (ratio - config.UBOOT_CREAK_START) / (1.0 - config.UBOOT_CREAK_START) + return min(1.0, config.UBOOT_CREAK_MIN_CHANCE + + (1.0 - config.UBOOT_CREAK_MIN_CHANCE) * span) + + +def update_creak(game, boat) -> None: + """The pressure hull works audibly deep down (a cue, never simulation).""" + sub = boat.sub + tick = int(game.sim_t // config.UBOOT_CREAK_TICK_S) + if tick == boat._creak_tick: + return + boat._creak_tick = tick + chance = creak_chance(sub.depth, sub.stype.max_depth_m) + if chance > 0.0 and detrand.u01(sub.sensor_seed, "hull-creak", tick) < chance: + boat_sound(game, boat, "hull_creak") + + +def hear_detonation(game, boat, x: float, y: float) -> None: + """A detonation in the water: the crew hears it, close or distant, with + the bearing its own ears measure (a few degrees off).""" + sub = boat.sub + if sub.sunk: + return + distance = math.hypot(x - sub.x, y - sub.y) + if distance > config.UBOOT_DETONATION_HEARD_NM: + return + near = distance <= config.UBOOT_DETONATION_NEAR_NM + bearing = (math.degrees(math.atan2(x - sub.x, -(y - sub.y))) + + config.UBOOT_DETONATION_BEARING_SD_DEG + * detrand.normal(sub.sensor_seed, "detonation", int(game.sim_t * 1000.0))) % 360.0 + key = "detonation_near" if near else "detonation_far" + boat_sound(game, boat, key) + boat.orders.event(key, bearing=f"{round(bearing) % 360:03d}") + + def update_crew(game, boat: CrewedBoat) -> None: """Crew warnings from the boat's own state (0.25 s cadence).""" sub, orders = boat.sub, boat.orders @@ -554,7 +614,10 @@ def update_crew(game, boat: CrewedBoat) -> None: orders.esm = boat.esm.bearings(game.sim_t) if orders.mast else [] update_sightings(game, boat) boat.radio.update(game, boat) + update_creak(game, boat) for key, values in orders.drain_events(): + if key in _HULL_FAILURES: + boat_sound(game, boat, "hull_crack") if "compartment" in values: values = dict(values, compartment=message( f"uboot.compartment.{values['compartment']}")) diff --git a/src/core/version.py b/src/core/version.py index e9f56182..f4ff4290 100644 --- a/src/core/version.py +++ b/src/core/version.py @@ -4,7 +4,7 @@ This module is deliberately dependency-free because setuptools imports the version while building the project. """ -APP_VERSION = "1.3.21" +APP_VERSION = "1.3.22" SAVE_VERSION = 24 SAVE_SCHEMA = "u-jagd-save-v24" SPLASH_TEXT = ( diff --git a/src/ui/uboot_view.py b/src/ui/uboot_view.py index e19e3f25..c2f97905 100644 --- a/src/ui/uboot_view.py +++ b/src/ui/uboot_view.py @@ -1172,6 +1172,15 @@ def draw_end_panel(game, boat) -> None: 56, config.COLOR_TEXT_DIM, size=16, align="center") +def silent_light(s, boat) -> bool: + """Silent running: the boat rigs for red, dimmed light (display only).""" + if boat is None or not boat.orders.silent or boat.sub.sunk: + return False + s.fill(config.UBOOT_SILENT_LIGHT, special_flags=pygame.BLEND_MULT) + s.fill(config.UBOOT_SILENT_LIGHT_FLOOR, special_flags=pygame.BLEND_ADD) + return True + + def draw(game) -> None: """The whole mission screen while the uConsole plays the submarine.""" boat = game.opfor @@ -1199,6 +1208,7 @@ def draw(game) -> None: draw_command_panel(game, boat) draw_bottom(game, boat) game.draw_navigation_input() + silent_light(game.screen, boat) if game.game_over and getattr(game, "debrief_open", False): from src.ui.debrief_view import draw_debrief draw_debrief(game) diff --git a/tests/test_packaging.py b/tests/test_packaging.py index 6e67ec05..e4656fdb 100644 --- a/tests/test_packaging.py +++ b/tests/test_packaging.py @@ -85,7 +85,7 @@ def test_source_and_wheel_contain_editor_templates(tmp_path): (ROOT / "data/contact_analysis" / name).read_bytes() assert any(name.endswith(".dist-info/licenses/THIRD_PARTY_NOTICES.md") for name in wheel_names) - assert any(name.endswith("-1.3.21.dist-info/METADATA") for name in wheel_names) + assert any(name.endswith("-1.3.22.dist-info/METADATA") for name in wheel_names) source = next(tmp_path.glob("u_jagd-*.tar.gz")) with tarfile.open(source) as archive: @@ -137,7 +137,7 @@ def test_source_and_wheel_contain_editor_templates(tmp_path): [sys.executable, "-c", "from importlib import resources; " "assert resources.files('data.editor_templates').joinpath('mission.json').is_file(); " - "from src.core.version import APP_VERSION; assert APP_VERSION == '1.3.21'; " + "from src.core.version import APP_VERSION; assert APP_VERSION == '1.3.22'; " "from src.commander.server import CommanderServer; " "server=CommanderServer(); server.start('127.0.0.1',0); server.stop(); " "from src.core import manual; page=manual.html_page('de'); assert 'station-sonar' in page; " diff --git a/tests/test_startup.py b/tests/test_startup.py index 0d1c6310..6387d74d 100644 --- a/tests/test_startup.py +++ b/tests/test_startup.py @@ -14,9 +14,9 @@ from src.world.real_coast import sector_for_seed def test_release_version_and_exact_splash_text(): - assert APP_VERSION == "1.3.21" + assert APP_VERSION == "1.3.22" assert SPLASH_TEXT == ( - "Anti Sub Marine Warfare on uConsole by Dominik Bornhäußer Version 1.3.21" + "Anti Sub Marine Warfare on uConsole by Dominik Bornhäußer Version 1.3.22" ) diff --git a/tests/test_uboot_atmosphere.py b/tests/test_uboot_atmosphere.py new file mode 100644 index 00000000..f825e1d0 --- /dev/null +++ b/tests/test_uboot_atmosphere.py @@ -0,0 +1,123 @@ +"""Atmosphere in the crewed boat: hull creaks, detonations, red light.""" + +import re +import sys +from pathlib import Path + +import numpy as np +import pygame + +from src.audio.engine import AudioEngine +from src.audio.synthesis import boat_effect +from src.core import config, opfor +from src.ui import uboot_view + +sys.path.insert(0, str(Path(__file__).parent)) +from test_opfor_sub import _crewed, _feed_texts, _run # noqa: E402 + +ROOT = Path(__file__).resolve().parents[1] + + +def _cues(boat): + return [row["kind"] for row in boat.sound_events] + + +def test_the_hull_creaks_only_deep_down_and_deterministically(): + test = 250.0 + assert opfor.creak_chance(100.0, test) == 0.0 + assert opfor.creak_chance(test * config.UBOOT_CREAK_START, test) \ + == config.UBOOT_CREAK_MIN_CHANCE + assert opfor.creak_chance(test, test) == 1.0 + heard = [] + for _ in range(2): + game, _server, _bridge = _crewed(seed=61) + boat = game.opfor + game.world.depth_m = lambda x, y: 3000.0 + sub = boat.sub + sub.depth = sub.target_depth = sub.order_depth = sub.stype.max_depth_m * 0.8 + _run(game, 60) + heard.append(_cues(boat).count("hull_creak")) + assert heard[0] == heard[1] >= 3 + game, _server, _bridge = _crewed(seed=61) + game.opfor.sub.depth = game.opfor.sub.target_depth = 30.0 + game.opfor.sub.order_depth = 30.0 + _run(game, 30) + assert "hull_creak" not in _cues(game.opfor) + + +def test_the_boat_hears_detonations_near_and_far_with_a_bearing(): + game, server, bridge = _crewed(seed=62) + boat = game.opfor + sub = boat.sub + game._emit_sound("explosion", at=(sub.x + 1.0, sub.y)) # 090, close + game._emit_sound("explosion", at=(sub.x, sub.y - 10.0)) # 000, distant + game._emit_sound("explosion", at=(sub.x + 40.0, sub.y)) # out of hearing + assert _cues(boat) == ["detonation_near", "detonation_far"] + events = {key: values for key, values in boat.orders._events} + near = int(events["detonation_near"]["bearing"]) + far = int(events["detonation_far"]["bearing"]) + assert abs(((near - 90 + 180) % 360) - 180) <= 12 + assert abs(((far + 180) % 360) - 180) <= 12 + _run(game, 1) + texts = _feed_texts(game) + assert any("Detonation close aboard" in text for text in texts) + assert any("Distant detonation" in text for text in texts) + # The boat's browsers get the boat's cues; the frigate's stations never do. + game._emit_sound("gunfire") + bridge.pump(game, server, now=5.0) + assert [row["cue"] for row in server.v2_states["uboot"]["audio"]["events"]] == _cues(boat) + assert [row["cue"] for row in server.v2_states["uboot_sonar"]["audio"]["events"]] \ + == _cues(boat) + + +def test_a_hull_failure_cracks_audibly(): + game, _server, _bridge = _crewed(seed=63) + boat = game.opfor + game.world.depth_m = lambda x, y: 3000.0 + boat.sub.depth = boat.sub.stype.max_depth_m * 1.2 + boat.sub._hull_failure(1.2) + opfor.update_crew(game, boat) + assert "hull_crack" in _cues(boat) + + +def test_boat_cues_synthesize_and_play_only_as_boat_cues(): + rate = 8000 + signals = [boat_effect(kind, rate) for kind in sorted(AudioEngine.BOAT_CUES)] + for signal in signals: + assert signal.dtype == np.float32 and signal.size > 100 + assert np.isfinite(signal).all() and 0 < np.max(np.abs(signal)) <= 1 + assert signal[0] == signal[-1] == 0 + assert np.array_equal(boat_effect("hull_creak", rate), boat_effect("hull_creak", rate)) + engine = AudioEngine(enabled=False) + assert engine.play_boat_cue("hull_creak") is False + assert engine.play_boat_cue("explosion") is False + + +def test_every_published_cue_is_known_to_the_browser(): + shared = (ROOT / "data/commander/js/state/shared.js").read_text(encoding="utf-8") + block = re.search(r"gameEffectKinds = new Set\(\[(.*?)\]\)", shared, re.S).group(1) + kinds = set(re.findall(r'"([a-z_]+)"', block)) + assert AudioEngine.BOAT_CUES <= kinds and set(opfor.BOAT_CUES) <= kinds + emitted = set() + for path in (ROOT / "src").rglob("*.py"): + emitted |= set(re.findall(r'_emit_sound\("([a-z_]+)"', path.read_text(encoding="utf-8"))) + assert emitted <= kinds + audio = (ROOT / "data/commander/js/audio/audio.js").read_text(encoding="utf-8") + for kind in kinds: + assert re.search(rf"\b{kind}:", audio), kind + + +def test_silent_running_rigs_the_boat_for_red_light(): + game, _server, _bridge = _crewed(seed=64) + boat = game.opfor + surface = pygame.Surface((8, 8)) + surface.fill((255, 255, 255)) + assert uboot_view.silent_light(surface, boat) is False + boat.orders.silent = True + assert uboot_view.silent_light(surface, boat) is True + assert tuple(surface.get_at((1, 1)))[:3] == tuple( + min(255, a + b) for a, b in zip(config.UBOOT_SILENT_LIGHT, config.UBOOT_SILENT_LIGHT_FLOOR)) + game.local_side = "uboot" + uboot_view.draw(game) + red, green, blue = tuple(game.screen.get_at((640, 400)))[:3] + assert red > green and red > blue