Merge main

This commit is contained in:
Claude committed 2026-09-28 18:56:45 +00:00
commit 00611fd874
60 files changed
+1510 -178

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ body:
id: version
attributes:
label: Version
placeholder: "1.3.40"
placeholder: "1.3.44"
validations:
required: true
- type: input
+18
View File
@@ -91,3 +91,21 @@ jobs:
else
gh release upload "$tag" dist/U-Jagd-Windows.exe
fi
- name: Remove older releases
# Only the newest release stays on GitHub (Dominik, 2026-09-28). Both
# updaters read releases/latest only; the git tags stay.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.version.outputs.version }}
run: |
gh release view "v$VERSION" --json assets --jq '.assets[].name' | grep -qx "U-Jagd-Windows.exe"
gh api --paginate "repos/$GITHUB_REPOSITORY/releases?per_page=100" --jq '.[].tag_name' \
| python tools/prune_releases.py "$VERSION" \
| while read -r old; do
old=${old%$'\r'}
echo "Deleting release $old (tag kept)"
gh release delete "$old" --yes
done
+1 -1
View File
@@ -2,7 +2,7 @@
## Authority and scope
- This is U-Jagd 1.3.41 (`src/core/version.py`); current saves are v27-only. Treat these as compatibility contracts, not changelog entries.
- This is U-Jagd 1.3.45 (`src/core/version.py`); current saves are v27-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`.
+46
View File
@@ -4,6 +4,52 @@
Alle Versionen von U-Jagd, die neueste zuerst. Die [README](README.de.md) zeigt nur die neueste.
## 1.3.45
Version 1.3.45 hält den Himmel im Sehrohr und im Fernglas des Ausgucks ruhig:
Wolken, Sterne, Sonne und Mond bleiben stehen, während See und Horizont mit dem
Seegang schwanken. Von der Dämmerung bis zum Morgen und bei schlechter Sicht
führen neutrale Schiffe ihre Positionslichter nach den
Kollisionsverhütungsregeln: weiße Topplichter, das rote oder grüne Seitenlicht
der Seite, die man sieht, von achtern das weiße Hecklicht, jedes in seiner
Tragweite, und die Rundumlichter von Fahrzeugen bei der Arbeit (Trawler, Lotse,
Vermesser und Kabelleger, Minenräumer), zivile Flugzeuge ihre Flügelspitzen-,
Heck- und blitzenden Kollisionswarnlichter; der Bug zeigt dorthin, wohin die Lichter weisen, und ein
beleuchtetes Schiff wird im Dunkeln an seinen Lichtern gesichtet.
Kriegsschiffe und Militärflugzeuge bleiben dunkel. Die See folgt dem Wind:
gegen die See laufen die Kämme auf einen zu, mit der See davon, quer dazu
seitlich, und das Schiff stampft in Gegensee und rollt in Dwarssee. Fernglas und
Sehrohr lassen sich jetzt nach oben und unten neigen, zoomen (Fernglas 16°, 8°,
4°; Sehrohr kleine und große Vergrößerung) und haben eine
Horizontstabilisierung. Auf der uConsole und im Browser; Spielstände bleiben v27.
## 1.3.44
Version 1.3.44 behebt Remote-Crew-Browser, die mit „Host sendet Daten, die
dieser Browser nicht lesen kann“ einfroren. Vier Listen nannten die Art einer
Zeile mit einem Feld, das der Browser in jedem Stationszustand ablehnt: das
Funklog des U-Boots, seine Bedrohungs-Peilungen und sein Ausweichbefehl sowie
die HQ-Aufträge im Funkraum der Fregatte. Sobald die erste Sendung mitgeschrieben,
ein Ping oder Torpedo gehört oder ein Auftrag angeboten war, stand das
Lagebild still und Aktionen waren gesperrt. Diese Zeilen senden das Feld jetzt
als `type`; ein neuer Test findet solche Felder auch ohne Chromium. Nach dem
Update des Hosts die Browserseite einmal neu laden, damit sie den neuen
Web-Client lädt. Spielstände bleiben v27.
## 1.3.43
Version 1.3.43 lässt auf GitHub nur noch das neueste Release stehen: Nach dem
Veröffentlichen einer neuen Version löscht der Windows-Workflow alle älteren
Releases (ihre Git-Tags bleiben). Windows-Starter und uConsole-Updater lesen
nur das neueste Release. Spielstände bleiben v27.
## 1.3.42
Version 1.3.42 lässt auf GitHub nur noch das neueste Release stehen: Nach dem
Veröffentlichen einer neuen Version löscht der Windows-Workflow alle älteren
Releases (ihre Git-Tags bleiben). Windows-Starter und uConsole-Updater lesen
nur das neueste Release. Spielstände bleiben v27.
## 1.3.41
Version 1.3.41 bringt die volle obere Leiste auf der uConsole zurück: Die
+44
View File
@@ -4,6 +4,50 @@
Every U-Jagd release, newest first. The [README](README.md) shows only the latest one.
## 1.3.45
Release 1.3.45 keeps the sky still in the periscope and the lookout's
binoculars: clouds, stars, the sun and the moon stay in place while the sea and
the horizon roll with the swell. From dusk to dawn and in poor visibility
neutral ships run their navigation lights as the collision regulations lay
down: white masthead lights, the red or green side light for the side you see,
the white stern light from astern, each within its range, and the all-round
lights of vessels at work (trawler, pilot, survey ship and cable layer, mine
clearance), and civil aircraft their wingtip, tail and flashing anti-collision
lights; the ship's bow points the way its lights show, and a lit ship is sighted by its lights in the dark.
Warships and military aircraft run dark. The sea follows the wind: into it the
crests come at you, down-sea they run away, across it they run sideways, and
the ship pitches in head seas and rolls in beam seas. The binoculars and the
periscope now tilt up and down, zoom (binoculars 16°, 8°, 4°; periscope low and
high power) and have a horizon stabilizer. Both on the uConsole and in the
browser; saves stay v27.
## 1.3.44
Release 1.3.44 fixes Remote Crew browsers that froze with "Host sends data
this browser cannot read". Four lists named a row's type with a field the
browser refuses in every station state: the submarine's radio log, its threat
intercepts and evasion order, and the frigate radio room's HQ tasks. As soon as
the first broadcast was copied, a ping or torpedo was heard or HQ offered a
task, the station picture stopped and actions were locked. These rows now send
the field as `type`; a new test catches such a field without Chromium. After
updating the host, reload the browser page once so it loads the new web
client. Saves stay v27.
## 1.3.43
Release 1.3.43 keeps only the newest release on GitHub: after publishing a new
version the Windows workflow deletes every older release (their git tags stay).
The Windows starter and the uConsole updater read only the latest release.
Saves stay v27.
## 1.3.42
Release 1.3.42 keeps only the newest release on GitHub: after publishing a new
version the Windows workflow deletes every older release (their git tags stay).
The Windows starter and the uConsole updater read only the latest release.
Saves stay v27.
## 1.3.41
Release 1.3.41 brings back the full top bar on the uConsole: the frigate shows
+19 -6
View File
@@ -14,12 +14,24 @@ 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.41**
Aktuelle Version: **1.3.45**
Version 1.3.41 bringt die volle obere Leiste auf der uConsole zurück: Die
Fregatte zeigt wieder Station, Mission, Uhrzeit, Fahrt und Kurs, das besetzte
U-Boot Mission, Uhrzeit, Fahrt, Kurs und Tiefe, jetzt kompakt durch „·“
getrennt. Spielstände bleiben v27.
Version 1.3.45 hält den Himmel im Sehrohr und im Fernglas des Ausgucks ruhig:
Wolken, Sterne, Sonne und Mond bleiben stehen, während See und Horizont mit dem
Seegang schwanken. Von der Dämmerung bis zum Morgen und bei schlechter Sicht
führen neutrale Schiffe ihre Positionslichter nach den
Kollisionsverhütungsregeln: weiße Topplichter, das rote oder grüne Seitenlicht
der Seite, die man sieht, von achtern das weiße Hecklicht, jedes in seiner
Tragweite, und die Rundumlichter von Fahrzeugen bei der Arbeit (Trawler, Lotse,
Vermesser und Kabelleger, Minenräumer), zivile Flugzeuge ihre Flügelspitzen-,
Heck- und blitzenden Kollisionswarnlichter; der Bug zeigt dorthin, wohin die Lichter weisen, und ein
beleuchtetes Schiff wird im Dunkeln an seinen Lichtern gesichtet.
Kriegsschiffe und Militärflugzeuge bleiben dunkel. Die See folgt dem Wind:
gegen die See laufen die Kämme auf einen zu, mit der See davon, quer dazu
seitlich, und das Schiff stampft in Gegensee und rollt in Dwarssee. Fernglas und
Sehrohr lassen sich jetzt nach oben und unten neigen, zoomen (Fernglas 16°, 8°,
4°; Sehrohr kleine und große Vergrößerung) und haben eine
Horizontstabilisierung. Auf der uConsole und im Browser; Spielstände bleiben v27.
Frühere Versionen: [CHANGELOG.de.md](CHANGELOG.de.md).
@@ -177,7 +189,8 @@ Der Workflow `.github/workflows/windows.yml` baut das Programm mit PyInstaller
(`packaging/windows/u-jagd-windows.spec`) bei jedem Push und Pull Request,
führt seinen Selbsttest ohne Bildschirm aus (kurze Mission plus
Remote-Crew-Seiten) und veröffentlicht auf `main` einmal je Version das
Release `v<APP_VERSION>`. Selbst bauen unter Windows:
Release `v<APP_VERSION>`; danach löscht er alle älteren Releases, sodass nur das
neueste stehen bleibt (Git-Tags bleiben). Selbst bauen unter Windows:
`python -m pip install -e ".[windows]"` und
`pyinstaller packaging/windows/u-jagd-windows.spec`.
+18 -6
View File
@@ -12,12 +12,23 @@ 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.41**
Current release: **1.3.45**
Release 1.3.41 brings back the full top bar on the uConsole: the frigate shows
the station, the mission, the clock, speed and course again, and the crewed
submarine shows the mission, the clock, speed, course and depth, now compactly
separated by "·". Saves stay v27.
Release 1.3.45 keeps the sky still in the periscope and the lookout's
binoculars: clouds, stars, the sun and the moon stay in place while the sea and
the horizon roll with the swell. From dusk to dawn and in poor visibility
neutral ships run their navigation lights as the collision regulations lay
down: white masthead lights, the red or green side light for the side you see,
the white stern light from astern, each within its range, and the all-round
lights of vessels at work (trawler, pilot, survey ship and cable layer, mine
clearance), and civil aircraft their wingtip, tail and flashing anti-collision
lights; the ship's bow points the way its lights show, and a lit ship is sighted by its lights in the dark.
Warships and military aircraft run dark. The sea follows the wind: into it the
crests come at you, down-sea they run away, across it they run sideways, and
the ship pitches in head seas and rolls in beam seas. The binoculars and the
periscope now tilt up and down, zoom (binoculars 16°, 8°, 4°; periscope low and
high power) and have a horizon stabilizer. Both on the uConsole and in the
browser; saves stay v27.
Earlier releases: [CHANGELOG.md](CHANGELOG.md).
@@ -171,7 +182,8 @@ anyway"). Saves and settings live in `%USERPROFILE%\.u-jagd\` as on Linux.
The workflow `.github/workflows/windows.yml` builds the program with
PyInstaller (`packaging/windows/u-jagd-windows.spec`) on every push and pull
request, runs its headless self-test (a short mission plus the Remote Crew
pages) and, on `main`, publishes release `v<APP_VERSION>` once per version.
pages) and, on `main`, publishes release `v<APP_VERSION>` once per version and then deletes every older
release, so only the newest one stays (git tags are kept).
To build locally on Windows: `python -m pip install -e ".[windows]"` and
`pyinstaller packaging/windows/u-jagd-windows.spec`.
+2 -2
View File
@@ -192,7 +192,7 @@
<p id="opz-mark-status" class="fine" aria-live="polite"></p>
</section>
<section id="station-view" class="station-view" aria-label="" data-i18n-aria="station_view" hidden>
<section id="station-bridge" class="station-section" data-station-role="bridge" aria-labelledby="station-bridge-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-bridge-title" data-i18n="station_bridge"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="bridge_navigation_title"></h3><dl id="bridge-navigation" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="station_orders"></h3><dl id="bridge-orders-summary" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="crew_title"></h3><dl id="bridge-crew" class="detail-metrics"></dl><div id="bridge-crew-actions" class="station-actions"></div></article><article class="station-card-view bridge-weather"><h3 data-i18n="weather_picture"></h3><canvas id="bridge-weather-canvas" width="360" height="120" data-i18n-aria="weather_picture"></canvas><p id="bridge-weather-text" class="fine"></p></article><article class="station-card-view"><h3 data-i18n="station_tactical_summary"></h3><div id="bridge-tactical" class="station-list"></div></article><article class="station-card-view station-wide bridge-glasses-card" aria-labelledby="bridge-glasses-title"><h3 id="bridge-glasses-title" data-i18n="glasses_title"></h3><canvas id="bridge-glasses-canvas" class="uboot-canvas uboot-scope-canvas" data-i18n-aria="glasses_title"></canvas><p id="bridge-glasses-status" class="uboot-scope-status" role="status" aria-live="polite"></p><div class="uboot-scope-controls" role="group" data-i18n-aria="glasses_train"><button type="button" data-glasses-turn="-10" data-i18n="uboot_scope_turn_left_fast"></button><button type="button" data-glasses-turn="-2" data-i18n="uboot_scope_turn_left"></button><button id="bridge-glasses-bow" type="button" data-i18n="glasses_bow"></button><button type="button" data-glasses-turn="2" data-i18n="uboot_scope_turn_right"></button><button type="button" data-glasses-turn="10" data-i18n="uboot_scope_turn_right_fast"></button></div></article><article class="station-card-view"><h3 id="bridge-sightings-title" data-i18n="sightings_title"></h3><ol id="bridge-sightings" class="sighting-log" aria-labelledby="bridge-sightings-title" aria-live="polite"></ol></article></div></section>
<section id="station-bridge" class="station-section" data-station-role="bridge" aria-labelledby="station-bridge-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-bridge-title" data-i18n="station_bridge"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="bridge_navigation_title"></h3><dl id="bridge-navigation" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="station_orders"></h3><dl id="bridge-orders-summary" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="crew_title"></h3><dl id="bridge-crew" class="detail-metrics"></dl><div id="bridge-crew-actions" class="station-actions"></div></article><article class="station-card-view bridge-weather"><h3 data-i18n="weather_picture"></h3><canvas id="bridge-weather-canvas" width="360" height="120" data-i18n-aria="weather_picture"></canvas><p id="bridge-weather-text" class="fine"></p></article><article class="station-card-view"><h3 data-i18n="station_tactical_summary"></h3><div id="bridge-tactical" class="station-list"></div></article><article class="station-card-view station-wide bridge-glasses-card" aria-labelledby="bridge-glasses-title"><h3 id="bridge-glasses-title" data-i18n="glasses_title"></h3><canvas id="bridge-glasses-canvas" class="uboot-canvas uboot-scope-canvas" data-i18n-aria="glasses_title"></canvas><p id="bridge-glasses-status" class="uboot-scope-status" role="status" aria-live="polite"></p><div class="uboot-scope-controls" role="group" data-i18n-aria="glasses_train"><button type="button" data-glasses-turn="-10" data-i18n="uboot_scope_turn_left_fast"></button><button type="button" data-glasses-turn="-2" data-i18n="uboot_scope_turn_left"></button><button id="bridge-glasses-bow" type="button" data-i18n="glasses_bow"></button><button type="button" data-glasses-turn="2" data-i18n="uboot_scope_turn_right"></button><button type="button" data-glasses-turn="10" data-i18n="uboot_scope_turn_right_fast"></button></div><div class="uboot-scope-controls optics-controls" role="group" data-optics="glasses" data-i18n-aria="optics_group"><button type="button" data-optics-tilt="2" data-i18n="optics_up"></button><button type="button" data-optics-tilt="-2" data-i18n="optics_down"></button><button type="button" data-optics-zoom="-1" data-i18n="optics_zoom_out"></button><button type="button" data-optics-zoom="1" data-i18n="optics_zoom_in"></button><button type="button" data-optics-stabilizer data-i18n="optics_stabilizer" aria-pressed="false"></button></div></article><article class="station-card-view"><h3 id="bridge-sightings-title" data-i18n="sightings_title"></h3><ol id="bridge-sightings" class="sighting-log" aria-labelledby="bridge-sightings-title" aria-live="polite"></ol></article></div></section>
<section id="station-sonar" class="station-section" data-station-role="sonar" aria-labelledby="station-sonar-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-sonar-title" data-i18n="station_sonar"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="station_settings"></h3><dl id="sonar-settings" class="detail-metrics"></dl></article><article class="station-card-view station-controls station-wide"><h3 data-i18n="sonar_controls"></h3><label for="sonar-control-page" data-i18n="sonar_control_page"></label><select id="sonar-control-page"><option value="listen" data-i18n="sonar_page_listen"></option><option value="array" data-i18n="sonar_page_array"></option><option value="analysis" data-i18n="sonar_page_analysis"></option></select><div class="control-page" data-sonar-page="listen"><form id="sonar-bearing-form" class="control-form"><label for="sonar-bearing" data-i18n="sonar_listen_bearing"></label><input id="sonar-bearing" type="number" min="0" max="359.99999999999994" step="any" inputmode="decimal" autocomplete="off" required><button id="sonar-bearing-submit" type="submit" data-i18n="sonar_set_bearing"></button></form><button id="sonar-clear-focus" type="button" data-i18n="sonar_clear_focus"></button><button id="sonar-ping" type="button" data-i18n="sonar_ping"></button></div><div class="control-page" data-sonar-page="array" hidden><label for="sonar-array-mode" data-i18n="sonar_array_mode"></label><select id="sonar-array-mode"><option value="BOW" data-i18n="sonar_bow"></option><option value="TOWED" data-i18n="sonar_towed"></option><option value="VDS" data-i18n="sonar_vds"></option></select><button id="sonar-array-apply" type="button" data-i18n="apply"></button><button id="sonar-tas" type="button"></button><form id="sonar-depth-form" class="control-form"><label for="sonar-depth" data-i18n="sonar_tow_depth"></label><input id="sonar-depth" type="number" min="20" max="260" step="any" inputmode="decimal" autocomplete="off" required><button id="sonar-depth-submit" type="submit" data-i18n="sonar_set_depth"></button></form><button id="sonar-vds" type="button"></button><form id="sonar-vds-depth-form" class="control-form"><label for="sonar-vds-depth" data-i18n="sonar_vds_depth"></label><input id="sonar-vds-depth" type="number" min="20" max="300" step="any" inputmode="decimal" autocomplete="off" required><button id="sonar-vds-depth-submit" type="submit" data-i18n="sonar_set_vds_depth"></button></form><button id="sonar-bt" type="button" data-i18n="sonar_bt"></button></div><div class="control-page" data-sonar-page="analysis" hidden><label class="toggle"><input id="sonar-tma" type="checkbox"><span data-i18n="sonar_tma"></span></label><label class="toggle"><input id="sonar-notch" type="checkbox"><span data-i18n="sonar_notch"></span></label><label class="toggle"><input id="sonar-peak" type="checkbox"><span data-i18n="sonar_peak_hold"></span></label><form id="sonar-gain-form" class="control-form"><label for="sonar-gain" data-i18n="sonar_gain"></label><input id="sonar-gain" type="number" min="-12" max="24" step="any" inputmode="decimal" autocomplete="off" required><button id="sonar-gain-submit" type="submit" data-i18n="apply"></button></form><label for="sonar-band" data-i18n="sonar_band"></label><select id="sonar-band"><option value="FULL">FULL</option><option value="LOW">LOW</option><option value="SHAFT">SHAFT</option><option value="MID">MID</option></select><button id="sonar-band-apply" type="button" data-i18n="apply"></button><form id="sonar-harmonic-form" class="control-form"><label for="sonar-harmonic-input" data-i18n="sonar_harmonic_frequency"></label><input id="sonar-harmonic-input" type="number" min="0.000001" max="300" step="any" inputmode="decimal" autocomplete="off" list="sonar-harmonic-candidates"><datalist id="sonar-harmonic-candidates"></datalist><button id="sonar-harmonic-submit" type="submit" data-i18n="sonar_set_harmonic"></button><button id="sonar-harmonic-clear" type="button" data-i18n="sonar_clear_harmonic"></button></form><label for="sonar-integration" data-i18n="sonar_integration"></label><select id="sonar-integration"><option value="2">2 s (FFT)</option><option value="8">8 s</option><option value="16">16 s</option><option value="64">64 s</option></select><form id="sonar-band-edges-form" class="control-form"><label for="sonar-band-low-hz" data-i18n="sonar_band_low_hz"></label><input id="sonar-band-low-hz" type="number" min="0" max="299.5" step="0.5" inputmode="decimal" autocomplete="off" required><label for="sonar-band-high-hz" data-i18n="sonar_band_high_hz"></label><input id="sonar-band-high-hz" type="number" min="0.5" max="300" step="0.5" inputmode="decimal" autocomplete="off" required><button id="sonar-band-edges-submit" type="submit" data-i18n="apply"></button></form><form id="sonar-operator-notch-form" class="control-form"><label for="sonar-operator-notch" data-i18n="sonar_operator_notch"></label><iLine truncated
<section id="station-weapons" class="station-section" data-station-role="weapons" aria-labelledby="station-weapons-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-weapons-title" data-i18n="station_weapons"></h2></div><div class="station-grid"><article class="station-card-view card-readout"><h3 data-i18n="inventory"></h3><dl id="weapons-inventory" class="detail-metrics"></dl></article><article class="station-card-view card-readout"><h3 data-i18n="station_readiness"></h3><dl id="weapons-readiness" class="detail-metrics"></dl></article><article class="station-card-view card-readout"><h3 data-i18n="weapons_tubes"></h3><div id="weapons-tubes" class="station-list compact-list"></div></article><article class="station-card-view station-wide" aria-labelledby="weapons-settings-title"><h3 id="weapons-settings-title" data-i18n="weapons_settings"></h3><div class="fire-grid"><label for="weapons-torpedo-type" data-i18n="weapons_torpedo_type"></label><select id="weapons-torpedo-type"></select><label for="weapons-pattern" data-i18n="weapons_pattern"></label><select id="weapons-pattern"><option value="snake" data-i18n="torpedo_pattern_snake"></option><option value="circle" data-i18n="torpedo_pattern_circle"></option><option value="helix" data-i18n="torpedo_pattern_helix"></option></select><label for="weapons-enable" data-i18n="weapons_enable"></label><input id="weapons-enable" type="number" min="0.6" max="3.0" step="0.2" inputmode="decimal" autocomplete="off"><label for="weapons-salvo" data-i18n="weapons_salvo"></label><select id="weapons-salvo"><option value="1" data-i18n="torpedo_salvo_1"></option><option value="2" data-i18n="torpedo_salvo_2"></option></select><button id="weapons-settings-apply" type="button" data-i18n="apply"></button></div></article><article class="station-card-view card-readout"><h3 data-i18n="station_designated_target"></h3><div id="weapons-target" class="station-list"></div></article><article class="station-card-view station-wide direct-fire-controls" aria-labelledby="weapons-fire-title"><h3 id="weapons-fire-title" data-i18n="weapons_fire_control"></h3><div class="fire-grid"><label for="weapons-fire-target" data-i18n="fire_target"></label><select id="weapons-fire-target"></select><label for="weapons-fire-depth" data-i18n="fire_depth"></label><input id="weapons-fire-depth" type="number" min="10" max="300" step="any" inputmode="decimal" autocomplete="off"><button id="weapons-fire-torpedo" type="button" data-fire-action="weapons_launch_torpedo" data-i18n="weapons_launch_torpedo"></button><button id="weapons-fire-helicopter" type="button" data-fire-action="helicopter_launch_torpedo" data-i18n="helicopter_launch_torpedo"></button><button id="weapons-fire-nixie" type="button" data-fire-action="weapons_deploy_nixie" data-i18n="weapons_deploy_nixie"></button></div><p id="weapons-fire-status" class="fire-status" role="status" aria-live="polite"></p></article><article class="station-card-view station-wide card-readout"><h3 data-i18n="station_own_weapons"></h3><div id="weapons-own" class="station-list"></div></article></div></section>
<section id="station-damage" class="station-section" data-station-role="damage" aria-labelledby="station-damage-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-damage-title" data-i18n="station_damage"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="station_damage_summary"></h3><dl id="damage-summary" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="station_damage_teams"></h3><div id="damage-teams" class="station-list"></div></article><article class="station-card-view"><h3 data-i18n="crew_title"></h3><dl id="damage-crew" class="detail-metrics"></dl><div id="damage-crew-actions" class="station-actions"></div></article><article class="station-card-view station-wide"><h3 data-i18n="station_compartments"></h3><div id="damage-compartments" class="station-list"></div></article></div></section>
@@ -201,7 +201,7 @@
<section id="station-engine" class="station-section" data-station-role="engine" aria-labelledby="station-engine-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-engine-title" data-i18n="station_engine"></h2></div><div class="station-grid"><article class="station-card-view card-readout"><h3 data-i18n="station_propulsion"></h3><dl id="engine-propulsion" class="detail-metrics"></dl></article><article class="station-card-view card-readout"><h3 data-i18n="station_machinery"></h3><dl id="engine-machinery" class="detail-metrics"></dl></article><article class="station-card-view card-readout"><h3 data-i18n="station_environment_effects"></h3><dl id="engine-environment" class="detail-metrics"></dl></article><article class="station-card-view station-controls station-wide card-controls"><h3 data-i18n="engine_controls"></h3><label for="engine-telegraph" data-i18n="telegraph"></label><select id="engine-telegraph"></select><button id="engine-telegraph-submit" type="button" data-i18n="engine_order_telegraph"></button><form id="engine-course-form" class="control-form"><label for="engine-course" data-i18n="engine_course"></label><input id="engine-course" type="number" min="0" max="359.99999999999994" step="any" inputmode="decimal" autocomplete="off" required><button id="engine-course-submit" type="submit" data-i18n="engine_order_course"></button></form><form id="engine-speed-form" class="control-form"><label for="engine-speed" data-i18n="engine_speed"></label><input id="engine-speed" type="number" min="0" max="25" step="any" inputmode="decimal" autocomplete="off" required><button id="engine-speed-submit" type="submit" data-i18n="engine_order_speed"></button></form><button id="engine-quiet" type="button"></button><div class="fire-grid"><label for="engine-plant" data-i18n="engine_plant"></label><select id="engine-plant"><option value="AUTO" data-i18n="plant_auto"></option><option value="DIESEL" data-i18n="plant_diesel"></option><option value="TURBINE" data-i18n="plant_turbine"></option></select><button id="engine-plant-apply" type="button" data-i18n="engine_apply_plant"></button></div></article></div></section>
<section id="station-helicopter" class="station-section" data-station-role="helicopter" aria-labelledby="station-helicopter-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-helicopter-title" data-i18n="station_helicopter"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="station_asset"></h3><dl id="helicopter-asset" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="station_readiness"></h3><dl id="helicopter-readiness" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="station_waypoint"></h3><dl id="helicopter-waypoint" class="detail-metrics"></dl><form id="helicopter-waypoint-form" class="control-form"><label for="helicopter-x" data-i18n="helicopter_x"></label><input id="helicopter-x" type="number" min="0" max="1000" step="any" inputmode="decimal" autocomplete="off" required><label for="helicopter-y" data-i18n="helicopter_y"></label><input id="helicopter-y" type="number" min="0" max="1000" step="any" inputmode="decimal" autocomplete="off" required><button id="helicopter-waypoint-submit" type="submit" data-i18n="helicopter_set_waypoint"></button></form></article><article class="station-card-view station-controls"><h3 data-i18n="helicopter_controls"></h3><button id="helicopter-launch" type="button" data-i18n="helicopter_launch"></button><button id="helicopter-return" type="button" data-i18n="helicopter_return"></button><button id="helicopter-buoy" type="button" data-i18n="helicopter_buoy"></button><div class="fire-grid"><label for="helicopter-pattern" data-i18n="helicopter_pattern"></label><select id="helicopter-pattern"><option value="single" data-i18n="buoy_pattern_single"></option><option value="field" data-i18n="buoy_pattern_field"></option><option value="barrier" data-i18n="buoy_pattern_barrier"></option><option value="circle" data-i18n="buoy_pattern_circle"></option></select><button id="helicopter-pattern-apply" type="button" data-i18n="helicopter_apply_pattern"></button><button id="helicopter-mad" type="button"></button></div></article><article class="station-card-view station-wide direct-fire-controls" aria-labelledby="helicopter-fire-title"><h3 id="helicopter-fire-title" data-i18n="helicopter_release_control"></h3><div class="fire-grid"><label for="helicopter-fire-target" data-i18n="fire_target"></label><select id="helicopter-fire-target"></select><label for="helicopter-fire-depth" data-i18n="fire_depth"></label><input id="helicopter-fire-depth" type="number" min="10" max="300" step="any" inputmode="decimal" autocomplete="off"><button id="helicopter-fire-torpedo" type="button" data-fire-action="helicopter_launch_torpedo" data-i18n="helicopter_launch_torpedo"></button></div><p id="helicopter-fire-status" class="fire-status" role="status" aria-live="polite"></p></article><article class="station-card-view station-wide"><h3 data-i18n="buoys"></h3><div id="helicopter-buoys" class="station-list"></div></article></div></section>
<section id="station-eloka" class="station-section" data-station-role="eloka" aria-labelledby="station-eloka-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-eloka-title" data-i18n="station_eloka"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="eloka_hardware"></h3><dl id="eloka-hardware" class="metrics"></dl></article><article class="station-card-view station-controls station-wide"><h3 data-i18n="eloka_filters"></h3><label for="eloka-status-filter" data-i18n="eloka_filter_status"></label><select id="eloka-status-filter"><option value="OPERATIONAL" data-i18n="eloka_filter_operational"></option><option value="LIVE" data-i18n="eloka_filter_live"></option><option value="MEMORY" data-i18n="eloka_filter_memory"></option><option value="ALL" data-i18n="eloka_filter_all"></option></select><label for="eloka-threat-filter" data-i18n="eloka_filter_threat"></label><select id="eloka-threat-filter"><option value="ALL" data-i18n="eloka_filter_all"></option><option value="LOW" data-i18n="eloka_threat_low"></option><option value="MEDIUM" data-i18n="eloka_threat_medium"></option><option value="HIGH" data-i18n="eloka_threat_high"></option><option value="CRITICAL" data-i18n="eloka_threat_critical"></option></select><label for="eloka-band-filter" data-i18n="eloka_filter_band"></label><select id="eloka-band-filter"><option value="ALL" data-i18n="eloka_filter_all"></option><option value="a_c">A/C</option><option value="d">D</option><option value="e_f">E/F</option><option value="g_h">G/H</option><option value="i_j">I/J</option><option value="k">K</option></select><output id="eloka-filter-count" aria-live="polite"></output></article><article class="station-card-view station-wide"><h3 data-i18n="station_intercepts"></h3><div id="eloka-intercepts" class="station-list"></div></article></div></section>
<section id="station-uboot" class="station-section" data-station-role="uboot" aria-labelledby="station-uboot-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="uboot_side"></p><h2 id="station-uboot-title" data-i18n="station_uboot"></h2></div><div class="station-grid uboot-grid"><article class="station-card-view station-wide uboot-strip" data-uboot-stations="uboot uboot_weapons uboot_engine uboot_esm uboot_nav uboot_radio"><div id="uboot-readouts" class="uboot-readouts"></div><div id="uboot-chips" class="uboot-chips" aria-live="polite"></div><p id="uboot-battery-warning" class="station-alert" role="status" hidden></p><p id="uboot-nav-warning" class="station-alert" role="status" hidden></p></article><article class="station-card-view uboot-depth-card" data-uboot-stations="uboot uboot_nav uboot_engine"><h3 data-i18n="uboot_depth_title"></h3><canvas id="uboot-depth-canvas" class="uboot-canvas" data-i18n-aria="uboot_depth_title"></canvas><div class="uboot-presets" role="group" data-i18n-aria="uboot_depth_presets" data-uboot-stations="uboot uboot_nav"><button type="button" data-uboot-depth-preset="periscope" data-i18n="uboot_preset_periscope"></button><button type="button" data-uboot-depth-preset="snorkel" data-i18n="uboot_preset_snorkel"></button><button type="button" data-uboot-depth-preset="above_layer" data-i18n="uboot_preset_above_layer"></button><button type="button" data-uboot-depth-preset="below_layer" data-i18n="uboot_preset_below_layer"></button><button type="button" data-uboot-depth-preset="deep" data-i18n="uboot_preset_deep"></button></div><form id="uboot-depth-form" class="control-form" data-uboot-stations="uboot uboot_nav"><label for="uboot-depth" data-i18n="uboot_depth"></label><input id="uboot-depth" type="number" min="0" max="1000" step="any" inputmode="decimal" autocomplete="off" required><button id="uboot-depth-submit" type="submit" data-i18n="uboot_order_depth"></button></form><div class="uboot-pair" role="group" data-uboot-stations="uboot uboot_nav"><button type="button" data-uboot-mode="uboot_bottom" data-enabled="true" data-i18n="uboot_bottom_on"></button><button type="button" data-uboot-mode="uboot_bottom" data-enabled="false" data-i18n="uboot_bottom_off"></button></div></article><article class="station-card-view station-controls card-controls" data-uboot-stations="uboot uboot_nav"><h3 data-i18n="uboot_nav_title"></h3><form id="uboot-course-form" class="control-form"><label for="uboot-course" data-i18n="uboot_course"></label><input id="uboot-course" type="number" min="0" max="359.99999999999994" step="any" inputmode="decimal" autocomplete="off" required><button id="uboot-course-submit" type="submit" data-i18n="uboot_order_course"></button></form><dl id="uboot-navigation" class="detail-metrics compact-metrics"></dl><div class="uboot-pair" role="group" data-uboot-stations="uboot"><button id="uboot-ping" type="button" data-i18n="uboot_ping"></button><button id="uboot-bt" type="button" data-i18n="uboot_bt"></button></div></article><article class="station-card-view station-controls card-controls uboot-threat-card" data-uboot-stations="uboot uboot_nav" aria-labelledby="uboot-threat-title"><h3 id="uboot-threat-title" data-i18n="uboot_threat_title"></h3><p id="uboot-threat-warning" class="station-alert" role="status" hidden></p><dl id="uboot-threat" class="detail-metrics compact-metrics"></dl><h4 data-i18n="uboot_threat_advice"></h4><div id="uboot-threat-advice" class="station-list compact-list"></div><button id="uboot-evade" type="button" class="danger" data-i18n="uboot_evade"></button><p id="uboot-evade-plan" class="uboot-scope-status" role="status"></p><h4 data-i18n="uboot_threat_intercepts"></h4><div id="uboot-threat-intercepts" class="station-list compact-list"></div></article><article class="station-card-view station-controls card-controls" data-uboot-stations="uboot uboot_engine"><h3 data-i18n="uboot_plant"></h3><div class="uboot-telegraph" role="group" data-i18n-aria="uboot_telegraph"><button type="button" data-uboot-speed-step="0"></button><button type="button" data-uboot-speed-step="1"></button><button type="button" data-uboot-speed-step="2"></button><button type="button" data-uboot-speed-step="3"></button><button type="button" data-uboot-speed-step="4"></button><button type="button" data-uboot-speed-step="5"></button></div><form id="uboot-speed-form" class="control-form"><label for="uboot-speed" data-i18n="uboot_speed"></label><input id="uboot-speed" type="number" min="0" max="40" step="any" inputmode="decimal" autocomplete="off" required><button id="uboot-speed-submit" type="submit" data-i18n="uboot_order_speed"></button></form><div class="uboot-pair" role="group"><button type="button" data-uboot-mode="uboot_silent" data-enabled="true" data-i18n="uboot_silent_on"></button><button type="button" data-uboot-mode="uboot_silent" data-enabled="false" data-i18n="uboot_silent_off"></button></div><div class="uboot-pair" role="group" data-uboot-stations="uboot_enginLine truncated
<section id="station-uboot" class="station-section" data-station-role="uboot" aria-labelledby="station-uboot-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="uboot_side"></p><h2 id="station-uboot-title" data-i18n="station_uboot"></h2></div><div class="station-grid uboot-grid"><article class="station-card-view station-wide uboot-strip" data-uboot-stations="uboot uboot_weapons uboot_engine uboot_esm uboot_nav uboot_radio"><div id="uboot-readouts" class="uboot-readouts"></div><div id="uboot-chips" class="uboot-chips" aria-live="polite"></div><p id="uboot-battery-warning" class="station-alert" role="status" hidden></p><p id="uboot-nav-warning" class="station-alert" role="status" hidden></p></article><article class="station-card-view uboot-depth-card" data-uboot-stations="uboot uboot_nav uboot_engine"><h3 data-i18n="uboot_depth_title"></h3><canvas id="uboot-depth-canvas" class="uboot-canvas" data-i18n-aria="uboot_depth_title"></canvas><div class="uboot-presets" role="group" data-i18n-aria="uboot_depth_presets" data-uboot-stations="uboot uboot_nav"><button type="button" data-uboot-depth-preset="periscope" data-i18n="uboot_preset_periscope"></button><button type="button" data-uboot-depth-preset="snorkel" data-i18n="uboot_preset_snorkel"></button><button type="button" data-uboot-depth-preset="above_layer" data-i18n="uboot_preset_above_layer"></button><button type="button" data-uboot-depth-preset="below_layer" data-i18n="uboot_preset_below_layer"></button><button type="button" data-uboot-depth-preset="deep" data-i18n="uboot_preset_deep"></button></div><form id="uboot-depth-form" class="control-form" data-uboot-stations="uboot uboot_nav"><label for="uboot-depth" data-i18n="uboot_depth"></label><input id="uboot-depth" type="number" min="0" max="1000" step="any" inputmode="decimal" autocomplete="off" required><button id="uboot-depth-submit" type="submit" data-i18n="uboot_order_depth"></button></form><div class="uboot-pair" role="group" data-uboot-stations="uboot uboot_nav"><button type="button" data-uboot-mode="uboot_bottom" data-enabled="true" data-i18n="uboot_bottom_on"></button><button type="button" data-uboot-mode="uboot_bottom" data-enabled="false" data-i18n="uboot_bottom_off"></button></div></article><article class="station-card-view station-controls card-controls" data-uboot-stations="uboot uboot_nav"><h3 data-i18n="uboot_nav_title"></h3><form id="uboot-course-form" class="control-form"><label for="uboot-course" data-i18n="uboot_course"></label><input id="uboot-course" type="number" min="0" max="359.99999999999994" step="any" inputmode="decimal" autocomplete="off" required><button id="uboot-course-submit" type="submit" data-i18n="uboot_order_course"></button></form><dl id="uboot-navigation" class="detail-metrics compact-metrics"></dl><div class="uboot-pair" role="group" data-uboot-stations="uboot"><button id="uboot-ping" type="button" data-i18n="uboot_ping"></button><button id="uboot-bt" type="button" data-i18n="uboot_bt"></button></div></article><article class="station-card-view station-controls card-controls uboot-threat-card" data-uboot-stations="uboot uboot_nav" aria-labelledby="uboot-threat-title"><h3 id="uboot-threat-title" data-i18n="uboot_threat_title"></h3><p id="uboot-threat-warning" class="station-alert" role="status" hidden></p><dl id="uboot-threat" class="detail-metrics compact-metrics"></dl><h4 data-i18n="uboot_threat_advice"></h4><div id="uboot-threat-advice" class="station-list compact-list"></div><button id="uboot-evade" type="button" class="danger" data-i18n="uboot_evade"></button><p id="uboot-evade-plan" class="uboot-scope-status" role="status"></p><h4 data-i18n="uboot_threat_intercepts"></h4><div id="uboot-threat-intercepts" class="station-list compact-list"></div></article><article class="station-card-view station-controls card-controls" data-uboot-stations="uboot uboot_engine"><h3 data-i18n="uboot_plant"></h3><div class="uboot-telegraph" role="group" data-i18n-aria="uboot_telegraph"><button type="button" data-uboot-speed-step="0"></button><button type="button" data-uboot-speed-step="1"></button><button type="button" data-uboot-speed-step="2"></button><button type="button" data-uboot-speed-step="3"></button><button type="button" data-uboot-speed-step="4"></button><button type="button" data-uboot-speed-step="5"></button></div><form id="uboot-speed-form" class="control-form"><label for="uboot-speed" data-i18n="uboot_speed"></label><input id="uboot-speed" type="number" min="0" max="40" step="any" inputmode="decimal" autocomplete="off" required><button id="uboot-speed-submit" type="submit" data-i18n="uboot_order_speed"></button></form><div class="uboot-pair" role="group"><button type="button" data-uboot-mode="uboot_silent" data-enabled="true" data-i18n="uboot_silent_on"></button><button type="button" data-uboot-mode="uboot_silent" data-enabled="false" data-i18n="uboot_silent_off"></button></div><div class="uboot-pair" role="group" data-uboot-stations="uboot_enginLine truncated
</section>
</div>
</aside>
+14 -13
View File
@@ -150,7 +150,7 @@ export function validateV2State(state) {
const sonarFields = ["ref", "label", "source", "classification", "profile", "bearing", "range_nm", "x", "y", "depth_m", "course", "speed_kn", "quality", "age_s", "fix_age_s", "bearing_uncertainty_deg", "range_uncertainty_nm", "observer_x", "observer_y", "released_to_opz", "fixes"];
const radioFields = ["ref", "label", "bearing", "quality", "age_s", "bearing_uncertainty_deg"];
const radioTaskFields = {
row: ["id", "kind", "state", "name", "persons", "x", "y", "radius_nm", "course", "speed_kn", "bearing", "range_nm", "respond_s", "remaining_s", "progress", "sighted", "verdict", "points", "can_answer"],
row: ["id", "type", "state", "name", "persons", "x", "y", "radius_nm", "course", "speed_kn", "bearing", "range_nm", "respond_s", "remaining_s", "progress", "sighted", "verdict", "points", "can_answer"],
kinds: ["sar", "identify", "datum", "ras", "emcon"],
states: ["offered", "active", "done", "failed", "declined"],
};
@@ -170,8 +170,8 @@ export function validateV2State(state) {
};
const sightFields = {
sky: ["light", "dusk", "cloud", "precipitation", "intensity", "wind_from_deg", "sun_bearing", "sun_alt_deg", "moon_bearing", "moon_alt_deg", "moon_illumination", "moon_waxing"],
glasses: ["course", "fov_deg", "visibility_nm", "sea_state", "horizon_offset", "horizon_tilt", "sky", "outlines"],
outline: ["bearing", "span_deg", "cls", "stale"],
glasses: ["course", "fov_deg", "visibility_nm", "sea_state", "horizon_offset", "horizon_tilt", "motion_pitch", "motion_roll", "sky", "outlines"],
outline: ["bearing", "span_deg", "cls", "stale", "lights"],
classes: ["warship", "merchant", "aircraft", "torpedo", "unknown"],
};
const boatFields = {
@@ -190,12 +190,12 @@ export function validateV2State(state) {
esmFix: ["x", "y", "major_nm", "minor_nm", "axis_deg", "lines", "consistent"],
esmCandidate: ["name", "role", "fit"],
threat: ["intercepts", "counts", "loudest_db", "echo_likely", "trend", "layer", "layer_m", "depth_m", "noise", "mast", "esm_count", "advice", "plan"],
intercept: ["kind", "bearing", "level_db", "age_s"],
intercept: ["type", "bearing", "level_db", "age_s"],
interceptKinds: ["hull", "dipping", "buoy", "splash", "torpedo"],
advice: ["uboot.advice.torpedo", "uboot.advice.mast_down", "uboot.advice.slow_down", "uboot.advice.measure_layer", "uboot.advice.go_below", "uboot.advice.evade"],
evadePlan: ["kind", "bearing", "course", "speed_kn", "depth_m", "silent", "decoy"],
evadePlan: ["type", "bearing", "course", "speed_kn", "depth_m", "silent", "decoy"],
radio: ["antenna", "broadcast", "copied", "next_s", "copy", "send", "transmitting", "sitreps", "ack_due", "report", "log"],
radioLog: ["seq", "kind", "age_s", "number", "ack", "report"],
radioLog: ["seq", "type", "age_s", "number", "ack", "report"],
radioLogKinds: ["broadcast", "sent", "aborted"],
radioReport: ["x", "y", "radius_nm", "course", "speed_kn", "age_s"],
};
@@ -230,12 +230,13 @@ export function validateV2State(state) {
["none", "rain", "snow"].includes(sky.precipitation) && typeof sky.moon_waxing === "boolean" &&
sightFields.sky.every((key) => ["precipitation", "moon_waxing"].includes(key) || finite(sky[key])) &&
[sky.light, sky.dusk, sky.cloud, sky.intensity, sky.moon_illumination].every((value) => value >= 0 && value <= 1);
const navLightsOk = (code) => code === null || (typeof code === "string" && /^[LR][012][r-][g-][s-](GW|WR|RWR|GGG|AC)?$/.test(code));
const glassesOk = (glasses) => exactKeys(glasses, sightFields.glasses) && skyOk(glasses.sky) &&
["course", "fov_deg", "visibility_nm", "sea_state", "horizon_offset", "horizon_tilt"].every((key) => finite(glasses[key])) &&
["course", "fov_deg", "visibility_nm", "sea_state", "horizon_offset", "horizon_tilt", "motion_pitch", "motion_roll"].every((key) => finite(glasses[key])) &&
glasses.fov_deg > 0 && glasses.fov_deg <= 180 &&
boundedArray(glasses.outlines, 16) && glasses.outlines.every((row) => exactKeys(row, sightFields.outline) &&
finite(row.bearing) && finite(row.span_deg) && row.span_deg > 0 && sightFields.classes.includes(row.cls) &&
typeof row.stale === "boolean");
typeof row.stale === "boolean" && navLightsOk(row.lights));
const crewOk = (crew) => exactKeys(crew, crewFields.row) &&
Number.isInteger(crew.on_watch) && crew.on_watch >= 1 && crew.on_watch <= 3 &&
Array.isArray(crew.watches) && crew.watches.length === 3 &&
@@ -349,7 +350,7 @@ export function validateV2State(state) {
typeof scope.available !== "boolean" || typeof scope.night !== "boolean" ||
scopeNumbers.some((key) => !finite(scope[key])) || scope.relative_deg < 0 || scope.relative_deg >= 360 ||
!boundedArray(scope.sightings, 16) || scope.sightings.some((row) =>
!exactKeys(row, ["ref", "category", "cls", "bearing", "span_deg", "quality", "age_s", "range_nm", "range_sigma_nm", "range_age_s", "solution"]) ||
!exactKeys(row, ["ref", "category", "cls", "bearing", "span_deg", "quality", "age_s", "range_nm", "range_sigma_nm", "range_age_s", "solution", "lights"]) || !navLightsOk(row.lights) ||
(row.solution !== null && (!exactKeys(row.solution, ["marks", "course", "speed_kn", "lead_deg", "run_s", "quality"]) ||
!Number.isSafeInteger(row.solution.marks) || row.solution.marks < 1 || row.solution.marks > 6 ||
[row.solution.course, row.solution.speed_kn, row.solution.lead_deg, row.solution.run_s].some((value) => value !== null && !finite(value)) ||
@@ -421,7 +422,7 @@ export function validateV2State(state) {
if (!exactKeys(threat, boatFields.threat) || !exactKeys(threat.counts, boatFields.interceptKinds) ||
boatFields.interceptKinds.some((kind) => !Number.isInteger(threat.counts[kind]) || threat.counts[kind] < 0) ||
!boundedArray(threat.intercepts, 12) || threat.intercepts.some((row) => !exactKeys(row, boatFields.intercept) ||
!boatFields.interceptKinds.includes(row.kind) || !finite(row.bearing) || !finite(row.age_s) ||
!boatFields.interceptKinds.includes(row.type) || !finite(row.bearing) || !finite(row.age_s) ||
!nullableNumber(row.level_db)) ||
![threat.loudest_db, threat.layer_m].every(nullableNumber) || !finite(threat.depth_m) ||
typeof threat.echo_likely !== "boolean" || typeof threat.mast !== "boolean" ||
@@ -430,7 +431,7 @@ export function validateV2State(state) {
!["cavitating", "snorkel", "quiet", "loud", "moderate"].includes(threat.noise) ||
!Number.isInteger(threat.esm_count) || threat.esm_count < 0 ||
!boundedArray(threat.advice, 4) || !threat.advice.every((key) => boatFields.advice.includes(key)) ||
(plan !== null && (!exactKeys(plan, boatFields.evadePlan) || !["torpedo", "ping"].includes(plan.kind) ||
(plan !== null && (!exactKeys(plan, boatFields.evadePlan) || !["torpedo", "ping"].includes(plan.type) ||
["bearing", "course", "speed_kn", "depth_m"].some((key) => !finite(plan[key])) ||
typeof plan.silent !== "boolean" || typeof plan.decoy !== "boolean"))) throw new Error("protocol");
// Radio room: schedule, own transmissions and HQ's (modelled) contact report.
@@ -442,7 +443,7 @@ export function validateV2State(state) {
!Number.isInteger(radio.broadcast) || radio.broadcast < 0 || !Number.isInteger(radio.sitreps) || radio.sitreps < 0 ||
!finite(radio.next_s) || !nullableNumber(radio.copy) || !nullableNumber(radio.send) || !radioReport(radio.report) ||
!boundedArray(radio.log, 12) || radio.log.some((row) => !exactKeys(row, boatFields.radioLog) ||
!Number.isInteger(row.seq) || !boatFields.radioLogKinds.includes(row.kind) || !nullableNumber(row.age_s) ||
!Number.isInteger(row.seq) || !boatFields.radioLogKinds.includes(row.type) || !nullableNumber(row.age_s) ||
(row.number !== null && !Number.isInteger(row.number)) || typeof row.ack !== "boolean" || !radioReport(row.report))) throw new Error("protocol");
} else if (state.role === "weapons") {
if (!exactKeys(payload.settings, ["torpedo_type", "choices", "pattern", "enable_nm", "salvo"]) ||
@@ -502,7 +503,7 @@ export function validateV2State(state) {
tacticalRows(payload.tactical, 128);
const nullableFinite = (value) => value === null || finite(value);
if (!boundedArray(payload.tasks, 8) || payload.tasks.some((row) => !exactKeys(row, radioTaskFields.row) ||
!Number.isSafeInteger(row.id) || row.id < 1 || !radioTaskFields.kinds.includes(row.kind) ||
!Number.isSafeInteger(row.id) || row.id < 1 || !radioTaskFields.kinds.includes(row.type) ||
!radioTaskFields.states.includes(row.state) || (row.name !== null && (typeof row.name !== "string" || row.name.length > 24)) ||
!Number.isInteger(row.persons) || row.persons < 0 || [row.x, row.y, row.radius_nm, row.bearing, row.range_nm, row.progress].some((value) => !finite(value)) ||
[row.course, row.speed_kn, row.respond_s, row.remaining_s].some((value) => !nullableFinite(value)) ||
+16 -4
View File
@@ -5,13 +5,16 @@ import { sightingText } from "../state/schema.js";
import { metrics, node, position, stationRows, tacticalEntries, yesNo } from "../views/dom.js";
import { DISPLAY_CLOCK_LAG_S, displaySimNow } from "../state/display-clock.js";
import { renderCrew } from "../views/crew.js";
import { drawSightView } from "../views/sight-scene.js";
import { drawSightView, viewMotion } from "../views/sight-scene.js";
import { createOptics, opticsFov, opticsText, wireOptics } from "../views/optics.js";
import { visualContext } from "../views/visual-common.js";
// The lookout's binoculars: trained relative to the bow in this browser only
// (presentation, like the uConsole's binoculars); the picture shows his own
// sightings from the published ``lookout`` block.
const glasses = {relative: 0, wired: false};
const glasses = {relative: 0, wired: false,
// Zoom binoculars (config.LOOKOUT_GLASSES_POWERS, _ELEVATION_DEG).
optics: createOptics([1, 2, 4], [-20, 45])};
function wireGlasses() {
if (glasses.wired) return;
glasses.wired = true;
@@ -20,6 +23,8 @@ function wireGlasses() {
glasses.relative = ((glasses.relative + Number(button.dataset.glassesTurn)) % 360 + 360) % 360;
renderGlassesStatus(); drawBridgeGlasses(performance.now());
});
wireOptics(document.querySelector('[data-optics="glasses"]'), glasses.optics,
() => { renderGlassesStatus(); drawBridgeGlasses(performance.now()); });
$("bridge-glasses-bow").addEventListener("click", () => {
glasses.relative = 0; renderGlassesStatus(); drawBridgeGlasses(performance.now());
});
@@ -28,7 +33,8 @@ function renderGlassesStatus() {
const lookout = S.v2State?.bridge?.lookout;
if (!lookout) return;
const bearing = (lookout.course + glasses.relative) % 360;
const text = t("glasses_bearing", {bearing: number(bearing, 0).padStart(3, "0"), relative: number(glasses.relative, 0).padStart(3, "0")});
const text = `${t("glasses_bearing", {bearing: number(bearing, 0).padStart(3, "0"),
relative: number(glasses.relative, 0).padStart(3, "0")})} · ${opticsText(glasses.optics, lookout.fov_deg)}`;
if ($("bridge-glasses-status").textContent !== text) $("bridge-glasses-status").textContent = text;
}
export function drawBridgeGlasses(now) {
@@ -36,8 +42,14 @@ export function drawBridgeGlasses(now) {
if (!lookout || S.session?.station !== "bridge") return;
const plot = visualContext("bridge-glasses-canvas");
if (!plot) return;
// The hull's pitch and roll seen along this browser's own line of sight.
const [offset, tilt] = viewMotion(lookout.motion_pitch, lookout.motion_roll, glasses.relative);
drawSightView(plot.context, plot.width, plot.height,
{...lookout, bearing: (lookout.course + glasses.relative) % 360}, now / 1000, plot.context.font);
{...lookout, bearing: (lookout.course + glasses.relative) % 360, horizon_offset: offset, horizon_tilt: tilt,
fov_deg: opticsFov(glasses.optics, lookout.fov_deg), elevation_deg: glasses.optics.elevation,
stabilized: glasses.optics.stabilized, stab_label: t("sight_stabilized"),
optics_label: opticsText(glasses.optics, lookout.fov_deg)},
now / 1000, plot.context.font);
}
export function renderBridgeStation(payload) {
+4 -4
View File
@@ -83,9 +83,9 @@ function taskFacts(row) {
if (finite(row.course)) facts.push(t("radio_task_motion", {course: number(row.course, 0), speed: number(row.speed_kn, 0)}));
if (finite(row.respond_s)) facts.push(t("radio_task_respond", {seconds: number(row.respond_s, 0)}));
else if (finite(row.remaining_s)) facts.push(t("radio_task_remaining", {minutes: number(row.remaining_s / 60, 0)}));
if (row.kind === "sar" && !CLOSED_TASK_STATES.includes(row.state))
if (row.type === "sar" && !CLOSED_TASK_STATES.includes(row.state))
facts.push(t(row.sighted ? "radio_task_sighted" : "radio_task_not_sighted"));
if (row.state === "active" && row.kind !== "identify")
if (row.state === "active" && row.type !== "identify")
facts.push(t("radio_task_progress", {progress: number(row.progress * 100, 0)}));
if (row.verdict) facts.push(t(`radio_task_verdict_${row.verdict}`));
if (CLOSED_TASK_STATES.includes(row.state))
@@ -99,9 +99,9 @@ function taskCard(row) {
card.dataset.state = row.state;
card.dataset.rowKey = String(row.id);
const head = node("div", undefined, "radio-task-head");
head.append(node("strong", `${row.kind.toUpperCase()} ${row.id} · ${t(`radio_task_kind_${row.kind}`)}`),
head.append(node("strong", `${row.type.toUpperCase()} ${row.id} · ${t(`radio_task_kind_${row.type}`)}`),
node("span", t(`radio_task_state_${row.state}`), "radio-task-state"));
card.append(head, node("p", t(`radio_task_brief_${row.kind}`, {name: row.name ?? "-", persons: row.persons}), "radio-task-brief"),
card.append(head, node("p", t(`radio_task_brief_${row.type}`, {name: row.name ?? "-", persons: row.persons}), "radio-task-brief"),
node("p", taskFacts(row), "radio-task-facts"));
if (row.state === "offered") {
const actions = node("div", undefined, "radio-task-actions");
+12 -1
View File
@@ -2,6 +2,7 @@ import { finite, number, t } from "../core/format.js";
import { palette } from "../core/palette.js";
import { drawEmpty, visualContext } from "../views/visual-common.js";
import { drawSightView } from "../views/sight-scene.js";
import { createOptics, opticsFov, opticsText, wireOptics } from "../views/optics.js";
// Boat instruments drawn from the boat's own picture only: its depth and
// orders, the charted bottom, the layer of its own BT measurement, and the
@@ -228,6 +229,9 @@ export function drawBoatDamage(id, payload) {
// of jumping once per state (time constant SCOPE_EASE_S, wall clock only;
// display only, the orders and the stadimeter use the published state).
const SCOPE_EASE_S = 0.25;
// This browser's eyepiece: low/high power (config.UBOOT_SCOPE_POWERS) and
// the head's tilt range (config.UBOOT_SCOPE_ELEVATION_DEG).
const scopeOptics = createOptics([1, 4], [-10, 60]);
const scopeView = {id: null, target: null, shown: null, frame: null, last: 0};
const wrap180 = (deg) => ((deg + 540) % 360) - 180;
@@ -249,6 +253,10 @@ function scopeStep(now) {
export function drawBoatScope(id, payload) {
const scope = payload.scope;
wireOptics(document.querySelector('[data-optics="scope"]'), scopeOptics, () => {
if (scopeView.target && scopeView.shown) drawScopeFrame(scopeView.id, {...scopeView.target, ...scopeView.shown});
else drawScopeFrame(id, payload.scope);
});
const smooth = scope.available && finite(scope.bearing) && finite(scope.horizon_offset) && finite(scope.horizon_tilt);
const continuing = smooth && scopeView.id === id && scopeView.shown !== null;
scopeView.id = id;
@@ -279,8 +287,11 @@ function drawScopeFrame(id, scope) {
return true;
}
drawSightView(g, width, height, {...scope, window_deg: scope.window_deg,
fov_deg: opticsFov(scopeOptics, scope.fov_deg), elevation_deg: scopeOptics.elevation,
stabilized: scopeOptics.stabilized, stab_label: t("sight_stabilized"),
optics_label: opticsText(scopeOptics, scope.fov_deg),
outlines: scope.sightings.map((row) => ({bearing: row.bearing, span_deg: row.span_deg, cls: row.cls,
stale: row.age_s === null || row.age_s > 1}))}, performance.now() / 1000, g.font);
stale: row.age_s === null || row.age_s > 1, lights: row.lights}))}, performance.now() / 1000, g.font);
if (!finite(scope.bearing)) drawEmpty(plot);
return true;
}
+5 -5
View File
@@ -382,11 +382,11 @@ function radioReportText(report, nav) {
function radioLogText(row) {
const age = duration(row.age_s);
if (row.kind === "broadcast") {
if (row.type === "broadcast") {
const text = t(row.report ? "uboot_radio_log_broadcast_report" : "uboot_radio_log_broadcast", {age, number: row.number});
return row.ack ? t("uboot_radio_log_with_ack", {entry: text}) : text;
}
return row.kind === "sent" ? t("uboot_radio_log_sent", {age, number: row.number}) : t("uboot_radio_log_aborted", {age});
return row.type === "sent" ? t("uboot_radio_log_sent", {age, number: row.number}) : t("uboot_radio_log_aborted", {age});
}
function renderRadio(radio, nav) {
@@ -424,13 +424,13 @@ function renderThreat(threat) {
$("uboot-evade").dataset.ready = String(plan !== null);
$("uboot-evade-plan").textContent = plan === null ? t("uboot_evade_no_plan")
: t("uboot_evade_plan", {course: number(plan.course, 0), speed: number(plan.speed_kn, 0), depth: number(plan.depth_m, 0),
source: t(`uboot_threat_kind_${plan.kind}`)});
source: t(`uboot_threat_kind_${plan.type}`)});
$("uboot-threat-intercepts").replaceChildren(...(threat.intercepts.length ? threat.intercepts.map((row) => {
const line = node("p", undefined, "uboot-log-line");
line.append(node("span", t("uboot_log_age", {age: number(row.age_s, 0)}), "uboot-log-age"),
node("span", row.level_db === null
? t("uboot_threat_row_bearing", {kind: t(`uboot_threat_kind_${row.kind}`), bearing: number(row.bearing, 0)})
: t("uboot_threat_row", {kind: t(`uboot_threat_kind_${row.kind}`), bearing: number(row.bearing, 0),
? t("uboot_threat_row_bearing", {kind: t(`uboot_threat_kind_${row.type}`), bearing: number(row.bearing, 0)})
: t("uboot_threat_row", {kind: t(`uboot_threat_kind_${row.type}`), bearing: number(row.bearing, 0),
level: number(row.level_db, 0)})));
return line;
}) : [node("p", t("station_none"), "uboot-log-line")]));
+38
View File
@@ -0,0 +1,38 @@
// Tilt, zoom and stabilizer of an eyepiece in this browser only
// (presentation, like the uConsole's src/core/optics.py; never sent).
import { number, t } from "../core/format.js";
export function createOptics(powers, elevation) {
return {powers, min: elevation[0], max: elevation[1], elevation: 0, power: 0, stabilized: false};
}
export const opticsFov = (optics, baseFov) => baseFov / optics.powers[optics.power];
export function opticsText(optics, baseFov) {
return t("optics_status", {elevation: `${optics.elevation >= 0 ? "+" : ""}${number(optics.elevation, 0)}`,
fov: number(opticsFov(optics, baseFov), 0)});
}
// Buttons inside ``group``: data-optics-tilt (degrees), data-optics-zoom
// (-1/1) and data-optics-stabilizer (aria-pressed).
export function wireOptics(group, optics, changed) {
if (!group || group.dataset.wired) return;
group.dataset.wired = "true";
const stabilizer = group.querySelector("[data-optics-stabilizer]");
for (const button of group.querySelectorAll("[data-optics-tilt]"))
button.addEventListener("click", () => {
optics.elevation = Math.max(optics.min, Math.min(optics.max, optics.elevation + Number(button.dataset.opticsTilt)));
changed();
});
for (const button of group.querySelectorAll("[data-optics-zoom]"))
button.addEventListener("click", () => {
optics.power = Math.max(0, Math.min(optics.powers.length - 1, optics.power + Number(button.dataset.opticsZoom)));
changed();
});
stabilizer?.setAttribute("aria-pressed", "false");
stabilizer?.addEventListener("click", () => {
optics.stabilized = !optics.stabilized;
stabilizer.setAttribute("aria-pressed", String(optics.stabilized));
changed();
});
}
+108 -29
View File
@@ -4,7 +4,7 @@
// in steel with a lit rim, rain, snow or fog, the bearing scale and the
// corner brackets. Display only: every value comes from the detached state
// (the view's ``sky`` block and outlines); the phase is the wall clock.
import { DETAIL_MIN_PX, FOAM, PROFILES } from "./silhouette-profiles.js";
import { DETAIL_MIN_PX, FOAM, NAV_LIGHT, PROFILES } from "./silhouette-profiles.js";
const SKY_NIGHT = [[3, 7, 16], [20, 44, 62]], SKY_DAY = [[34, 88, 118], [138, 176, 182]], SKY_DUSK = [[24, 30, 60], [204, 128, 78]];
const SEA_NIGHT = [[10, 44, 58], [2, 9, 15]], SEA_DAY = [[24, 78, 92], [6, 34, 46]], SEA_DUSK = [[44, 50, 66], [8, 14, 26]];
@@ -14,6 +14,7 @@ const MOON = [214, 222, 206], MOON_DARK = [26, 34, 42], SUN_DAY = [255, 244, 210
const STEEL_NIGHT = [19, 36, 46], STEEL_DAY = [44, 56, 64], RIM_NIGHT = [84, 150, 158], RIM_DAY = [170, 196, 200];
const WINDOW_LIGHT = [250, 205, 120], FRAME = [40, 96, 90];
const SCALE = "rgb(170, 232, 208)", CROSSHAIR = "rgb(120, 214, 180)";
const STABILIZED_RESIDUAL = .12; // src/ui/horizon.py
const VISIBILITY_MAX_NM = 30, BODY_MAX_ALT_DEG = 45, SCALE_LABEL_MIN_PX = 36;
const clamp = (value, low = 0, high = 1) => Math.max(low, Math.min(high, value));
@@ -50,13 +51,13 @@ export function palette(sky, haze) {
}
// --- silhouettes (the uConsole's profiles, generated) -----------------------
function frameFor(cls, cx, base, width, t) {
function frameFor(cls, cx, base, width, t, facing = -1) {
const profile = PROFILES[cls] || PROFILES.unknown;
const lift = profile.hover ? width * (.25 + .02 * Math.sin(t * 1.3)) : 0;
const pitch = profile.pitch_deg * Math.PI / 180 * Math.sin(2 * Math.PI * profile.pitch_hz * t);
const cos = Math.cos(pitch), sin = Math.sin(pitch), left = cx - width / 2, baseY = base - lift;
const point = (u, v) => {
const du = u - .5, ru = du * cos - v * sin, rv = du * sin + v * cos;
const du = u - .5, ru = (du * cos - v * sin) * (facing > 0 ? -1 : 1), rv = du * sin + v * cos;
return [left + (.5 + ru) * width, baseY - rv * width];
};
return {point, poly: (points) => points.map(([u, v]) => point(u, v))};
@@ -70,13 +71,57 @@ function line(g, a, b, color, width = 1) {
g.strokeStyle = color; g.lineWidth = width; g.beginPath(); g.moveTo(a[0], a[1]); g.lineTo(b[0], b[1]); g.stroke();
}
export function drawProfile(g, cls, cx, base, width, fill, {t = 0, rim = null, lights = null} = {}) {
// Navigation lights: code "<L|R><masts><r|-><g|-><s|->" (src/sensors/nav_lights.py);
// drawn at any size, since at night the lights are what the eye picks up first.
export const navFacing = (code) => (typeof code === "string" && code[0] === "R" ? 1 : -1);
// A red beacon flash every second, a white strobe double flash every 1.2 s.
function antiCollision(t) {
const phase = t % 1.2;
return [t % 1 < .12, phase < .06 || (phase >= .18 && phase < .24)];
}
function drawNavLights(g, cls, frame, width, code, t) {
const aircraft = code.slice(5) === "AC";
const nav = aircraft ? PROFILES.aircraft.nav : (PROFILES[cls] || PROFILES.merchant).nav || PROFILES.merchant.nav;
const core = Math.max(1, Math.min(3, Math.floor(width / 150))), points = [], roundLights = code.slice(5);
// A trawler's single masthead light stands abaft and above her green.
const mast = roundLights === "GW" ? nav.mast.slice(1) : nav.mast;
for (let index = 0; index < Number(code[1]); index++) points.push([mast[index], "white"]);
const [su, sv] = nav.side, red = code[2] === "r", green = code[3] === "g";
if (red && green) points.push([[su - .004, sv], "red"], [[su + .004, sv], "green"]);
else if (red) points.push([[su, sv], "red"]);
else if (green) points.push([[su, sv], "green"]);
if (code[4] === "s") points.push([nav.stern, "white"]);
const spots = points.map(([[u, v], name]) => [frame.point(u, v), name]);
if (aircraft) {
const [beacon, strobe] = antiCollision(t);
if (beacon) for (const [u, v] of nav.beacon) spots.push([frame.point(u, v), "red"]);
if (strobe) spots.push([frame.point(...nav.strobe), "white"]);
} else if (roundLights) {
// All-round lights down the mast (mine clearance: masthead and each yardarm).
const [x, y] = frame.point(...nav.round), step = Math.max(core * 2 + 3, width * .02);
const names = {W: "white", R: "red", G: "green"};
if (roundLights === "GGG") spots.push([[x, y - step], "green"], [[x - step, y], "green"], [[x + step, y], "green"]);
else [...roundLights].forEach((letter, index) => spots.push([[x, y - step * (roundLights.length - index)], names[letter]]));
}
for (const [[x, y], name] of spots) {
const color = NAV_LIGHT[name];
g.fillStyle = rgb(color.map((c) => Math.floor(c * .45)));
g.beginPath(); g.arc(x, y, core + 2, 0, 2 * Math.PI); g.fill();
g.fillStyle = rgb(color);
g.beginPath(); g.arc(x, y, core, 0, 2 * Math.PI); g.fill();
}
}
export function drawProfile(g, cls, cx, base, width, fill, {t = 0, rim = null, lights = null, nav = null} = {}) {
width = Math.max(3, width);
if (cls === "torpedo") {
line(g, [cx - width / 2, base + 1], [cx + width / 2, base + 1], rgb(FOAM), Math.max(1, Math.min(3, width / 12)));
return;
}
const profile = PROFILES[cls] || PROFILES.unknown, frame = frameFor(cls, cx, base, width, t);
const facing = navFacing(nav);
const profile = PROFILES[cls] || PROFILES.unknown, frame = frameFor(cls, cx, base, width, t, facing);
const detail = width >= DETAIL_MIN_PX, fillColor = rgb(fill), rimColor = rim ? rgb(rim) : fillColor;
const polys = [frame.poly(profile.hull), ...profile.blocks.map((block) => frame.poly(block))];
g.fillStyle = fillColor;
@@ -107,24 +152,28 @@ export function drawProfile(g, cls, cx, base, width, fill, {t = 0, rim = null, l
const bow = frame.point(.03, 0), stern = frame.point(1, 0), foam = rgb(FOAM);
for (let index = 0; index < 3; index++) {
const phase = (t * 1.7 + index * .33) % 1, reach = width * (.01 + .035 * phase), rise = width * .018 * (1 - phase);
line(g, [bow[0] - reach * .3, bow[1]], [bow[0] - reach, bow[1] - rise], foam);
line(g, [bow[0] + facing * reach * .3, bow[1]], [bow[0] + facing * reach, bow[1] - rise], foam);
}
const step = Math.max(3, width * .04), offset = (t * 18) % (2 * step);
for (let k = 0; k < 6; k++) {
const start = offset + k * 2 * step;
if (start > width * .35) break;
line(g, [stern[0] + start, stern[1]], [stern[0] + start + step * .8, stern[1]], foam);
line(g, [stern[0] - facing * start, stern[1]], [stern[0] - facing * (start + step * .8), stern[1]], foam);
}
}
if (typeof nav === "string") drawNavLights(g, cls, frame, width, nav, t);
}
// --- the picture ------------------------------------------------------------
function view(width, height, v) {
const pxPerDeg = width / v.fov_deg;
const horizon = height / 2 + v.horizon_offset * (height / 260);
const tilt = v.horizon_tilt;
const skyH = Math.max(8, horizon);
return {width, height, pxPerDeg, horizon, tilt, skyH, los: v.bearing,
// A stabilized optic keeps STABILIZED_RESIDUAL of the hull's motion;
// tilting it up (elevation_deg) moves the sky and the horizon down.
const steady = v.stabilized ? STABILIZED_RESIDUAL : 1, lift = (v.elevation_deg || 0) * pxPerDeg;
const horizon = height / 2 + v.horizon_offset * steady * (height / 260) + lift;
const tilt = v.horizon_tilt * steady;
const skyH = Math.max(8, height / 2), skyY = skyH + lift; // the sky stays still: nominal horizon
return {width, height, pxPerDeg, horizon, tilt, skyH, skyY, los: v.bearing,
x: (bearing) => width / 2 + wrap(bearing - v.bearing) * pxPerDeg,
base: (x) => horizon + Math.tan(tilt) * (x - width / 2),
visible: (bearing, half = 0) => Math.abs(wrap(bearing - v.bearing)) <= v.fov_deg / 2 + half};
@@ -133,14 +182,14 @@ function view(width, height, v) {
const bodyFraction = (alt) => .12 + .7 * clamp(alt / BODY_MAX_ALT_DEG);
function drawSky(g, w, sky, colors, t, haze) {
const gradient = g.createLinearGradient(0, w.horizon + 40 - w.height, 0, w.horizon + 40);
const gradient = g.createLinearGradient(0, w.skyY + 40 - w.height, 0, w.skyY + 40);
gradient.addColorStop(0, rgb(colors.sky[0])); gradient.addColorStop(1, rgb(colors.sky[1]));
g.fillStyle = gradient; g.fillRect(0, 0, w.width, w.height);
const stars = (1 - sky.light * 1.8) * (1 - sky.cloud) * (1 - haze);
if (stars > .05) {
for (const [bearing, alt, phase, speed, bright] of FIELD.stars) {
if (!w.visible(bearing)) continue;
const x = w.x(bearing), y = w.base(x) - (.08 + .92 * alt) * w.skyH;
const x = w.x(bearing), y = w.skyY - (.08 + .92 * alt) * w.skyH;
if (y < 2) continue;
const glow = (.55 + .45 * Math.sin(t * speed + phase)) * stars, level = Math.round((bright ? 150 : 90) * glow + 30 * stars);
g.fillStyle = rgb(mix(colors.sky[0], [level + 40, level + 40, Math.min(255, level + 70)], stars));
@@ -153,11 +202,11 @@ function drawSky(g, w, sky, colors, t, haze) {
g.fillStyle = rgb(color); g.beginPath(); g.arc(x, y, radius, 0, Math.PI * 2); g.fill();
};
if (sky.light > .05 && sky.sun_alt_deg > -1 && cover > .05 && w.visible(sky.sun_bearing, 2)) {
const x = w.x(sky.sun_bearing), y = w.base(x) - bodyFraction(sky.sun_alt_deg) * w.skyH;
const x = w.x(sky.sun_bearing), y = w.skyY - bodyFraction(sky.sun_alt_deg) * w.skyH;
disc(x, y, mix(mix(SUN_DAY, SUN_DUSK, sky.dusk), colors.sky[1], 1 - cover), [[radius * 3, .85], [radius * 2, .7]]);
}
if (sky.light < .6 && sky.moon_alt_deg > 0 && sky.moon_illumination > .03 && cover > .05 && w.visible(sky.moon_bearing, 2)) {
const x = w.x(sky.moon_bearing), y = w.base(x) - bodyFraction(sky.moon_alt_deg) * w.skyH;
const x = w.x(sky.moon_bearing), y = w.skyY - bodyFraction(sky.moon_alt_deg) * w.skyH;
disc(x, y, mix(MOON, colors.sky[1], (1 - cover) + haze * .5), [[radius * 4, .9], [radius * 3, .82], [radius * 2, .7]]);
if (sky.moon_illumination < .97) {
const shift = (sky.moon_waxing ? -1 : 1) * 2 * radius * sky.moon_illumination;
@@ -174,7 +223,7 @@ function drawSky(g, w, sky, colors, t, haze) {
for (const [start, alt, widthDeg, height, shade] of FIELD.clouds.slice(0, count)) {
const bearing = start + drift;
if (!w.visible(bearing, widthDeg)) continue;
const x = w.x(bearing), y = w.base(x) - alt * w.skyH, cw = widthDeg * w.pxPerDeg, ch = Math.max(4, height * w.skyH * 1.6);
const x = w.x(bearing), y = w.skyY - alt * w.skyH, cw = widthDeg * w.pxPerDeg, ch = Math.max(4, height * w.skyH * 1.6);
const puffs = [[0, 0, 1, .6], [-.25, -.25, .5, .6], [.2, -.3, .45, .7], [.3, .05, .5, .5]];
puffs.forEach(([dx, dy, fw, fh], index) => {
const ex = x + dx * cw, ey = y + dy * ch;
@@ -185,26 +234,50 @@ function drawSky(g, w, sky, colors, t, haze) {
}
}
// Horizon motion seen lookRelDeg off the bow (src/ui/horizon.py view_motion):
// ahead the pitch lifts it and the roll tilts it, abeam the other way round.
export function viewMotion(pitch, roll, lookRelDeg = 0) {
const look = lookRelDeg * Math.PI / 180;
const lift = pitch * Math.cos(look) + roll * Math.sin(look), lean = roll * Math.cos(look) - pitch * Math.sin(look);
return [Math.max(-40, Math.min(40, lift * 260)), Math.max(-.25, Math.min(.25, lean * .6))];
}
// The sea as seen (src/ui/sight_scene.py sea_aspect): head 1 into the sea,
// -1 down-sea; cross +1 when the waves run left to right.
export function seaAspect(windFromDeg, lineOfSight) {
const angle = (windFromDeg - lineOfSight) * Math.PI / 180;
return [Math.cos(angle), -Math.sin(angle)];
}
function drawSea(g, w, sky, colors, seaState, t, haze) {
const amp = .6 + .35 * seaState, step = Math.max(6, Math.floor(w.width / 60)), crest = [];
const [head, cross] = seaAspect(sky.wind_from_deg, w.los);
// The pattern lies on the sea (bearing space) and runs with the swell.
const anchor = w.los * w.pxPerDeg, swell = cross * t * 14;
for (let x = 0; x <= w.width + step; x += step) {
crest.push([x, w.base(x) + amp * Math.sin(x * .045 + t * 1.6) + .6 * amp * Math.sin(x * .013 - t * .9)]);
crest.push([x, w.base(x) + amp * Math.sin((x + anchor - swell) * .045 + t * 1.6 * Math.abs(head)) +
.6 * amp * Math.sin((x + anchor - swell) * .013 - t * .9)]);
}
const top = Math.min(w.base(0), w.base(w.width));
const gradient = g.createLinearGradient(0, top, 0, w.height);
gradient.addColorStop(0, rgb(colors.sea[0])); gradient.addColorStop(1, rgb(colors.sea[1]));
g.fillStyle = gradient; path(g, [...crest, [w.width, w.height], [0, w.height]]); g.fill();
const rows = 9, below = w.height - w.horizon;
for (let row = 1; row <= rows; row++) {
const depth = below * (row / rows) ** 1.7;
if (depth < 3) continue;
const spacing = 24 + row * 10, length = 6 + row * 3, offset = (t * (6 + row * 3)) % (2 * spacing);
const shade = rgb(mix(colors.wave, colors.sea[1], row / (rows + 3)));
// Into or down the sea long rows come at the eye or run away; across it
// short crests run sideways and lean with the perspective.
const rows = 9, below = w.height - w.horizon, along = Math.abs(head), roll = (((t * .12 * head) % 1) + 1) % 1;
for (let index = 0; index <= rows; index++) {
const row = index + roll, depth = below * (row / rows) ** 1.7;
if (depth < 3 || row > rows) continue;
const spacing = Math.floor(24 + row * 10), length = (6 + row * 3) * (.55 + 1.1 * along);
const lean = cross * (1 + row * .7) * (1 - along);
const offset = (((anchor + t * (6 + row * 3) * cross) % (2 * spacing)) + 2 * spacing) % (2 * spacing);
let shade = mix(colors.wave, colors.sea[1], row / (rows + 3));
if (head < 0) shade = mix(shade, colors.sea[1], .35 * -head); // down-sea: the waves' backs
for (let x = -2 * spacing; x < w.width; x += spacing) {
if ((Math.floor(x / spacing) + row) % 2) continue;
const x0 = x + offset, y0 = w.base(x0) + depth;
line(g, [x0, y0], [x0 + length, y0], shade);
if (seaState >= 4 && (Math.floor(x / spacing) * 7 + row) % 5 === 0) line(g, [x0 + 2, y0 - 1], [x0 + length - 2, y0 - 1], rgb(colors.crest));
if ((Math.floor(x / spacing) + index) % 2) continue;
const x0 = x - offset, y0 = w.base(x0) + depth;
line(g, [x0, y0], [x0 + length, y0 - lean], rgb(shade));
if (seaState >= 4 && (Math.floor(x / spacing) * 7 + index) % 5 === 0) line(g, [x0 + 2, y0 - 1], [x0 + length - 2, y0 - 1 - lean], rgb(colors.crest));
}
}
g.strokeStyle = rgb(colors.crest); g.lineWidth = 1; path(g, crest, false); g.stroke();
@@ -263,7 +336,7 @@ function drawFrame(g, width, height) {
// One eyepiece picture. ``v``: bearing (line of sight), fov_deg,
// horizon_offset, horizon_tilt, visibility_nm, sea_state, sky, outlines
// ([{bearing, span_deg, cls, stale}]) and an optional window_deg crosshair.
// ([{bearing, span_deg, cls, stale, lights}]) and an optional window_deg crosshair.
export function drawSightView(g, width, height, v, t, labelFont = "11px ui-monospace, monospace") {
const w = view(width, height, v), haze = 1 - clamp(v.visibility_nm / VISIBILITY_MAX_NM);
const sky = v.sky, colors = palette(sky, haze);
@@ -274,7 +347,8 @@ export function drawSightView(g, width, height, v, t, labelFont = "11px ui-monos
if (!w.visible(row.bearing, row.span_deg / 2)) continue;
const cx = w.x(row.bearing), fade = row.stale ? .55 : haze * .6;
drawProfile(g, row.cls, cx, w.base(cx), Math.min(width, Math.max(3, row.span_deg * w.pxPerDeg)), mix(colors.steel, colors.haze, fade),
{t, rim: mix(colors.rim, colors.haze, fade), lights: lit && !row.stale ? WINDOW_LIGHT : null});
{t, rim: mix(colors.rim, colors.haze, fade), lights: lit && !row.stale ? WINDOW_LIGHT : null,
nav: row.stale ? null : row.lights ?? null});
}
drawWeather(g, w, sky, colors, v.visibility_nm, t, haze);
const labelStep = [10, 30, 45, 90].find((step) => step * w.pxPerDeg >= SCALE_LABEL_MIN_PX) ?? 90;
@@ -294,5 +368,10 @@ export function drawSightView(g, width, height, v, t, labelFont = "11px ui-monos
line(g, [cx - window, cy], [cx + window, cy], CROSSHAIR);
for (const mark of [-1, 1]) line(g, [cx + mark * window, cy - 4], [cx + mark * window, cy + 4], CROSSHAIR);
}
if (height >= 60) {
g.fillStyle = CROSSHAIR; g.textBaseline = "bottom";
if (v.stabilized && v.stab_label) { g.textAlign = "left"; g.fillText(v.stab_label, 10, height - 8); }
if (v.optics_label) { g.textAlign = "right"; g.fillText(v.optics_label, width - 10, height - 8); }
}
drawFrame(g, width, height);
}
@@ -1,4 +1,5 @@
// GENERATED by tools/gen_web_schema.py from src/ui/silhouettes.py; do not edit by hand.
export const PROFILES = {"aircraft":{"blocks":[[[0.28,0.61],[0.29,0.635],[0.33,0.635],[0.34,0.61]]],"hover":true,"hull":[[0.0,0.52],[0.05,0.57],[0.18,0.61],[0.45,0.61],[0.55,0.57],[0.95,0.565],[1.0,0.6],[1.0,0.55],[0.55,0.535],[0.42,0.5],[0.1,0.495]],"lines":[[[0.12,0.47],[0.42,0.47]],[[0.18,0.47],[0.18,0.5]],[[0.36,0.47],[0.36,0.5]]],"masthead":[0.3,0.47],"panels":[],"pitch_deg":2.0,"pitch_hz":0.23,"rotor":[0.31,0.64,0.48],"tail_rotor":[0.985,0.58,0.06],"wake":false,"windows":[[0.05,0.56],[0.085,0.56],[0.12,0.56]]},"merchant":{"blocks":[[[0.02,0.065],[0.02,0.078],[0.08,0.078],[0.09,0.06]],[[0.1,0.055],[0.1,0.105],[0.2,0.105],[0.2,0.055]],[[0.21,0.055],[0.21,0.115],[0.33,0.115],[0.33,0.055]],[[0.34,0.055],[0.34,0.11],[0.46,0.11],[0.46,0.055]],[[0.47,0.055],[0.47,0.12],[0.6,0.12],[0.6,0.055]],[[0.61,0.055],[0.61,0.105],[0.74,0.105],[0.74,0.055]],[[0.78,0.055],[0.78,0.17],[0.88,0.17],[0.89,0.055]],[[0.765,0.163],[0.765,0.17],[0.895,0.17],[0.895,0.163]],[[0.885,0.12],[0.89,0.19],[0.935,0.19],[0.94,0.12]],[[0.058,0.07],[0.059,0.14],[0.063,0.14],[0.064,0.07]]],"funnel_top":[0.91,0.19],"hull":[[0.0,0.07],[0.04,0.0],[0.97,0.0],[1.0,0.055],[0.3,0.055],[0.06,0.065]],"lines":[[[0.1,0.058],[0.1,0.103]],[[0.143,0.058],[0.143,0.103]],[[0.186,0.058],[0.186,0.103]],[[0.229,0.058],[0.229,0.103]],[[0.272,0.058],[0.272,0.103]],[[0.315,0.058],[0.315,0.103]],[[0.358,0.058],[0.358,0.103]],[[0.401,0.058],[0.401,0.103]],[[0.444,0.058],[0.444,0.103]],[[0.487,0.058],[0.487,0.103]],[[0.53,0.058],[0.53,0.103]],[[0.573,0.058],[0.573,0.103]],[[0.616,0.058],[0.616,0.103]],[[0.659,0.058],[0.659,0.103]],[[0.702,0.058],[0.702,0.103]]],"masthead":[0.061,0.142],"panels":[],"pitch_deg":0.5,"pitch_hz":0.07,"wake":true,"windows":[[0.79,0.155],[0.803,0.155],[0.816,0.155],[0.829,0.155],[0.842,0.155],[0.855,0.155],[0.868,0.155]]},"submarine":{"blocks":[[[0.215,0.05],[0.222,0.118],[0.236,0.132],[0.33,0.132],[0.335,0.05]]],"hull":[[0.0,0.0],[0.015625,0.027631],[0.03125,0.037692],[0.046875,0.044401],[0.0625,0.049153],[0.078125,0.05248],[0.09375,0.054644],[0.109375,0.05578],[0.125,0.056],[0.140625,0.056],[0.15625,0.056],[0.171875,0.056],[0.1875,0.056],[0.203125,0.056],[0.21875,0.056],[0.234375,0.056],[0.25,0.056],[0.265625,0.056],[0.28125,0.056],[0.296875,0.056],[0.3125,0.056],[0.328125,0.056],[0.34375,0.056],[0.359375,0.056],[0.375,0.056],[0.390625,0.056],[0.40625,0.056],[0.421875,0.056],[0.4375,0.056],[0.453125,0.056],[0.46875,0.056],[0.484375,0.056],[0.5,0.056],[0.515625,0.056],[0.53125,0.056],[0.546875,0.056],[0.5625,0.056],[0.578125,0.056],[0.59375,0.056],[0.609375,0.056],[0.625,0.056],[0.640625,0.056],[0.65625,0.056],[0.671875,0.056],[0.6875,0.055835],[0.703125,0.055108],[0.71875,0.054065],[0.734375,0.052784],[0.75,0.051302],[0.765625,0.049644],[0.78125,0.047827],[0.796875,0.045864],[0.8125,0.043765],[0.828125,0.041538],[0.84375,0.039191],[0.859375,0.036728],[0.875,0.034156],[0.890625,0.031479],[0.90625,0.0287],[0.921875,0.025824],[0.9375,0.022853],[0.953125,0.019791],[0.96875,0.01664],[0.984375,0.013402],[1.0,0.01008],[1.0,-0.01008],[0.984375,-0.013402],[0.96875,-0.01664],[0.953125,-0.019791],[0.9375,-0.022853],[0.921875,-0.025824],[0.90625,-0.0287],[0.890625,-0.031479],[0.875,-0.034156],[0.859375,-0.036728],[0.84375,-0.039191],[0.828125,-0.041538],[0.8125,-0.043765],[0.796875,-0.045864],[0.78125,-0.047827],[0.765625,-0.049644],[0.75,-0.051302],[0.734375,-0.052784],[0.71875,-0.054065],[0.703125,-0.055108],[0.6875,-0.055835],[0.671875,-0.056],[0.65625,-0.056],[0.640625,-0.056],[0.625,-0.056],[0.609375,-0.056],[0.59375,-0.056],[0.578125,-0.056],[0.5625,-0.056],[0.546875,-0.056],[0.53125,-0.056],[0.515625,-0.056],[0.5,-0.056],[0.484375,-0.056],[0.46875,-0.056],[0.453125,-0.056],[0.4375,-0.056],[0.421875,-0.056],[0.40625,-0.056],[0.390625,-0.056],[0.375,-0.056],[0.359375,-0.056],[0.34375,-0.056],[0.328125,-0.056],[0.3125,-0.056],[0.296875,-0.056],[0.28125,-0.056],[0.265625,-0.056],[0.25,-0.056],[0.234375,-0.056],[0.21875,-0.056],[0.203125,-0.056],[0.1875,-0.056],[0.171875,-0.056],[0.15625,-0.056],[0.140625,-0.056],[0.125,-0.056],[0.109375,-0.05578],[0.09375,-0.054644],[0.078125,-0.05248],[0.0625,-0.049153],[0.046875,-0.044401],[0.03125,-0.037692],[0.015625,-0.027631],[0.0,-0.0]],"lines":[[[0.205,0.1],[0.262,0.1]],[[0.92,0.012],[0.985,0.075]],[[0.92,-0.012],[0.985,-0.075]],[[0.27,0.132],[0.27,0.16]]],"panels":[],"pitch_deg":0.3,"pitch_hz":0.05,"propeller":[1.0,0.0,0.05],"wake":false,"windows":[]},"unknown":{"blocks":[[[0.18,0.083],[0.2,0.2],[0.38,0.2],[0.4,0.076]],[[0.295,0.2],[0.297,0.36],[0.303,0.36],[0.305,0.2]],[[0.4,0.074],[0.4,0.12],[0.55,0.12],[0.55,0.072]]],"hull":[[0.0,0.1],[0.06,0.0],[0.95,0.0],[1.0,0.07],[0.4,0.07],[0.1,0.085]],"lines":[[[0.83,0.07],[0.89,0.24]],[[0.95,0.07],[0.89,0.24]],[[0.26,0.3],[0.34,0.3]]],"masthead":[0.3,0.365],"panels":[],"pitch_deg":1.6,"pitch_hz":0.19,"wake":true,"windows":[[0.22,0.17],[0.25,0.17],[0.28,0.17],[0.31,0.17],[0.34,0.17]]},"warship":{"blocks":[[[0.1,0.046],[0.115,0.062],[0.155,0.062],[0.16,0.045]],[Line truncated
export const PROFILES = {"aircraft":{"blocks":[[[0.28,0.61],[0.29,0.635],[0.33,0.635],[0.34,0.61]]],"hover":true,"hull":[[0.0,0.52],[0.05,0.57],[0.18,0.61],[0.45,0.61],[0.55,0.57],[0.95,0.565],[1.0,0.6],[1.0,0.55],[0.55,0.535],[0.42,0.5],[0.1,0.495]],"lines":[[[0.12,0.47],[0.42,0.47]],[[0.18,0.47],[0.18,0.5]],[[0.36,0.47],[0.36,0.5]]],"masthead":[0.3,0.47],"nav":{"beacon":[[0.36,0.615],[0.3,0.49]],"mast":[],"side":[0.2,0.555],"stern":[0.995,0.585],"strobe":[0.975,0.6]},"panels":[],"pitch_deg":2.0,"pitch_hz":0.23,"rotor":[0.31,0.64,0.48],"tail_rotor":[0.985,0.58,0.06],"wake":false,"windows":[[0.05,0.56],[0.085,0.56],[0.12,0.56]]},"merchant":{"blocks":[[[0.02,0.065],[0.02,0.078],[0.08,0.078],[0.09,0.06]],[[0.1,0.055],[0.1,0.105],[0.2,0.105],[0.2,0.055]],[[0.21,0.055],[0.21,0.115],[0.33,0.115],[0.33,0.055]],[[0.34,0.055],[0.34,0.11],[0.46,0.11],[0.46,0.055]],[[0.47,0.055],[0.47,0.12],[0.6,0.12],[0.6,0.055]],[[0.61,0.055],[0.61,0.105],[0.74,0.105],[0.74,0.055]],[[0.78,0.055],[0.78,0.17],[0.88,0.17],[0.89,0.055]],[[0.765,0.163],[0.765,0.17],[0.895,0.17],[0.895,0.163]],[[0.885,0.12],[0.89,0.19],[0.935,0.19],[0.94,0.12]],[[0.058,0.07],[0.059,0.14],[0.063,0.14],[0.064,0.07]]],"funnel_top":[0.91,0.19],"hull":[[0.0,0.07],[0.04,0.0],[0.97,0.0],[1.0,0.055],[0.3,0.055],[0.06,0.065]],"lines":[[[0.1,0.058],[0.1,0.103]],[[0.143,0.058],[0.143,0.103]],[[0.186,0.058],[0.186,0.103]],[[0.229,0.058],[0.229,0.103]],[[0.272,0.058],[0.272,0.103]],[[0.315,0.058],[0.315,0.103]],[[0.358,0.058],[0.358,0.103]],[[0.401,0.058],[0.401,0.103]],[[0.444,0.058],[0.444,0.103]],[[0.487,0.058],[0.487,0.103]],[[0.53,0.058],[0.53,0.103]],[[0.573,0.058],[0.573,0.103]],[[0.616,0.058],[0.616,0.103]],[[0.659,0.058],[0.659,0.103]],[[0.702,0.058],[0.702,0.103]]],"masthead":[0.061,0.142],"nav":{"mast":[[0.061,0.15],[0.8,0.215]],"round":[0.84,0.25],"side":[0.77,0.166],"stern":[0.995,0.062]},"panels":[],"pitch_deg":0.5,"pitch_hz":0.07,"wake":true,"windows":[[0.79,0.155],[0.803,0.155],[0.816,0.155],[0.829,0.155],[0.842,0.155],[0.855,0.155],[0.868,0.155]]},"submarine":{"blocks":[[[0.215,0.05],[0.222,0.118],[0.236,0.132],[0.33,0.132],[0.335,0.05]]],"hull":[[0.0,0.0],[0.015625,0.027631],[0.03125,0.037692],[0.046875,0.044401],[0.0625,0.049153],[0.078125,0.05248],[0.09375,0.054644],[0.109375,0.05578],[0.125,0.056],[0.140625,0.056],[0.15625,0.056],[0.171875,0.056],[0.1875,0.056],[0.203125,0.056],[0.21875,0.056],[0.234375,0.056],[0.25,0.056],[0.265625,0.056],[0.28125,0.056],[0.296875,0.056],[0.3125,0.056],[0.328125,0.056],[0.34375,0.056],[0.359375,0.056],[0.375,0.056],[0.390625,0.056],[0.40625,0.056],[0.421875,0.056],[0.4375,0.056],[0.453125,0.056],[0.46875,0.056],[0.484375,0.056],[0.5,0.056],[0.515625,0.056],[0.53125,0.056],[0.546875,0.056],[0.5625,0.056],[0.578125,0.056],[0.59375,0.056],[0.609375,0.056],[0.625,0.056],[0.640625,0.056],[0.65625,0.056],[0.671875,0.056],[0.6875,0.055835],[0.703125,0.055108],[0.71875,0.054065],[0.734375,0.052784],[0.75,0.051302],[0.765625,0.049644],[0.78125,0.047827],[0.796875,0.045864],[0.8125,0.043765],[0.828125,0.041538],[0.84375,0.039191],[0.859375,0.036728],[0.875,0.034156],[0.890625,0.031479],[0.90625,0.0287],[0.921875,0.025824],[0.9375,0.022853],[0.953125,0.019791],[0.96875,0.01664],[0.984375,0.013402],[1.0,0.01008],[1.0,-0.01008],[0.984375,-0.013402],[0.96875,-0.01664],[0.953125,-0.019791],[0.9375,-0.022853],[0.921875,-0.025824],[0.90625,-0.0287],[0.890625,-0.031479],[0.875,-0.034156],[0.859375,-0.036728],[0.84375,-0.039191],[0.828125,-0.041538],[0.8125,-0.043765],[0.796875,-0.045864],[0.78125,-0.047827],[0.765625,-0.049644],[0.75,-0.051302],[0.734375,-0.052784],[0.71875,-0.054065],[0.703125,-0.055108],[0.6875,-0.055835],[0.671875,-0.056],[0.65625,-0.056],[0.640625,-0.056],[0.625,-0.056],[0.609375,-0.056],[0.59375,-0.056],[0.578125,-0.056],[0.5625,-0.056],[0.546875,-0.056],[0.53125,-0.056],[0.515625,-0.056],[0.5,-0.056],[0.484375,-0.056],[0.46875,-0.056],[0.453125,-0.056],[0.4375,-0.056],[0.421875,-0.056],[0.40625,-0.056],[0.390625,-0.056],[0.375,-0.056],[0.359375,-0.056],[0.34375,-0.056],[0.328125,-0.056],[0.3125,-0.056],[0.296875,-0.056],[0.28125,-0.056],[0.265625,-0.056],[0.25,-0.056],[0.234375,-0.056],[0.21875,-0.056],[0.203125,-0.056],[0.1875,-0.056],[0.171875,-0.056],[0.15625,-0.056],[0.140625,-0.056],[0.125,-0.056],[0.109375,-0.05578],[0.09375,-0.054644],[0.078125,-0.05248],[0.0625,-0.049153],[0.046875,-0.044401],[0.03125,-0.037692],[0.015625,-0.027631],[0.0,-0.0]],"lines":[[[0.205,0.1],[0.262,0.1]],[[0.92,0.012],[0.985,0.075]],[[0.92,-0.012],[0.985,-0.075]],[[0.27,0.132],[0.27,0.16]]],"panels":[],"pitch_deg":0.3,"pitch_hz":0.05,"propeller":[1.0,0.0,0.05],"wake":false,"windows":[]},"unknown":{"blocks":[[[0.18,0.083],[0.2,0.2],[0.38,0.2],[0.4,0.076]],[[0.295,0.2],[0.297,0.36],[0.303,0.36],[0.305,0.2]],[[0.4,0.074],[0.4,0.12],[0.55,0.12],[0.55,0.072]]],"hull":[[0.0,0.1],[0.06,0.0],[0.95,0.0],[1.0,0.07],[0.4,0.07],[0.1,0.085]],"lines":[[[0.83,0.07],[0.89,0.24]],[[0.95,0.07],[0.89,0.24]],[[0.26,0.3],[0.34,0.3]]],"masthead"Line truncated
export const DETAIL_MIN_PX = 40;
export const FOAM = [215, 225, 225];
export const NAV_LIGHT = {green: [96, 255, 150], red: [255, 74, 58], white: [255, 246, 222]};
+19 -2
View File
@@ -921,6 +921,14 @@
"commander.web.glasses_train": "Fernglas schwenken",
"commander.web.glasses_bow": "Bug",
"commander.web.glasses_bearing": "Sichtlinie {bearing}° (zum Bug {relative}°)",
"commander.web.optics_group": "Optik: neigen, zoomen, stabilisieren",
"commander.web.optics_up": "▲ Nach oben",
"commander.web.optics_down": "▼ Nach unten",
"commander.web.optics_zoom_out": "Zoom −",
"commander.web.optics_zoom_in": "Zoom +",
"commander.web.optics_stabilizer": "Stabilisierung",
"commander.web.optics_status": "Neigung {elevation}° · Feld {fov}°",
"commander.web.sight_stabilized": "STAB",
"commander.web.uboot_scope_turn_left_fast": "◀◀ 10°",
"commander.web.uboot_scope_turn_left": "◀ 2°",
"commander.web.uboot_scope_turn_right": "2° ▶",
@@ -4340,6 +4348,7 @@
"help.uboot.snorkel": "Schnorchel aus-/einfahren, Diesel laden auf Schnorcheltiefe (Maschine)",
"help.uboot.mast": "Mast aus-/einfahren auf Sehrohrtiefe: ESM hört Radare, das Sehrohr sieht, die Funkantenne ist klar (Führung, Mast & ESM, Funkraum)",
"help.uboot.scope_turn": "Sehrohrseite: Rohr 2° schwenken (Umschalt: 10°) (Führung, Mast & ESM)",
"help.uboot.scope_optics": "Sehrohrseite: ↑/↓ Kopf 2° neigen (Umschalt: 10°), , / . kleine/große Vergrößerung (32°, 8° Feld), Leertaste Stabilisierung",
"help.uboot.stadimeter": "Sehrohrseite: Stadimeter-Entfernung der Sichtung unter dem Fadenkreuz (Führung, Mast & ESM)",
"help.uboot.telegraph": "Fahrtstufe schneller / langsamer (Führung, Maschine)",
"help.uboot.sonar": "Wie am Fregattensonar, ohne Schleppantenne, OPZ-Freigabe, Plot und Telegraph",
@@ -4445,14 +4454,22 @@
"runtime.tma.ekelund_copied": "Ekelund-Entfernung in die Hypothese übernommen",
"runtime.tma.ekelund_none": "Noch keine Ekelund-Entfernung (zwei Schläge nötig)",
"panel.lookout_glasses": "FERNGLAS",
"bridge.line.glasses_bearing": "Sichtlinie {bearing}° (zum Bug {relative}°)",
"bridge.line.glasses_hint": ", / . schwenken (Umschalt: 20°) · Klick ins Rundumbild · B schließt",
"bridge.line.glasses_bearing": "Sichtlinie {bearing}° (zum Bug {relative}°) · Neigung {elevation}° · Feld {fov}°",
"bridge.line.glasses_hint": ", / . schwenken · ↑/↓ neigen · Q/E Zoom · Leertaste Stabilisierung · B schließt",
"runtime.lookout.glasses_on": "Fernglas vor den Augen",
"runtime.optics.elevation": "Optik geneigt {elevation}°",
"runtime.optics.zoom": "Sichtfeld {fov}° (Zoom ×{power})",
"runtime.optics.stabilizer_on": "Stabilisierung an: der Horizont steht still",
"runtime.optics.stabilizer_off": "Stabilisierung aus",
"sight.stabilized": "STAB",
"sight.optics": "Neigung {elevation}° · Feld {fov}°",
"runtime.lookout.glasses_off": "Fernglas abgesetzt",
"bridge.footer.glasses": "FERNGLAS",
"bridge.footer.glasses_close": "KARTE",
"bridge.footer.glasses_train": "SCHWENKEN",
"bridge.footer.glasses_tilt": "NEIGEN",
"help.bridge.lookout_glasses": "Ausguck-Seite: Fernglas über der Karte ein/aus (, / . schwenken)",
"help.bridge.glasses_optics": "Fernglas oben: ↑/↓ neigen 2° (Umschalt: 10°) statt Maschinentelegraf, Q/E Zoom (16°, 8°, 4° Feld), Leertaste Stabilisierung",
"bridge.line.glasses_row": "{bearing}° {what} {range} sm",
"bridge.line.glasses_unknown": "nicht erkannt",
"weather.line.temperature_boat": "Luft {air} °C Wasser {sea} °C",
+19 -2
View File
@@ -921,6 +921,14 @@
"commander.web.glasses_train": "Train the binoculars",
"commander.web.glasses_bow": "Bow",
"commander.web.glasses_bearing": "Line of sight {bearing}° (off the bow {relative}°)",
"commander.web.optics_group": "Optics: tilt, zoom, stabilizer",
"commander.web.optics_up": "▲ Tilt up",
"commander.web.optics_down": "▼ Tilt down",
"commander.web.optics_zoom_out": "Zoom −",
"commander.web.optics_zoom_in": "Zoom +",
"commander.web.optics_stabilizer": "Stabilizer",
"commander.web.optics_status": "Tilt {elevation}° · field {fov}°",
"commander.web.sight_stabilized": "STAB",
"commander.web.uboot_scope_turn_left_fast": "◀◀ 10°",
"commander.web.uboot_scope_turn_left": "◀ 2°",
"commander.web.uboot_scope_turn_right": "2° ▶",
@@ -4340,6 +4348,7 @@
"help.uboot.snorkel": "Snorkel up/down, diesels charge at snorkel depth (Engine room)",
"help.uboot.mast": "Raise/lower mast at periscope depth: ESM hears radars, the periscope sees, the radio antenna is up (Command, Mast & ESM, Radio room)",
"help.uboot.scope_turn": "Periscope page: train the scope 2° (Shift: 10°) (Command, Mast & ESM)",
"help.uboot.scope_optics": "Periscope page: ↑/↓ tilt the head 2° (Shift: 10°), , / . low/high power (32°, 8° field), Space stabilizer",
"help.uboot.stadimeter": "Periscope page: stadimeter range of the sighting under the crosshair (Command, Mast & ESM)",
"help.uboot.telegraph": "Telegraph step faster / slower (Command, Engine room)",
"help.uboot.sonar": "As on the frigate sonar, without towed array, OPZ release, plot and telegraph",
@@ -4445,14 +4454,22 @@
"runtime.tma.ekelund_copied": "Ekelund range copied into the hypothesis",
"runtime.tma.ekelund_none": "No Ekelund range yet (two legs needed)",
"panel.lookout_glasses": "BINOCULARS",
"bridge.line.glasses_bearing": "Line of sight {bearing}° (off the bow {relative}°)",
"bridge.line.glasses_hint": ", / . train (Shift: 20°) · click the panorama · B closes",
"bridge.line.glasses_bearing": "Line of sight {bearing}° (off the bow {relative}°) · tilt {elevation}° · field {fov}°",
"bridge.line.glasses_hint": ", / . train · ↑/↓ tilt · Q/E zoom · Space stabilizer · B closes",
"runtime.lookout.glasses_on": "Binoculars up",
"runtime.optics.elevation": "Optics tilted {elevation}°",
"runtime.optics.zoom": "Field of view {fov}° (zoom ×{power})",
"runtime.optics.stabilizer_on": "Stabilizer on: the horizon holds still",
"runtime.optics.stabilizer_off": "Stabilizer off",
"sight.stabilized": "STAB",
"sight.optics": "Tilt {elevation}° · field {fov}°",
"runtime.lookout.glasses_off": "Binoculars down",
"bridge.footer.glasses": "GLASSES",
"bridge.footer.glasses_close": "CHART",
"bridge.footer.glasses_train": "TRAIN",
"bridge.footer.glasses_tilt": "TILT",
"help.bridge.lookout_glasses": "Lookout page: binoculars over the chart on/off (, / . train them)",
"help.bridge.glasses_optics": "Binoculars up: ↑/↓ tilt 2° (Shift: 10°) instead of the telegraph, Q/E zoom (16°, 8°, 4° field), Space stabilizer",
"bridge.line.glasses_row": "{bearing}° {what} {range} NM",
"bridge.line.glasses_unknown": "unidentified",
"weather.line.temperature_boat": "Air {air} °C Sea {sea} °C",
+2 -2
View File
@@ -32,7 +32,7 @@ Die obere Leiste zeigt Station, Mission, Uhrzeit, Fahrt und Kurs; der Kartenkopf
## Ausguck-Meldungen {#bridge-lookout}
Der Brückenausguck (Augenhöhe 18 m, Fernglas 7x50) meldet seine Sichtungen im Ereignis-Feed als `AUSG`-Zeilen, zum Beispiel `Brücke/Ausguck: Fregatte (Admiral-Gorshkov-Fregatte) in 040°, 3.8 sm`. Die Remote-Crew-Brücke zeigt dieselben Meldungen unter „Ausguck-Meldungen“. Brückenseite 3 (Ausguck-Sichtfeld) zeigt die Sichtungen nordorientiert um das eigene Schiff mit der vom Ausguck gemessenen Peilung und Entfernung, nach Art eingefärbt (Oberwasser, U-Boot, Luftfahrzeug, Torpedo) und mit dem Erkannten beschriftet, daneben Sicht, Seegang, Tag/Nacht und die letzten Meldungen; `,` und `.` ändern den Radius (2 bis 30 sm). Über den Meldungen zeigt ein Horizontstreifen das Fernglas voraus (90° Sichtfeld, Skala rechtweisender Peilungen, mit der See bewegter Horizont, Licht der Stunde) mit den Umrissen der Ausguck-Sichtungen in gemessener Peilung und Entfernung; es ist derselbe Renderer wie das Sehrohr des U-Boots. Das Bild hat den Stil des Startbilds: tagsüber blauer Himmel, in der Dämmerung ein warmer Horizont, nachts Sterne und der Mond in seiner Phase in seiner Peilung mit seinem Glitzern auf dem Wasser; Wolken, Regen, Schnee und Nebel folgen der Wetterstation, und die Umrisse erscheinen in Stahl mit heller Kante, nachts mit beleuchteten Fenstern. Die Remote-Crew-Brücke zeigt dasselbe Fernglas als Karte („Fernglas des Ausgucks“), geschwenkt nur in diesem Browser mit den Pfeiltasten (2°, 10°) und „Bug“. `B` nimmt das Fernglas groß über die Karte: ein 16°-Sichtfeld, das mit `,` und `.` (`Umschalt`: 20°-Schritte) oder per Klick in das Rundumbild darunter geschwenkt wird; das Rundumbild markiert jede Sichtung in ihrer gemessenen Peilung, der Bug liegt in der Mitte. Darunter stehen die Sichtungen, die der Sichtlinie nächste zuerst. Die kartierte Küste steht im Horizontstreifen und im Fernglas auf dem Horizont, so weit der Ausguck Land sieht (höchstens 20 sm, im Dunst verblassend), und das Rundumbild markiert sie an seinem Fuß; die Karte kennt keine Höhen, die Hügel sind mit 25 bis 70 m angenommen. `B` erneut führt zur Karte zurück; das Fernglas ist reine Anzeige und wird nicht gespeichert. Ein Kontakt wird beim Näherkommen in bis zu drei Stufen gemeldet, jede Stufe einmal:
Der Brückenausguck (Augenhöhe 18 m, Fernglas 7x50) meldet seine Sichtungen im Ereignis-Feed als `AUSG`-Zeilen, zum Beispiel `Brücke/Ausguck: Fregatte (Admiral-Gorshkov-Fregatte) in 040°, 3.8 sm`. Die Remote-Crew-Brücke zeigt dieselben Meldungen unter „Ausguck-Meldungen“. Brückenseite 3 (Ausguck-Sichtfeld) zeigt die Sichtungen nordorientiert um das eigene Schiff mit der vom Ausguck gemessenen Peilung und Entfernung, nach Art eingefärbt (Oberwasser, U-Boot, Luftfahrzeug, Torpedo) und mit dem Erkannten beschriftet, daneben Sicht, Seegang, Tag/Nacht und die letzten Meldungen; `,` und `.` ändern den Radius (2 bis 30 sm). Über den Meldungen zeigt ein Horizontstreifen das Fernglas voraus (90° Sichtfeld, Skala rechtweisender Peilungen, mit der See bewegter Horizont, Licht der Stunde) mit den Umrissen der Ausguck-Sichtungen in gemessener Peilung und Entfernung; es ist derselbe Renderer wie das Sehrohr des U-Boots. Das Bild hat den Stil des Startbilds: tagsüber blauer Himmel, in der Dämmerung ein warmer Horizont, nachts Sterne und der Mond in seiner Phase in seiner Peilung mit seinem Glitzern auf dem Wasser; Wolken, Regen, Schnee und Nebel folgen der Wetterstation, und die Umrisse erscheinen in Stahl mit heller Kante, nachts mit beleuchteten Fenstern. Von der Dämmerung bis zum Morgen und bei Sicht unter 2 sm führen neutrale Handels- und Fischereifahrzeuge ihre Positionslichter (Kriegsschiffe fahren abgeblendet): weiße Topplichter über die vorderen 225° (ab 50 m Länge zwei, das hintere höher, 6 sm), das grüne Steuerbord- oder rote Backbord-Seitenlicht (3 sm), beide, wenn das Schiff genau auf einen zuhält, und das weiße Hecklicht über die 135° achteraus (3 sm; unter 50 m Länge ein Topplicht mit 5 sm und die übrigen mit 2 sm), nie weiter als die Sicht. Fahrzeuge bei der Arbeit führen dazu ihre Rundumlichter: ein Trawler Grün über Weiß (ein Topplicht erst ab 50 m), ein Lotsenfahrzeug Weiß über Rot statt der Topplichter, ein Vermessungsschiff, Kabelleger oder Forschungsschiff als manövrierbehindertes Fahrzeug Rot, Weiß, Rot und ein Minenräumer drei grüne; ein Schlepper ohne Schleppzug zeigt gewöhnliche Lichter. Zivile Flugzeuge zeigen das rote linke und grüne rechte Flügelspitzenlicht und das weiße Hecklicht (3 sm) sowie ihre blitzenden roten Kollisionswarnlichter und weißen Blitzlichter (10 sm); Militärflugzeuge fliegen abgeblendet; die Silhouette zeigt dann mit dem Bug dorthin, wohin die Lichter weisen, und ein beleuchtetes Schiff wird an seinen Lichtern gesichtet, auch wo der dunkle Rumpf es nicht wird (die Klasse braucht weiter die Silhouette). Die Remote-Crew-Brücke zeigt dasselbe Fernglas als Karte („Fernglas des Ausgucks“), geschwenkt nur in diesem Browser mit den Pfeiltasten (2°, 10°) und „Bug“. `B` nimmt das Fernglas groß über die Karte: ein 16°-Sichtfeld, das mit `,` und `.` (`Umschalt`: 20°-Schritte) oder per Klick in das Rundumbild darunter geschwenkt wird; das Rundumbild markiert jede Sichtung in ihrer gemessenen Peilung, der Bug liegt in der Mitte. Darunter stehen die Sichtungen, die der Sichtlinie nächste zuerst. Die kartierte Küste steht im Horizontstreifen und im Fernglas auf dem Horizont, so weit der Ausguck Land sieht (höchstens 20 sm, im Dunst verblassend), und das Rundumbild markiert sie an seinem Fuß; die Karte kennt keine Höhen, die Hügel sind mit 25 bis 70 m angenommen. Solange das Fernglas oben ist, neigen `↑`/`↓` es um 2° (`Umschalt`: 10°, von 20° nach unten bis 45° nach oben) statt den Maschinentelegrafen zu bedienen, `Q`/`E` zoomen (16°, 8° oder 4° Feld) und die `Leertaste` schaltet die Stabilisierung, die alle bis auf ein Achtel der Schiffsbewegung herausnimmt; die Zeile unter dem Bild zeigt Neigung und Feld, und die Remote-Crew-Karte hat dieselben Knöpfe für ihren eigenen Browser. Die See folgt dem Wind: gegen die See laufen die Kämme in langen Reihen auf einen zu, mit der See laufen ihre Rücken davon, quer dazu ziehen kurze Kämme seitlich durchs Bild, und das Schiff stampft in Gegen- oder Mitlaufsee und rollt in Dwarssee. `B` erneut führt zur Karte zurück; das Fernglas ist reine Anzeige und wird nicht gespeichert. Ein Kontakt wird beim Näherkommen in bis zu drei Stufen gemeldet, jede Stufe einmal:
- **Gesichtet:** nur die Art des Objekts ist klar (Fahrzeug, Luftfahrzeug, kleines Objekt an der Wasseroberfläche).
- **Klasse:** die Silhouette zeigt die Klasse, zum Beispiel Handelsschiff, Kriegsschiff, Flugzeugträger, Fischereifahrzeug, Speedboot, aufgetauchtes U-Boot, Verkehrsflugzeug oder Militärflugzeug.
@@ -72,4 +72,4 @@ Gefechtslage:
- Keine Zeitraffung, keine Pause und keine Autopilot-Wegpunkte für die Fregatte.
- Keine automatische Torpedoerkennung: der Alarm beruht nur auf gehörten Intercepts oder der Klassifizierung des Sonarbedieners; ein außerhalb der Suchkopfreichweite leise laufender Torpedo kann unangekündigt eintreffen. Der Ausguck meldet nur eine sichtbare Laufbahn.
- Der Ausguck liest weder Schiffsnamen noch Flagge und meldet keine Lichter oder Signalkörper.
- Der Ausguck liest weder Schiffsnamen noch Flagge und meldet keine Lichter oder Signalkörper; die Lichter werden nur gezeichnet. Kein Schiff im Spiel ankert, schleppt, fischt mit Schleppfahrt oder ist manövrierunfähig, daher erscheinen Ankerlicht, Schlepplichter und die Lichter eines manövrierunfähigen Fahrzeugs nie.
+2 -2
View File
@@ -32,7 +32,7 @@ The top bar shows the station, the mission, the clock, speed and course; the cha
## Bridge lookout reports {#bridge-lookout}
The bridge lookout (eye height 18 m, 7x50 binoculars) reports sightings in the event feed as `AUSG` lines, for example `Bridge lookout: frigate (Admiral-Gorshkov-Fregatte) bearing 040°, 3.8 NM`. The Remote Crew bridge lists the same reports under "Lookout reports". Bridge page 3 (the lookout scope) shows the sightings north up around the own ship at the range and bearing the lookout measured, coloured by kind (surface, submarine, aircraft, torpedo) and labelled with what he made out, next to visibility, sea state, day/night and the latest reports; `,` and `.` change the scope radius (2 to 30 NM). Above the reports a horizon strip shows the binoculars toward the bow (90° field, true-bearing scale, the horizon moving with the sea, the light of the hour) with the outlines of the lookout's sightings at their measured bearing and range; it is the same renderer as the submarine's periscope. The picture has the start screen's look: by day a blue sky, at dusk a warm horizon, at night stars and the moon in its phase at its bearing with its glitter on the water; clouds, rain, snow and fog follow the weather station, and the silhouettes are drawn in steel with a lit rim, with lit windows at night. The Remote Crew bridge shows the same binoculars as a card ("Lookout binoculars"), trained in that browser only with the arrow buttons (2°, 10°) and "Bow". `B` raises the binoculars large over the chart: a 16° field the operator trains with `,` and `.` (`Shift`: 20° steps) or by clicking the all-round panorama below it, which marks every sighting at its measured bearing with the bow in the middle; the sightings are listed underneath, nearest the line of sight first. The charted coast stands on the horizon of the strip and the binoculars as far as the lookout can see land (at most 20 NM, fading into the haze), and the panorama marks it along its foot; the chart has no elevation, so the hills are an assumed 25 to 70 m. `B` again returns to the chart; the binoculars are display only and are not saved. A contact is reported in up to three steps as it closes, each step once:
The bridge lookout (eye height 18 m, 7x50 binoculars) reports sightings in the event feed as `AUSG` lines, for example `Bridge lookout: frigate (Admiral-Gorshkov-Fregatte) bearing 040°, 3.8 NM`. The Remote Crew bridge lists the same reports under "Lookout reports". Bridge page 3 (the lookout scope) shows the sightings north up around the own ship at the range and bearing the lookout measured, coloured by kind (surface, submarine, aircraft, torpedo) and labelled with what he made out, next to visibility, sea state, day/night and the latest reports; `,` and `.` change the scope radius (2 to 30 NM). Above the reports a horizon strip shows the binoculars toward the bow (90° field, true-bearing scale, the horizon moving with the sea, the light of the hour) with the outlines of the lookout's sightings at their measured bearing and range; it is the same renderer as the submarine's periscope. The picture has the start screen's look: by day a blue sky, at dusk a warm horizon, at night stars and the moon in its phase at its bearing with its glitter on the water; clouds, rain, snow and fog follow the weather station, and the silhouettes are drawn in steel with a lit rim, with lit windows at night. From dusk to dawn and in visibility under 2 NM neutral merchant ships and fishing vessels run their navigation lights (warships run darkened): white masthead lights over the forward 225° (two from 50 m length, the aft one higher, 6 NM), the green starboard or red port side light (3 NM), both when she heads straight at you, and the white stern light over the 135° astern (3 NM; under 50 m length one masthead light at 5 NM and the others at 2 NM), never beyond the visibility. Vessels at work add their all-round lights: a trawler green over white (a masthead light only from 50 m), a pilot vessel white over red instead of masthead lights, a survey ship, cable layer or research ship restricted in her ability to manoeuvre red, white, red, and a mine clearance vessel three green; a tug without a tow shows ordinary lights. Civil aircraft show the red left and green right wingtip light and the white tail light (3 NM) and their flashing red anti-collision beacons and white strobes (10 NM); military aircraft fly dark; the silhouette then points its bow the way the lights show, and a lit ship is sighted by its lights even where the dark hull is not (its class still needs the silhouette). The Remote Crew bridge shows the same binoculars as a card ("Lookout binoculars"), trained in that browser only with the arrow buttons (2°, 10°) and "Bow". `B` raises the binoculars large over the chart: a 16° field the operator trains with `,` and `.` (`Shift`: 20° steps) or by clicking the all-round panorama below it, which marks every sighting at its measured bearing with the bow in the middle; the sightings are listed underneath, nearest the line of sight first. The charted coast stands on the horizon of the strip and the binoculars as far as the lookout can see land (at most 20 NM, fading into the haze), and the panorama marks it along its foot; the chart has no elevation, so the hills are an assumed 25 to 70 m. While the binoculars are up, `↑`/`↓` tilt them 2° (`Shift`: 10°, from 20° down to 45° up) instead of working the telegraph, `Q`/`E` zoom them (16°, 8° or 4° field) and `Space` switches the stabilizer, which takes out all but an eighth of the ship's motion; the line under the picture shows tilt and field, and the Remote Crew card has the same buttons for its own browser. The sea follows the wind: looking into it the crests come at you in long rows, looking down-sea their backs run away, across it short crests run sideways, and the ship pitches in a head or following sea and rolls in a beam sea. `B` again returns to the chart; the binoculars are display only and are not saved. A contact is reported in up to three steps as it closes, each step once:
- **Sighted:** only the kind of object is clear (vessel, aircraft, small object on the surface).
- **Class:** the silhouette shows the class, for example merchant ship, warship, aircraft carrier, fishing vessel, speedboat, surfaced submarine, airliner or military aircraft.
@@ -72,4 +72,4 @@ Combat situation:
- No time acceleration, no pause and no autopilot waypoints for the frigate.
- No automatic torpedo identification: the alarm rests only on heard intercepts or the sonar operator's classification; a torpedo running silent outside seeker range can arrive unannounced. The lookout calls out only a visible wake.
- The lookout never reads a ship's name or flag and does not report navigation lights or day shapes.
- The lookout never reads a ship's name or flag and does not report navigation lights or day shapes; the lights are only drawn. No ship in the game anchors, tows, trawls at trawling speed or is not under command, so anchor lights, towing lights and the not-under-command lights never show.
+1 -1
View File
@@ -113,7 +113,7 @@ Eine zweite Crew kann den Gegner spielen. Das U-Boot hat sieben Stationen: Führ
- **Unter der Testtiefe:** die Crew darf das besetzte U-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 U-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 U-Boot ist verloren. Die U-Boote der KI halten ihre Testtiefe.
- **Atmosphäre:** das U-Boot hat eigene Geräusche, am uConsole, wenn er das U-Boot spielt, und in den Browsern des U-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 U-Boot, weiter weg als dumpfes, fernes Grollen, und das Log meldet sie mit der Peilung, die die Ohren der Crew liefern (einige Grad daneben). Das Ping eines Jägers (Rumpfsonar, Tauchsonar oder aktive Boje) klingt am Rumpf an. Mit Stereoton kommen beide aus dieser Peilung, links für Backbord und rechts für Steuerbord vom Bug des U-Boots aus. Bei **Schleichfahrt** schaltet das U-Boot auf Rotlicht: die Boot-Bildschirme am uConsole und die Führungsstationen des U-Boots im Browser werden gedimmt rot, bis die Schleichfahrt endet.
- **Besatzung:** das U-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 U-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 U-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 im Stil des Startbilds: Himmel und See im Licht der Stunde (Tag, Dämmerung, Nacht mit Sternen und Mond), Wolken, Regen, Schnee und Nebel nach dem Wetter, 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 U-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.
- **Lagebild:** ein gehörter Aktivping oder Torpedo wird mit der Peilung protokolliert, die das U-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 U-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 im Stil des Startbilds: Himmel und See im Licht der Stunde (Tag, Dämmerung, Nacht mit Sternen und Mond), Wolken, Regen, Schnee und Nebel nach dem Wetter, 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. Neutrale Schiffe zeigen hier ihre Positionslichter wie im Fernglas der Brücke. `↑`/`↓` neigen den Kopf um 2° (`Umschalt`: 10°, von 10° nach unten bis 60° nach oben, für Flugzeuge), `,`/`.` wechseln zwischen kleiner (32° Feld) und großer Vergrößerung (8°), und die `Leertaste` schaltet die Stabilisierung; Neigung und Feld stehen in der Bildecke. Diese Einstellungen gehören zum Okular der uConsole oder jedes Browsers, ändern nur das Bild (nicht, was die Optik erkennt) und werden nicht gespeichert. `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 U-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 U-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, bis zu 16, die bestpassenden zuerst: jeder Eintrag zeigt seine Passung (**passt gut**, **mittel** oder **schwach**: Frequenz und PRF nahe der Mitte der Bereiche und dieselbe Modulation passen am besten), Einträge gleicher Stufe stehen nach Katalogschlüssel, und die Liste ordnet sich nur um, wenn sich eine Stufe ändert; 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 U-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 **Umlaufzeit** ist die Zeit zwischen den Treffern der Hauptkeule eines Emitters (den Pegelspitzen; nah dran sind dazwischen die schwächeren Nebenkeulen zu hören und zählen nicht), gemessen nur an der eigenen Signalform des Emitters, über Lücken bis 12 s ohne überspülten Durchlauf dazwischen, und angezeigt nach 8 s: **dreht** mit ihrer Dauer (etwa 2,5 s für ein Navigations- oder Seeraumradar, 5 s für ein Luftraumradar, 2 s für ein Mehrzweckradar) ist ein Suchradar, das vorbeistreicht; **dauernd** (die Keule bei jedem Durchlauf auf dem Mast) ist ein Verfolgungs- oder Feuerleitradar. Ein dauernd beleuchtender, erfasster Emitter ist immer eine Mastwarnung, und das Log meldet einmal, wenn ein Emitter auf Dauerbeleuchtung wechselt. 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 U-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.
- **Funkraum:** die Flottenführung sendet alle 10 Minuten einen U-Boot-Rundspruch (Rundspruch 0 bei Missionsbeginn, dann 1, 2 …) und wiederholt ihn bis zum nächsten. Das U-Boot nimmt ihn nur mit klarer Antenne auf, das heißt mit ausgefahrenem Mast auf Sehrohrtiefe, und erst nach 20 s ununterbrochenem Empfang innerhalb der Sendezeit dieses Rundspruchs; ein U-Boot, das tief bleibt, verpasst Rundsprüche und bekommt nur den jeweils neuesten. In 60 % der Fälle enthält ein Rundspruch die **Feindlagemeldung** der Führung zur Fregatte: einen 5 bis 15 Minuten alten Standort mit 4 sm Fehlerkreis und gerundetem Kurs und Fahrt. Die Karte zeigt ihn als gelben Kreis mit seinem Alter, und die Funkseite nennt Peilung und Entfernung vom U-Boot. Eine **Lagemeldung** (`Enter` im Funkraum oder der Knopf im Browser) sind 20 s Kurzwellensendung mit klarer Antenne. Währenddessen kann der KW-Peiler der Fregatte das U-Boot peilen (Funkraum HF/DF), und Mast einfahren bricht sie ab. Die Führung bestätigt eine Meldung im nächsten Rundspruch und fügt dann immer eine schärfere Feindlagemeldung (2 sm) bei. Die Funkseite und die Karte Funkraum im Browser zeigen Antenne, Rundspruchnummer und Zeit bis zum nächsten, Fortschritt von Aufnahme und Sendung, gesendete Meldungen, die letzte Feindlage und das Funktagebuch (12 Einträge, wird gespeichert).
- **Gegenortung und Ausweichen:** der Sonarraum des U-Boots unterscheidet einen aufgefangenen Aktivping an seiner Frequenz als Rumpfsonar der Fregatte, Tauchsonar eines Hubschraubers oder Sonoboje und protokolliert ihn mit gemessener Peilung und Empfangspegel (dB re 1 µPa, aus Quellpegel, Ausbreitung und Absorption); eine pingende Boje im Umkreis von 12 sm hört nur ein bemanntes U-Boot. Eine Boje, die im Umkreis von 4 sm ins Wasser fällt, wird mit grober Peilung (±6°) gehört, ein Torpedoalarm bleibt mit seiner Peilung stehen. Die Seite **Bedrohung** (Führung Seite 4 und Navigation Seite 2; im Browser die Karte Bedrohung an Führung und Navigation) zählt die Pings der letzten 5 Minuten nach Quelle, nennt den lautesten Pegel mit Bewertung (ab 150 dB hat der Pinger wahrscheinlich ein Echo) und den Trend der letzten beiden Pings (steigend: er kommt näher), Splashes, Torpedoalarme und ESM-Emitter, die eigene Signatur (Tiefe gegen die gemessene Schicht, Eigenlärm: kavitierend, schnorchelnd, laut, mäßig oder leise, der Mast) und die Empfehlungen der Crew. Die Karte zeichnet jede Auffassung der letzten 2 Minuten als gestrichelten Peilstrahl. **Ausweichen** (`I` an Führung oder Navigation, im Browser die Schaltfläche **Ausweichen**) gibt den Ausweichbefehl der Crew zum frischesten Alarm (unter 2 Minuten): gegen einen Torpedo die kleinere Wende, die ihn 150° achteraus legt, Höchstfahrt und ein Täuschkörper; gegen Aktivsonar das Heck zum Pinger, Schleichfahrt mit 3 kn. Beide wechseln durch die gemessene Schicht (nach unten, wenn das U-Boot darüber oder darin steht, nach oben, wenn es darunter steht), ohne BT gehen sie auf Tiefe; ein aufgesetztes U-Boot hebt zuerst ab. Der Befehl durchläuft dieselben Prüfungen wie die Einzeltasten, und die Seite zeigt ihn, bevor er gegeben wird. Das Bild ist nur Anzeige und wird nicht gespeichert.
+1 -1
View File
@@ -113,7 +113,7 @@ A second crew can play the enemy. The submarine has seven stations: Command, Son
- **Below test depth:** the crew may order the crewed submarine 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 submarine 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 submarine is lost. The AI's submarines keep to their test depth.
- **Atmosphere:** the submarine has its own sounds, on the uConsole when it plays the submarine and in the submarine'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). A hunter's ping (hull sonar, dipping sonar or active buoy) rings on the hull. With stereo sound both come from that bearing, left for port and right for starboard of the submarine's head. In **silent running** the submarine rigs for red: the uConsole's submarine screens and the browser's submarine command stations turn to dimmed red light until silent running ends.
- **Crew:** the submarine 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 submarine'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 submarine with bearing (log and ESM list), and the mast lowers by itself when the submarine 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 in the start screen's look: sky and sea in the light of the hour (day, dusk, night with stars and the moon), clouds, rain, snow and fog from the weather, 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 submarine'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.
- **Situation picture:** an intercepted active ping or torpedo is logged with the bearing the submarine'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 submarine with bearing (log and ESM list), and the mast lowers by itself when the submarine 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 in the start screen's look: sky and sea in the light of the hour (day, dusk, night with stars and the moon), clouds, rain, snow and fog from the weather, 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. Neutral ships show their navigation lights here as on the bridge's binoculars. `↑`/`↓` tilt the head 2° (`Shift`: 10°, from 10° down to 60° up, for aircraft), `,`/`.` switch between low power (32° field) and high power (8°), and `Space` switches the stabilizer; tilt and field stand in the corner of the picture. These settings belong to the eyepiece of the uConsole or of each browser, change only the picture (not what the optics detect) and are not saved. `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 submarine'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 submarine'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, up to 16, best fit first: each entry shows its fit (**good**, **fair** or **poor**: frequency and PRF near the middle of its ranges and the same modulation fit best), entries of one grade stand by catalogue key, and the list only reorders when a grade changes; 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 submarine's own position (20 minutes); the chart shows the latest bearing lines, and once the submarine'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 **scan period** is the time between an emitter's main-beam hits (the level peaks; close in, the weaker side lobes are heard in between and do not count), measured only on the emitter's own waveform, over gaps up to 12 s with no washed scan between them, and read after 8 s: **rotating** with its period (about 2.5 s for a navigation or surface-search radar, 5 s for an air-search radar, 2 s for a multi-function radar) is a search radar sweeping past; **steady** (the beam on the mast at every scan) is a tracking or fire-control radar. A steady, live emitter is always a mast warning, and the log reports once when an emitter turns steady. 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 submarine's plot. On the uConsole's Mast & ESM page `↑`/`↓` select an emitter, `←`/`→` step through its library classification and `Enter` transfers it to the plot.
- **Radio room:** fleet headquarters sends a submarine broadcast every 10 minutes (broadcast 0 at mission start, then 1, 2 …) and repeats it until the next one. The submarine copies it only with its antenna up, which is the raised mast at periscope depth, and only after 20 s of unbroken reception inside that broadcast's time on the air; a submarine that stays deep misses broadcasts and only ever gets the latest. A broadcast carries HQ's **contact report** on the frigate in 60 % of cases: a position 5 to 15 minutes old with an error circle of 4 NM, and its course and speed rounded. On the chart it is drawn as an amber circle with its age, and the radio page gives bearing and range from the submarine. A **situation report** (`Enter` at the radio room, or the browser's button) is 20 s of HF transmission with the antenna up. During it the frigate's HF direction finder can take a bearing on the submarine (radio room HF/DF), and lowering the mast aborts it. HQ acknowledges a report in its next broadcast and then always adds a sharper contact report (2 NM). The radio page and the browser's Radio room card show the antenna, the broadcast number and time to the next one, copy and transmit progress, the reports sent, the latest contact report and the radio log (12 entries, saved).
- **Counter-detection and evasion:** the submarine's sonar room tells an intercepted active ping by its frequency as the frigate's hull sonar, a helicopter's dipping sonar or a sonobuoy, and logs it with the measured bearing and the received level (dB re 1 µPa, from source level, spreading and absorption); a buoy pinging within 12 NM is heard only by a crewed submarine. A buoy splashing into the water within 4 NM is heard with a rough bearing (±6°), and a torpedo alarm is kept with its bearing. The **Threat** page (Command page 4 and Navigation page 2; the browser's Threat card at Command and Navigation) counts the pings of the last 5 minutes by source, gives the loudest level with its assessment (from 150 dB the pinger probably holds an echo) and the trend of the last two pings (rising: closing in), splashes, torpedo alarms and ESM emitters, the submarine's own signature (depth against the measured layer, own noise: cavitating, snorkelling, loud, moderate or quiet, the mast) and the crew's recommendations. The chart draws each intercept of the last 2 minutes as a dashed bearing ray. **Evade** (`I` at Command or Navigation, the browser's **Evade** button) gives the crew's evasion order for the freshest alarm (under 2 minutes): against a torpedo, the smaller turn that puts it 150° on the quarter, full speed and a decoy; against active sonar, the stern to the pinger, silent running at 3 kn. Both cross the measured layer (down when above or in it, up when below it), or go deep without a BT; the submarine lifts off the bottom first. The order goes through the same checks as the single keys, and the page shows it before it is given. The picture is display only and not saved.
Binary file not shown.
+5 -3
View File
@@ -168,7 +168,7 @@ Die obere Leiste zeigt Station, Mission, Uhrzeit, Fahrt und Kurs; der Kartenkopf
### Ausguck-Meldungen
Der Brückenausguck (Augenhöhe 18 m, Fernglas 7x50) meldet seine Sichtungen im Ereignis-Feed als `AUSG`-Zeilen, zum Beispiel `Brücke/Ausguck: Fregatte (Admiral-Gorshkov-Fregatte) in 040°, 3.8 sm`. Die Remote-Crew-Brücke zeigt dieselben Meldungen unter „Ausguck-Meldungen“. Brückenseite 3 (Ausguck-Sichtfeld) zeigt die Sichtungen nordorientiert um das eigene Schiff mit der vom Ausguck gemessenen Peilung und Entfernung, nach Art eingefärbt (Oberwasser, U-Boot, Luftfahrzeug, Torpedo) und mit dem Erkannten beschriftet, daneben Sicht, Seegang, Tag/Nacht und die letzten Meldungen; `,` und `.` ändern den Radius (2 bis 30 sm). Über den Meldungen zeigt ein Horizontstreifen das Fernglas voraus (90° Sichtfeld, Skala rechtweisender Peilungen, mit der See bewegter Horizont, Licht der Stunde) mit den Umrissen der Ausguck-Sichtungen in gemessener Peilung und Entfernung; es ist derselbe Renderer wie das Sehrohr des U-Boots. Das Bild hat den Stil des Startbilds: tagsüber blauer Himmel, in der Dämmerung ein warmer Horizont, nachts Sterne und der Mond in seiner Phase in seiner Peilung mit seinem Glitzern auf dem Wasser; Wolken, Regen, Schnee und Nebel folgen der Wetterstation, und die Umrisse erscheinen in Stahl mit heller Kante, nachts mit beleuchteten Fenstern. Die Remote-Crew-Brücke zeigt dasselbe Fernglas als Karte („Fernglas des Ausgucks“), geschwenkt nur in diesem Browser mit den Pfeiltasten (2°, 10°) und „Bug“. `B` nimmt das Fernglas groß über die Karte: ein 16°-Sichtfeld, das mit `,` und `.` (`Umschalt`: 20°-Schritte) oder per Klick in das Rundumbild darunter geschwenkt wird; das Rundumbild markiert jede Sichtung in ihrer gemessenen Peilung, der Bug liegt in der Mitte. Darunter stehen die Sichtungen, die der Sichtlinie nächste zuerst. Die kartierte Küste steht im Horizontstreifen und im Fernglas auf dem Horizont, so weit der Ausguck Land sieht (höchstens 20 sm, im Dunst verblassend), und das Rundumbild markiert sie an seinem Fuß; die Karte kennt keine Höhen, die Hügel sind mit 25 bis 70 m angenommen. `B` erneut führt zur Karte zurück; das Fernglas ist reine Anzeige und wird nicht gespeichert. Ein Kontakt wird beim Näherkommen in bis zu drei Stufen gemeldet, jede Stufe einmal:
Der Brückenausguck (Augenhöhe 18 m, Fernglas 7x50) meldet seine Sichtungen im Ereignis-Feed als `AUSG`-Zeilen, zum Beispiel `Brücke/Ausguck: Fregatte (Admiral-Gorshkov-Fregatte) in 040°, 3.8 sm`. Die Remote-Crew-Brücke zeigt dieselben Meldungen unter „Ausguck-Meldungen“. Brückenseite 3 (Ausguck-Sichtfeld) zeigt die Sichtungen nordorientiert um das eigene Schiff mit der vom Ausguck gemessenen Peilung und Entfernung, nach Art eingefärbt (Oberwasser, U-Boot, Luftfahrzeug, Torpedo) und mit dem Erkannten beschriftet, daneben Sicht, Seegang, Tag/Nacht und die letzten Meldungen; `,` und `.` ändern den Radius (2 bis 30 sm). Über den Meldungen zeigt ein Horizontstreifen das Fernglas voraus (90° Sichtfeld, Skala rechtweisender Peilungen, mit der See bewegter Horizont, Licht der Stunde) mit den Umrissen der Ausguck-Sichtungen in gemessener Peilung und Entfernung; es ist derselbe Renderer wie das Sehrohr des U-Boots. Das Bild hat den Stil des Startbilds: tagsüber blauer Himmel, in der Dämmerung ein warmer Horizont, nachts Sterne und der Mond in seiner Phase in seiner Peilung mit seinem Glitzern auf dem Wasser; Wolken, Regen, Schnee und Nebel folgen der Wetterstation, und die Umrisse erscheinen in Stahl mit heller Kante, nachts mit beleuchteten Fenstern. Von der Dämmerung bis zum Morgen und bei Sicht unter 2 sm führen neutrale Handels- und Fischereifahrzeuge ihre Positionslichter (Kriegsschiffe fahren abgeblendet): weiße Topplichter über die vorderen 225° (ab 50 m Länge zwei, das hintere höher, 6 sm), das grüne Steuerbord- oder rote Backbord-Seitenlicht (3 sm), beide, wenn das Schiff genau auf einen zuhält, und das weiße Hecklicht über die 135° achteraus (3 sm; unter 50 m Länge ein Topplicht mit 5 sm und die übrigen mit 2 sm), nie weiter als die Sicht. Fahrzeuge bei der Arbeit führen dazu ihre Rundumlichter: ein Trawler Grün über Weiß (ein Topplicht erst ab 50 m), ein Lotsenfahrzeug Weiß über Rot statt der Topplichter, ein Vermessungsschiff, Kabelleger oder Forschungsschiff als manövrierbehindertes Fahrzeug Rot, Weiß, Rot und ein Minenräumer drei grüne; ein Schlepper ohne Schleppzug zeigt gewöhnliche Lichter. Zivile Flugzeuge zeigen das rote linke und grüne rechte Flügelspitzenlicht und das weiße Hecklicht (3 sm) sowie ihre blitzenden roten Kollisionswarnlichter und weißen Blitzlichter (10 sm); Militärflugzeuge fliegen abgeblendet; die Silhouette zeigt dann mit dem Bug dorthin, wohin die Lichter weisen, und ein beleuchtetes Schiff wird an seinen Lichtern gesichtet, auch wo der dunkle Rumpf es nicht wird (die Klasse braucht weiter die Silhouette). Die Remote-Crew-Brücke zeigt dasselbe Fernglas als Karte („Fernglas des Ausgucks“), geschwenkt nur in diesem Browser mit den Pfeiltasten (2°, 10°) und „Bug“. `B` nimmt das Fernglas groß über die Karte: ein 16°-Sichtfeld, das mit `,` und `.` (`Umschalt`: 20°-Schritte) oder per Klick in das Rundumbild darunter geschwenkt wird; das Rundumbild markiert jede Sichtung in ihrer gemessenen Peilung, der Bug liegt in der Mitte. Darunter stehen die Sichtungen, die der Sichtlinie nächste zuerst. Die kartierte Küste steht im Horizontstreifen und im Fernglas auf dem Horizont, so weit der Ausguck Land sieht (höchstens 20 sm, im Dunst verblassend), und das Rundumbild markiert sie an seinem Fuß; die Karte kennt keine Höhen, die Hügel sind mit 25 bis 70 m angenommen. Solange das Fernglas oben ist, neigen `↑`/`↓` es um 2° (`Umschalt`: 10°, von 20° nach unten bis 45° nach oben) statt den Maschinentelegrafen zu bedienen, `Q`/`E` zoomen (16°, 8° oder 4° Feld) und die `Leertaste` schaltet die Stabilisierung, die alle bis auf ein Achtel der Schiffsbewegung herausnimmt; die Zeile unter dem Bild zeigt Neigung und Feld, und die Remote-Crew-Karte hat dieselben Knöpfe für ihren eigenen Browser. Die See folgt dem Wind: gegen die See laufen die Kämme in langen Reihen auf einen zu, mit der See laufen ihre Rücken davon, quer dazu ziehen kurze Kämme seitlich durchs Bild, und das Schiff stampft in Gegen- oder Mitlaufsee und rollt in Dwarssee. `B` erneut führt zur Karte zurück; das Fernglas ist reine Anzeige und wird nicht gespeichert. Ein Kontakt wird beim Näherkommen in bis zu drei Stufen gemeldet, jede Stufe einmal:
- **Gesichtet:** nur die Art des Objekts ist klar (Fahrzeug, Luftfahrzeug, kleines Objekt an der Wasseroberfläche).
- **Klasse:** die Silhouette zeigt die Klasse, zum Beispiel Handelsschiff, Kriegsschiff, Flugzeugträger, Fischereifahrzeug, Speedboot, aufgetauchtes U-Boot, Verkehrsflugzeug oder Militärflugzeug.
@@ -190,6 +190,7 @@ Klasse und Typ brauchen eine feiner aufgelöste Silhouette als die Sichtung (Joh
| `K` | Kamera-Follow an/aus |
| `, / .` | Ausguck-Seite: Radius kleiner / größer |
| `B` | Ausguck-Seite: Fernglas über der Karte ein/aus (, / . schwenken) |
| `↑/↓ · Q/E · Space` | Fernglas oben: ↑/↓ neigen 2° (Umschalt: 10°) statt Maschinentelegraf, Q/E Zoom (16°, 8°, 4° Feld), Leertaste Stabilisierung |
| `G` | Gefechtsstationen an/aus |
Auf der Brücke steuert der Trackball das Ruder. `U` und `V` öffnen die direkte Zahleneingabe; die Simulation läuft währenddessen weiter. `Enter` bestätigt, `Esc` bricht ab.
@@ -224,7 +225,7 @@ Gefechtslage:
- Keine Zeitraffung, keine Pause und keine Autopilot-Wegpunkte für die Fregatte.
- Keine automatische Torpedoerkennung: der Alarm beruht nur auf gehörten Intercepts oder der Klassifizierung des Sonarbedieners; ein außerhalb der Suchkopfreichweite leise laufender Torpedo kann unangekündigt eintreffen. Der Ausguck meldet nur eine sichtbare Laufbahn.
- Der Ausguck liest weder Schiffsnamen noch Flagge und meldet keine Lichter oder Signalkörper.
- Der Ausguck liest weder Schiffsnamen noch Flagge und meldet keine Lichter oder Signalkörper; die Lichter werden nur gezeichnet. Kein Schiff im Spiel ankert, schleppt, fischt mit Schleppfahrt oder ist manövrierunfähig, daher erscheinen Ankerlicht, Schlepplichter und die Lichter eines manövrierunfähigen Fahrzeugs nie.
## 2 Sonar
@@ -1113,7 +1114,7 @@ Eine zweite Crew kann den Gegner spielen. Das U-Boot hat sieben Stationen: Führ
- **Unter der Testtiefe:** die Crew darf das besetzte U-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 U-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 U-Boot ist verloren. Die U-Boote der KI halten ihre Testtiefe.
- **Atmosphäre:** das U-Boot hat eigene Geräusche, am uConsole, wenn er das U-Boot spielt, und in den Browsern des U-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 U-Boot, weiter weg als dumpfes, fernes Grollen, und das Log meldet sie mit der Peilung, die die Ohren der Crew liefern (einige Grad daneben). Das Ping eines Jägers (Rumpfsonar, Tauchsonar oder aktive Boje) klingt am Rumpf an. Mit Stereoton kommen beide aus dieser Peilung, links für Backbord und rechts für Steuerbord vom Bug des U-Boots aus. Bei **Schleichfahrt** schaltet das U-Boot auf Rotlicht: die Boot-Bildschirme am uConsole und die Führungsstationen des U-Boots im Browser werden gedimmt rot, bis die Schleichfahrt endet.
- **Besatzung:** das U-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 U-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 U-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 im Stil des Startbilds: Himmel und See im Licht der Stunde (Tag, Dämmerung, Nacht mit Sternen und Mond), Wolken, Regen, Schnee und Nebel nach dem Wetter, 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 U-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.
- **Lagebild:** ein gehörter Aktivping oder Torpedo wird mit der Peilung protokolliert, die das U-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 U-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 im Stil des Startbilds: Himmel und See im Licht der Stunde (Tag, Dämmerung, Nacht mit Sternen und Mond), Wolken, Regen, Schnee und Nebel nach dem Wetter, 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. Neutrale Schiffe zeigen hier ihre Positionslichter wie im Fernglas der Brücke. `↑`/`↓` neigen den Kopf um 2° (`Umschalt`: 10°, von 10° nach unten bis 60° nach oben, für Flugzeuge), `,`/`.` wechseln zwischen kleiner (32° Feld) und großer Vergrößerung (8°), und die `Leertaste` schaltet die Stabilisierung; Neigung und Feld stehen in der Bildecke. Diese Einstellungen gehören zum Okular der uConsole oder jedes Browsers, ändern nur das Bild (nicht, was die Optik erkennt) und werden nicht gespeichert. `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 U-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 U-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, bis zu 16, die bestpassenden zuerst: jeder Eintrag zeigt seine Passung (**passt gut**, **mittel** oder **schwach**: Frequenz und PRF nahe der Mitte der Bereiche und dieselbe Modulation passen am besten), Einträge gleicher Stufe stehen nach Katalogschlüssel, und die Liste ordnet sich nur um, wenn sich eine Stufe ändert; 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 U-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 **Umlaufzeit** ist die Zeit zwischen den Treffern der Hauptkeule eines Emitters (den Pegelspitzen; nah dran sind dazwischen die schwächeren Nebenkeulen zu hören und zählen nicht), gemessen nur an der eigenen Signalform des Emitters, über Lücken bis 12 s ohne überspülten Durchlauf dazwischen, und angezeigt nach 8 s: **dreht** mit ihrer Dauer (etwa 2,5 s für ein Navigations- oder Seeraumradar, 5 s für ein Luftraumradar, 2 s für ein Mehrzweckradar) ist ein Suchradar, das vorbeistreicht; **dauernd** (die Keule bei jedem Durchlauf auf dem Mast) ist ein Verfolgungs- oder Feuerleitradar. Ein dauernd beleuchtender, erfasster Emitter ist immer eine Mastwarnung, und das Log meldet einmal, wenn ein Emitter auf Dauerbeleuchtung wechselt. 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 U-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.
- **Funkraum:** die Flottenführung sendet alle 10 Minuten einen U-Boot-Rundspruch (Rundspruch 0 bei Missionsbeginn, dann 1, 2 …) und wiederholt ihn bis zum nächsten. Das U-Boot nimmt ihn nur mit klarer Antenne auf, das heißt mit ausgefahrenem Mast auf Sehrohrtiefe, und erst nach 20 s ununterbrochenem Empfang innerhalb der Sendezeit dieses Rundspruchs; ein U-Boot, das tief bleibt, verpasst Rundsprüche und bekommt nur den jeweils neuesten. In 60 % der Fälle enthält ein Rundspruch die **Feindlagemeldung** der Führung zur Fregatte: einen 5 bis 15 Minuten alten Standort mit 4 sm Fehlerkreis und gerundetem Kurs und Fahrt. Die Karte zeigt ihn als gelben Kreis mit seinem Alter, und die Funkseite nennt Peilung und Entfernung vom U-Boot. Eine **Lagemeldung** (`Enter` im Funkraum oder der Knopf im Browser) sind 20 s Kurzwellensendung mit klarer Antenne. Währenddessen kann der KW-Peiler der Fregatte das U-Boot peilen (Funkraum HF/DF), und Mast einfahren bricht sie ab. Die Führung bestätigt eine Meldung im nächsten Rundspruch und fügt dann immer eine schärfere Feindlagemeldung (2 sm) bei. Die Funkseite und die Karte Funkraum im Browser zeigen Antenne, Rundspruchnummer und Zeit bis zum nächsten, Fortschritt von Aufnahme und Sendung, gesendete Meldungen, die letzte Feindlage und das Funktagebuch (12 Einträge, wird gespeichert).
- **Gegenortung und Ausweichen:** der Sonarraum des U-Boots unterscheidet einen aufgefangenen Aktivping an seiner Frequenz als Rumpfsonar der Fregatte, Tauchsonar eines Hubschraubers oder Sonoboje und protokolliert ihn mit gemessener Peilung und Empfangspegel (dB re 1 µPa, aus Quellpegel, Ausbreitung und Absorption); eine pingende Boje im Umkreis von 12 sm hört nur ein bemanntes U-Boot. Eine Boje, die im Umkreis von 4 sm ins Wasser fällt, wird mit grober Peilung (±6°) gehört, ein Torpedoalarm bleibt mit seiner Peilung stehen. Die Seite **Bedrohung** (Führung Seite 4 und Navigation Seite 2; im Browser die Karte Bedrohung an Führung und Navigation) zählt die Pings der letzten 5 Minuten nach Quelle, nennt den lautesten Pegel mit Bewertung (ab 150 dB hat der Pinger wahrscheinlich ein Echo) und den Trend der letzten beiden Pings (steigend: er kommt näher), Splashes, Torpedoalarme und ESM-Emitter, die eigene Signatur (Tiefe gegen die gemessene Schicht, Eigenlärm: kavitierend, schnorchelnd, laut, mäßig oder leise, der Mast) und die Empfehlungen der Crew. Die Karte zeichnet jede Auffassung der letzten 2 Minuten als gestrichelten Peilstrahl. **Ausweichen** (`I` an Führung oder Navigation, im Browser die Schaltfläche **Ausweichen**) gibt den Ausweichbefehl der Crew zum frischesten Alarm (unter 2 Minuten): gegen einen Torpedo die kleinere Wende, die ihn 150° achteraus legt, Höchstfahrt und ein Täuschkörper; gegen Aktivsonar das Heck zum Pinger, Schleichfahrt mit 3 kn. Beide wechseln durch die gemessene Schicht (nach unten, wenn das U-Boot darüber oder darin steht, nach oben, wenn es darunter steht), ohne BT gehen sie auf Tiefe; ein aufgesetztes U-Boot hebt zuerst ab. Der Befehl durchläuft dieselben Prüfungen wie die Einzeltasten, und die Seite zeigt ihn, bevor er gegeben wird. Das Bild ist nur Anzeige und wird nicht gespeichert.
@@ -1157,6 +1158,7 @@ Die obere Leiste zeigt die sieben Stationen des U-Boots als Reiter: `1` Führung
| `← / →` | Seite Mast & ESM: Emitter aus der Bibliothek einstufen (Annotation, keine Wahrheit) |
| `Eingabe` | Seite Mast & ESM: Kreuzpeilung (oder Peillinie) in den Plot des U-Boots |
| `← / →` | Sehrohrseite: Rohr 2° schwenken (Umschalt: 10°) (Führung, Mast & ESM) |
| `↑/↓ · , / . · Space` | Sehrohrseite: ↑/↓ Kopf 2° neigen (Umschalt: 10°), , / . kleine/große Vergrößerung (32°, 8° Feld), Leertaste Stabilisierung |
| `Eingabe` | Sehrohrseite: Stadimeter-Entfernung der Sichtung unter dem Fadenkreuz (Führung, Mast & ESM) |
| `Strg+Enter` | Sehrohrseite: Schuss nach der Lösung des Angriffsrechners für die Sichtung unter dem Fadenkreuz (Führung) |
| `+ / -` | Fahrtstufe schneller / langsamer (Führung, Maschine) |
+5 -3
View File
@@ -168,7 +168,7 @@ The top bar shows the station, the mission, the clock, speed and course; the cha
### Bridge lookout reports
The bridge lookout (eye height 18 m, 7x50 binoculars) reports sightings in the event feed as `AUSG` lines, for example `Bridge lookout: frigate (Admiral-Gorshkov-Fregatte) bearing 040°, 3.8 NM`. The Remote Crew bridge lists the same reports under "Lookout reports". Bridge page 3 (the lookout scope) shows the sightings north up around the own ship at the range and bearing the lookout measured, coloured by kind (surface, submarine, aircraft, torpedo) and labelled with what he made out, next to visibility, sea state, day/night and the latest reports; `,` and `.` change the scope radius (2 to 30 NM). Above the reports a horizon strip shows the binoculars toward the bow (90° field, true-bearing scale, the horizon moving with the sea, the light of the hour) with the outlines of the lookout's sightings at their measured bearing and range; it is the same renderer as the submarine's periscope. The picture has the start screen's look: by day a blue sky, at dusk a warm horizon, at night stars and the moon in its phase at its bearing with its glitter on the water; clouds, rain, snow and fog follow the weather station, and the silhouettes are drawn in steel with a lit rim, with lit windows at night. The Remote Crew bridge shows the same binoculars as a card ("Lookout binoculars"), trained in that browser only with the arrow buttons (2°, 10°) and "Bow". `B` raises the binoculars large over the chart: a 16° field the operator trains with `,` and `.` (`Shift`: 20° steps) or by clicking the all-round panorama below it, which marks every sighting at its measured bearing with the bow in the middle; the sightings are listed underneath, nearest the line of sight first. The charted coast stands on the horizon of the strip and the binoculars as far as the lookout can see land (at most 20 NM, fading into the haze), and the panorama marks it along its foot; the chart has no elevation, so the hills are an assumed 25 to 70 m. `B` again returns to the chart; the binoculars are display only and are not saved. A contact is reported in up to three steps as it closes, each step once:
The bridge lookout (eye height 18 m, 7x50 binoculars) reports sightings in the event feed as `AUSG` lines, for example `Bridge lookout: frigate (Admiral-Gorshkov-Fregatte) bearing 040°, 3.8 NM`. The Remote Crew bridge lists the same reports under "Lookout reports". Bridge page 3 (the lookout scope) shows the sightings north up around the own ship at the range and bearing the lookout measured, coloured by kind (surface, submarine, aircraft, torpedo) and labelled with what he made out, next to visibility, sea state, day/night and the latest reports; `,` and `.` change the scope radius (2 to 30 NM). Above the reports a horizon strip shows the binoculars toward the bow (90° field, true-bearing scale, the horizon moving with the sea, the light of the hour) with the outlines of the lookout's sightings at their measured bearing and range; it is the same renderer as the submarine's periscope. The picture has the start screen's look: by day a blue sky, at dusk a warm horizon, at night stars and the moon in its phase at its bearing with its glitter on the water; clouds, rain, snow and fog follow the weather station, and the silhouettes are drawn in steel with a lit rim, with lit windows at night. From dusk to dawn and in visibility under 2 NM neutral merchant ships and fishing vessels run their navigation lights (warships run darkened): white masthead lights over the forward 225° (two from 50 m length, the aft one higher, 6 NM), the green starboard or red port side light (3 NM), both when she heads straight at you, and the white stern light over the 135° astern (3 NM; under 50 m length one masthead light at 5 NM and the others at 2 NM), never beyond the visibility. Vessels at work add their all-round lights: a trawler green over white (a masthead light only from 50 m), a pilot vessel white over red instead of masthead lights, a survey ship, cable layer or research ship restricted in her ability to manoeuvre red, white, red, and a mine clearance vessel three green; a tug without a tow shows ordinary lights. Civil aircraft show the red left and green right wingtip light and the white tail light (3 NM) and their flashing red anti-collision beacons and white strobes (10 NM); military aircraft fly dark; the silhouette then points its bow the way the lights show, and a lit ship is sighted by its lights even where the dark hull is not (its class still needs the silhouette). The Remote Crew bridge shows the same binoculars as a card ("Lookout binoculars"), trained in that browser only with the arrow buttons (2°, 10°) and "Bow". `B` raises the binoculars large over the chart: a 16° field the operator trains with `,` and `.` (`Shift`: 20° steps) or by clicking the all-round panorama below it, which marks every sighting at its measured bearing with the bow in the middle; the sightings are listed underneath, nearest the line of sight first. The charted coast stands on the horizon of the strip and the binoculars as far as the lookout can see land (at most 20 NM, fading into the haze), and the panorama marks it along its foot; the chart has no elevation, so the hills are an assumed 25 to 70 m. While the binoculars are up, `↑`/`↓` tilt them 2° (`Shift`: 10°, from 20° down to 45° up) instead of working the telegraph, `Q`/`E` zoom them (16°, 8° or 4° field) and `Space` switches the stabilizer, which takes out all but an eighth of the ship's motion; the line under the picture shows tilt and field, and the Remote Crew card has the same buttons for its own browser. The sea follows the wind: looking into it the crests come at you in long rows, looking down-sea their backs run away, across it short crests run sideways, and the ship pitches in a head or following sea and rolls in a beam sea. `B` again returns to the chart; the binoculars are display only and are not saved. A contact is reported in up to three steps as it closes, each step once:
- **Sighted:** only the kind of object is clear (vessel, aircraft, small object on the surface).
- **Class:** the silhouette shows the class, for example merchant ship, warship, aircraft carrier, fishing vessel, speedboat, surfaced submarine, airliner or military aircraft.
@@ -190,6 +190,7 @@ Class and type need a finer resolved silhouette than the sighting (Johnson crite
| `K` | Camera follow on/off |
| `, / .` | Lookout page: scope radius smaller / larger |
| `B` | Lookout page: binoculars over the chart on/off (, / . train them) |
| `↑/↓ · Q/E · Space` | Binoculars up: ↑/↓ tilt 2° (Shift: 10°) instead of the telegraph, Q/E zoom (16°, 8°, 4° field), Space stabilizer |
| `G` | Action stations on/off |
The trackball steers the rudder while the Bridge is selected. `U` and `V` open direct numeric entry; the simulation keeps running while you type. `Enter` confirms, `Esc` cancels.
@@ -224,7 +225,7 @@ Combat situation:
- No time acceleration, no pause and no autopilot waypoints for the frigate.
- No automatic torpedo identification: the alarm rests only on heard intercepts or the sonar operator's classification; a torpedo running silent outside seeker range can arrive unannounced. The lookout calls out only a visible wake.
- The lookout never reads a ship's name or flag and does not report navigation lights or day shapes.
- The lookout never reads a ship's name or flag and does not report navigation lights or day shapes; the lights are only drawn. No ship in the game anchors, tows, trawls at trawling speed or is not under command, so anchor lights, towing lights and the not-under-command lights never show.
## 2 Sonar
@@ -1112,7 +1113,7 @@ A second crew can play the enemy. The submarine has seven stations: Command, Son
- **Below test depth:** the crew may order the crewed submarine 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 submarine 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 submarine is lost. The AI's submarines keep to their test depth.
- **Atmosphere:** the submarine has its own sounds, on the uConsole when it plays the submarine and in the submarine'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). A hunter's ping (hull sonar, dipping sonar or active buoy) rings on the hull. With stereo sound both come from that bearing, left for port and right for starboard of the submarine's head. In **silent running** the submarine rigs for red: the uConsole's submarine screens and the browser's submarine command stations turn to dimmed red light until silent running ends.
- **Crew:** the submarine 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 submarine'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 submarine with bearing (log and ESM list), and the mast lowers by itself when the submarine 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 in the start screen's look: sky and sea in the light of the hour (day, dusk, night with stars and the moon), clouds, rain, snow and fog from the weather, 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 submarine'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.
- **Situation picture:** an intercepted active ping or torpedo is logged with the bearing the submarine'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 submarine with bearing (log and ESM list), and the mast lowers by itself when the submarine 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 in the start screen's look: sky and sea in the light of the hour (day, dusk, night with stars and the moon), clouds, rain, snow and fog from the weather, 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. Neutral ships show their navigation lights here as on the bridge's binoculars. `↑`/`↓` tilt the head 2° (`Shift`: 10°, from 10° down to 60° up, for aircraft), `,`/`.` switch between low power (32° field) and high power (8°), and `Space` switches the stabilizer; tilt and field stand in the corner of the picture. These settings belong to the eyepiece of the uConsole or of each browser, change only the picture (not what the optics detect) and are not saved. `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 submarine'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 submarine'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, up to 16, best fit first: each entry shows its fit (**good**, **fair** or **poor**: frequency and PRF near the middle of its ranges and the same modulation fit best), entries of one grade stand by catalogue key, and the list only reorders when a grade changes; 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 submarine's own position (20 minutes); the chart shows the latest bearing lines, and once the submarine'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 **scan period** is the time between an emitter's main-beam hits (the level peaks; close in, the weaker side lobes are heard in between and do not count), measured only on the emitter's own waveform, over gaps up to 12 s with no washed scan between them, and read after 8 s: **rotating** with its period (about 2.5 s for a navigation or surface-search radar, 5 s for an air-search radar, 2 s for a multi-function radar) is a search radar sweeping past; **steady** (the beam on the mast at every scan) is a tracking or fire-control radar. A steady, live emitter is always a mast warning, and the log reports once when an emitter turns steady. 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 submarine's plot. On the uConsole's Mast & ESM page `↑`/`↓` select an emitter, `←`/`→` step through its library classification and `Enter` transfers it to the plot.
- **Radio room:** fleet headquarters sends a submarine broadcast every 10 minutes (broadcast 0 at mission start, then 1, 2 …) and repeats it until the next one. The submarine copies it only with its antenna up, which is the raised mast at periscope depth, and only after 20 s of unbroken reception inside that broadcast's time on the air; a submarine that stays deep misses broadcasts and only ever gets the latest. A broadcast carries HQ's **contact report** on the frigate in 60 % of cases: a position 5 to 15 minutes old with an error circle of 4 NM, and its course and speed rounded. On the chart it is drawn as an amber circle with its age, and the radio page gives bearing and range from the submarine. A **situation report** (`Enter` at the radio room, or the browser's button) is 20 s of HF transmission with the antenna up. During it the frigate's HF direction finder can take a bearing on the submarine (radio room HF/DF), and lowering the mast aborts it. HQ acknowledges a report in its next broadcast and then always adds a sharper contact report (2 NM). The radio page and the browser's Radio room card show the antenna, the broadcast number and time to the next one, copy and transmit progress, the reports sent, the latest contact report and the radio log (12 entries, saved).
- **Counter-detection and evasion:** the submarine's sonar room tells an intercepted active ping by its frequency as the frigate's hull sonar, a helicopter's dipping sonar or a sonobuoy, and logs it with the measured bearing and the received level (dB re 1 µPa, from source level, spreading and absorption); a buoy pinging within 12 NM is heard only by a crewed submarine. A buoy splashing into the water within 4 NM is heard with a rough bearing (±6°), and a torpedo alarm is kept with its bearing. The **Threat** page (Command page 4 and Navigation page 2; the browser's Threat card at Command and Navigation) counts the pings of the last 5 minutes by source, gives the loudest level with its assessment (from 150 dB the pinger probably holds an echo) and the trend of the last two pings (rising: closing in), splashes, torpedo alarms and ESM emitters, the submarine's own signature (depth against the measured layer, own noise: cavitating, snorkelling, loud, moderate or quiet, the mast) and the crew's recommendations. The chart draws each intercept of the last 2 minutes as a dashed bearing ray. **Evade** (`I` at Command or Navigation, the browser's **Evade** button) gives the crew's evasion order for the freshest alarm (under 2 minutes): against a torpedo, the smaller turn that puts it 150° on the quarter, full speed and a decoy; against active sonar, the stern to the pinger, silent running at 3 kn. Both cross the measured layer (down when above or in it, up when below it), or go deep without a BT; the submarine lifts off the bottom first. The order goes through the same checks as the single keys, and the page shows it before it is given. The picture is display only and not saved.
@@ -1156,6 +1157,7 @@ The top bar shows the submarine's seven stations as tabs: `1` Command, `2` Sonar
| `← / →` | Mast & ESM page: classify the emitter from the library (annotation, never truth) |
| `Enter` | Mast & ESM page: cross-fix (or the bearing line) into the submarine's plot |
| `← / →` | Periscope page: train the scope 2° (Shift: 10°) (Command, Mast & ESM) |
| `↑/↓ · , / . · Space` | Periscope page: ↑/↓ tilt the head 2° (Shift: 10°), , / . low/high power (32°, 8° field), Space stabilizer |
| `Enter` | Periscope page: stadimeter range of the sighting under the crosshair (Command, Mast & ESM) |
| `Ctrl+Enter` | Periscope page: fire on the attack computer's solution of the sighting under the crosshair (Command) |
| `+ / -` | Telegraph step faster / slower (Command, Engine room) |
Binary file not shown.
+2
View File
@@ -1627,3 +1627,5 @@ Notizen Phase 1:
- 1.3.19: Startfenster `packaging/uconsole/u_jagd_splash.py` (venv-Pygame, randlos, Status-Zeilen über eine Pipe; `close\tSek.` hält eine Endmeldung auch nach EOF). Der Starter reicht das Schreibende als `U_JAGD_SPLASH_FD` ans Spiel, `src/core/launch_signal.game_visible()` schließt es nach dem ersten `compose_frame` (bzw. im Web-Modus). Die Sperrdatei nennt ihren Halter (`launch`/`game`/`update`): zweiter Start bei `launch`/`game` zeigt „läuft bereits“ und endet, bei `update` wartet er. `U_JAGD_NO_SPLASH=1` schaltet das Fenster ab.
- 1.3.23: Overlays im Startbildschirm-Stil (`src/ui/overlay_style.py`: `backdrop`, `panel`, `title`, `highlight`). Solange ein Verwaltungs-Overlay offen ist oder das Missionsende (ohne Nachbesprechung) steht, zeichnet `Game._draw` statt der Station die Splash-Szene (`_splash_backdrop_active`); das F9-Beitrittsfenster lässt die Station sichtbar. Web: `dialog`/`dialog::backdrop` in `overlays.css`, Farben als `--night-*`-Tokens.
- 1.3.26: `online()` im uConsole-Updater prüft vor der Update-Suche eine TCP-Verbindung zu github.com:443 (oder zum HTTPS-Proxy) in einem Daemon-Thread, höchstens `PROBE_TIMEOUT_S` = 2,5 s (auch bei hängendem DNS); offline wird die Suche übersprungen. Git-Abrufe laufen mit `GIT_TIMEOUT_S` = 60, `GIT_TERMINAL_PROMPT=0` und Low-Speed-Abbruch. Der Windows-Starter prüft im Hintergrund-Thread und blockiert den Serverstart nicht.
- 1.3.42: `tools/prune_releases.py` + Workflow-Schritt "Remove older releases": nach dem Release löscht main alle älteren Releases (`gh release delete` ohne `--cleanup-tag`, Tags bleiben); nur ältere `vX.Y.Z`, nie neuere. Beide Updater brauchen nur `releases/latest`.
- 1.3.43: Aufräumen: `prune_releases.py` schreibt "\n" (Windows-Python schrieb CRLF, `gh release delete 'v1.3.41\r'` fand nichts), Workflow entfernt "\r" zusätzlich.
+1 -1
View File
@@ -1,4 +1,4 @@
# U-Jagd 1.3.41 - Stations- und Tastenkürzel
# U-Jagd 1.3.44 - Stations- und Tastenkürzel
Druckfassung: [`station-shortcuts.de.pdf`](station-shortcuts.de.pdf).
Maßgeblich ist die implementierte lokale Bedienung. Stationsnummern und
Binary file not shown.
+25 -8
View File
@@ -780,7 +780,10 @@ def _radio_tasks(game, station_down):
"""HQ tasks as the radio room knows them (reported positions only)."""
tasks = []
for row in game.task_view():
item = {key: row[key] for key in RADIO_TASK_FIELDS if key != "can_answer"}
# The wire calls the task's kind ``type``: the browser rejects any
# ``kind`` key in a role state (it never carries entity kinds).
item = {key: row["kind" if key == "type" else key]
for key in RADIO_TASK_FIELDS if key != "can_answer"}
for key in ("x", "y", "radius_nm", "bearing", "range_nm", "progress",
"course", "speed_kn", "respond_s", "remaining_s"):
item[key] = _number(item[key])
@@ -1313,6 +1316,12 @@ def _sky(game):
for key in web_schema.SKY_FIELDS}
def _nav_lights(code):
"""A ``nav_lights`` code as published, or None."""
from src.sensors import nav_lights
return code if code is not None and nav_lights.valid(code) else None
def _lookout_glasses(game):
"""The bridge lookout's binoculars: the horizon in motion and the outlines
of his own sightings (measured bearing, class he made out, apparent
@@ -1320,16 +1329,21 @@ def _lookout_glasses(game):
from src.ui import horizon
from src.ui.stations.bridge import lookout_outlines
weather = game.world.weather_values()
offset, tilt = horizon.horizon_motion(0, game.sim_t, weather["sea_state"])
# Pitch and roll by the heading to the sea; the browser turns them with
# its own line of sight (``horizon_offset``/``horizon_tilt``: the bow).
pitch, roll = horizon.hull_motion(0, game.sim_t, weather["sea_state"],
weather["wind_from_deg"] - game.ship.course)
offset, tilt = horizon.view_motion(pitch, roll)
return dict(course=_number(game.ship.course % 360.0),
fov_deg=_number(config.LOOKOUT_GLASSES_FOV_DEG),
visibility_nm=_number(weather["visibility_nm"]),
sea_state=_number(weather["sea_state"]),
horizon_offset=_number(offset), horizon_tilt=_number(tilt),
motion_pitch=_number(pitch), motion_roll=_number(roll),
sky=_sky(game),
outlines=[dict(bearing=_number(bearing), span_deg=_number(span), cls=str(cls),
stale=bool(stale))
for bearing, span, cls, stale in
stale=bool(stale), lights=_nav_lights(lights))
for bearing, span, cls, stale, lights in
lookout_outlines(game, game.lookout_sightings())[:16]])
@@ -1358,7 +1372,9 @@ def _uboot_scope(game, boat):
range_sigma_nm=_number(row["range_sigma_nm"]),
range_age_s=(_age(now, row["range_t"])
if row["range_t"] is not None else None),
solution=_uboot_solution(boat, row["ref"], now))
solution=_uboot_solution(boat, row["ref"], now),
lights=(None if now - row["t"] > 1.0
else _nav_lights(boat.orders._lights.get(row["ref"]))))
for row in boat.orders.sightings[:config.UBOOT_SIGHTINGS_MAX]])
@@ -1523,14 +1539,15 @@ def _uboot_threat(game, boat):
intercepts and own state only; see src/core/boat_threat.py)."""
view = boat_threat.picture(game, boat)
plan = boat_threat.evasion_plan(game, boat)
view["intercepts"] = [dict(kind=row["kind"], bearing=_number(row["bearing"]),
view["intercepts"] = [dict(type=row["kind"], bearing=_number(row["bearing"]),
level_db=_number(row["level_db"]), age_s=_number(row["age_s"]))
for row in view["intercepts"]]
view["counts"] = {kind: int(view["counts"][kind]) for kind in boat_threat.KINDS}
for key in ("loudest_db", "layer_m", "depth_m"):
view[key] = _number(view[key])
view["plan"] = None if plan is None else dict(
plan, bearing=_number(plan["bearing"]), course=_number(plan["course"]),
{key: value for key, value in plan.items() if key != "kind"}, type=plan["kind"],
bearing=_number(plan["bearing"]), course=_number(plan["course"]),
speed_kn=_number(plan["speed_kn"]), depth_m=_number(plan["depth_m"]))
return view
@@ -1558,7 +1575,7 @@ def _uboot_radio(game, boat):
transmitting=bool(radio.transmitting), sitreps=int(progress["sitreps"]),
ack_due=bool(progress["ack_due"]),
report=_uboot_radio_report(game, None if latest is None else latest["report"]),
log=[dict(seq=int(row["seq"]), kind=row["kind"], age_s=_age(game.sim_t, row["t"]),
log=[dict(seq=int(row["seq"]), type=row["kind"], age_s=_age(game.sim_t, row["t"]),
number=None if row["number"] is None else int(row["number"]),
ack=bool(row["ack"]), report=_uboot_radio_report(game, row["report"]))
for row in reversed(radio.log)])
+8 -6
View File
@@ -22,7 +22,7 @@ RADIO_FIELDS = ("ref", "label", "bearing", "quality", "age_s",
HELICOPTER_TACTICAL_FIELDS = TACTICAL_FIELDS + ("classification", "released_to_opz")
# HQ tasks in the radio room (``src/core/tasking.py``): the reported
# position and the task's clock, never the raft's or a ship's true position.
RADIO_TASK_FIELDS = ("id", "kind", "state", "name", "persons", "x", "y", "radius_nm",
RADIO_TASK_FIELDS = ("id", "type", "state", "name", "persons", "x", "y", "radius_nm",
"course", "speed_kn", "bearing", "range_nm", "respond_s",
"remaining_s", "progress", "sighted", "verdict", "points",
"can_answer")
@@ -63,8 +63,10 @@ SKY_FIELDS = ("light", "dusk", "cloud", "precipitation", "intensity", "wind_from
"sun_bearing", "sun_alt_deg", "moon_bearing", "moon_alt_deg",
"moon_illumination", "moon_waxing")
LOOKOUT_GLASSES_FIELDS = ("course", "fov_deg", "visibility_nm", "sea_state", "horizon_offset",
"horizon_tilt", "sky", "outlines")
LOOKOUT_OUTLINE_FIELDS = ("bearing", "span_deg", "cls", "stale")
"horizon_tilt", "motion_pitch", "motion_roll", "sky", "outlines")
# ``lights``: the navigation lights made out (``src/sensors/nav_lights.py``
# code) or null.
LOOKOUT_OUTLINE_FIELDS = ("bearing", "span_deg", "cls", "stale", "lights")
SIGHT_CLASSES = ("warship", "merchant", "aircraft", "torpedo", "unknown")
_UBOOT_COMMAND_SHAPE = ("navigation", "status", "weapons", "alarms", "contacts",
@@ -108,18 +110,18 @@ UBOOT_ESM_CANDIDATE_FIELDS = ("name", "role", "fit")
UBOOT_THREAT_FIELDS = ("intercepts", "counts", "loudest_db", "echo_likely", "trend",
"layer", "layer_m", "depth_m", "noise", "mast", "esm_count",
"advice", "plan")
UBOOT_INTERCEPT_FIELDS = ("kind", "bearing", "level_db", "age_s")
UBOOT_INTERCEPT_FIELDS = ("type", "bearing", "level_db", "age_s")
UBOOT_INTERCEPT_KINDS = ("hull", "dipping", "buoy", "splash", "torpedo")
UBOOT_THREAT_ADVICE = ("uboot.advice.torpedo", "uboot.advice.mast_down",
"uboot.advice.slow_down", "uboot.advice.measure_layer",
"uboot.advice.go_below", "uboot.advice.evade")
UBOOT_EVADE_PLAN_FIELDS = ("kind", "bearing", "course", "speed_kn", "depth_m", "silent",
UBOOT_EVADE_PLAN_FIELDS = ("type", "bearing", "course", "speed_kn", "depth_m", "silent",
"decoy")
# The boat's radio room (``radio``, src/core/boat_radio.py): schedule,
# transmissions, HQ's latest contact report and the message log.
UBOOT_RADIO_FIELDS = ("antenna", "broadcast", "copied", "next_s", "copy", "send",
"transmitting", "sitreps", "ack_due", "report", "log")
UBOOT_RADIO_LOG_FIELDS = ("seq", "kind", "age_s", "number", "ack", "report")
UBOOT_RADIO_LOG_FIELDS = ("seq", "type", "age_s", "number", "ack", "report")
UBOOT_RADIO_LOG_KINDS = ("broadcast", "sent", "aborted")
UBOOT_RADIO_REPORT_FIELDS = ("x", "y", "radius_nm", "course", "speed_kn", "age_s")
UBOOT_ESM_FIX_FIELDS = ("x", "y", "major_nm", "minor_nm", "axis_deg", "lines", "consistent")
+8
View File
@@ -418,6 +418,8 @@ UBOOT_TUBE_FLOOD_NOISE_S = 4.0
UBOOT_TUBE_STATES = ("dry", "flooding", "flooded")
UBOOT_SCOPE_EYE_HEIGHT_M = 2.5 # optics just above the surface
UBOOT_SCOPE_FOV_DEG = 32.0 # field of view of the low-power optics
UBOOT_SCOPE_POWERS = (1.0, 4.0) # low power (1.5x) and high power (6x)
UBOOT_SCOPE_ELEVATION_DEG = (-10.0, 60.0) # the head tilts up for the sky
UBOOT_SCOPE_STEP_DEG = 2.0 # arrow keys turn the scope by this
UBOOT_SCOPE_STEP_FAST_DEG = 10.0 # ... and with Shift by this
UBOOT_SCOPE_BEARING_ERR_DEG = 1.0 # sigma of a periscope bearing
@@ -486,6 +488,12 @@ LOOKOUT_DISPLAY_RANGES_NM = (2.0, 5.0, 12.0, 20.0, 30.0)
LOOKOUT_GLASSES_FOV_DEG = 16.0
LOOKOUT_GLASSES_STEP_DEG = 5.0
LOOKOUT_GLASSES_STEP_FAST_DEG = 20.0
# Zoom binoculars: the field narrows 16, 8, 4 degrees; tilt 20 down to 45 up.
LOOKOUT_GLASSES_POWERS = (1.0, 2.0, 4.0)
LOOKOUT_GLASSES_ELEVATION_DEG = (-20.0, 45.0)
# Tilting the binoculars or the periscope head (Shift: fast).
SIGHT_TILT_STEP_DEG = 2.0
SIGHT_TILT_STEP_FAST_DEG = 10.0
# Land in sight: day/clear range of a coast with 50 m hills, checked on a
# slow cadence; a landmass is reported again only after it dropped out of
# sight.
+2 -1
View File
@@ -24,7 +24,7 @@ from src.network.connectivity import ConnectivityMonitor
from src.network.live_traffic import LiveTrafficManager
from src.core.mission import Mission
from src.core.station import Station
from src.core import opfor
from src.core import opfor, optics
from src.core.limits import (MAX_AIR_PICTURE_TRACKS, MAX_DECOYS, MAX_ENEMY_TORPEDOES,
MAX_OPZ_TRACK_LABELS, MAX_SAVED_ASMS, MAX_SAVED_ENTITIES,
MAX_SAVED_ESSMS, MAX_SAVED_PLAYER_TORPEDOES,
@@ -583,6 +583,7 @@ class Game(PicturesMixin, OperatorMixin, DrawMixin, MissionBridgeMixin, EventMix
self.lookout_range_nm = 12.0 # bridge lookout page scale (UI only)
self.lookout_glasses = False # binoculars over the chart (UI only)
self.lookout_glasses_rel = 0.0 # their line of sight off the bow
self.lookout_optics = optics.lookout_glasses() # tilt, zoom, stabilizer (UI only)
self.helo_acoustic_page = 1
self.sonar_harmonic_hz = None
# Operator LOFAR/DEMON tools: cursor, marks, integration (UI only).
+4
View File
@@ -974,6 +974,10 @@ class EventMixin:
self._cycle_radar_range(
1 if e.key == pygame.K_PAGEUP else -1)
return
# The raised binoculars take ↑/↓ (tilt), Q/E (zoom) and Space
# (stabilizer) from the telegraph and the covered chart.
if self.lookout_glasses_shown() and self._lookout_optics_key(e):
return
if e.key in (pygame.K_UP, pygame.K_DOWN):
if self.station is Station.DAMAGE:
self.dmg_team = (self.dmg_team - 1 +
+6
View File
@@ -16,6 +16,7 @@ from src.physics import torpedo_dyn
from src.air import helicopter as helicopter_physics
from src.core.station import Station
from src.core import opfor
from src.core.optics import optics_key
from src.core.limits import MAX_DECOYS
from src.sonar import analysis_tools
from src.sonar import tma_operator
@@ -882,6 +883,11 @@ class OperatorMixin:
"""Train the binoculars relative to the bow (presentation only)."""
self.lookout_glasses_rel = (self.lookout_glasses_rel + delta_deg) % 360.0
def _lookout_optics_key(self, event) -> bool:
"""Tilt, zoom or stabilize the raised binoculars; True if the key was
theirs (presentation only)."""
return optics_key(self, self.lookout_optics, event.key, getattr(event, "mod", 0))
def _train_lookout_glasses_to(self, bearing: float) -> None:
self.lookout_glasses_rel = (bearing - self.ship.course) % 360.0
+37 -6
View File
@@ -29,6 +29,7 @@ from src.core.limits import (
from src.sensors import radar as radar_physics
from src.sensors import visual as visual_physics
from src.sensors import lookout_id
from src.sensors import nav_lights
from src.sensors import threat_cue
from src.sensors import hfdf as hf_physics
from src.sonar import equation as sonar_equation
@@ -50,7 +51,7 @@ from src.sensors.esm import (
analyze_signal,
filter_and_sort_tracks)
from src.sensors.platform import exchange_friendly_datalink, snapshot_observation
from src.sonar.sonar import TowState
from src.sonar.sonar import TowState, hull_length_m
from src.ui import layout
from src.ui.splash_view import SPLASH_PING_PERIOD_S
from src.air.asm import ASM
@@ -1404,6 +1405,9 @@ class SimMixin:
self.lookout_reports: list[dict] = []
self._lookout_land_seen: set[int] = set()
self._lookout_land_epoch: int | None = None
# Navigation lights the lookout made out, per track (never saved; the
# next observation restores them).
self._lookout_lights: dict[str, tuple] = {}
def _lookout_environment(self) -> dict:
return dict(
@@ -1414,7 +1418,7 @@ class SimMixin:
def _lookout_observe(self, actor, namespace: str, kind: str,
seed: int, altitude_m: float | None = None,
classes: tuple | None = None) -> None:
classes: tuple | None = None, lit: bool = False) -> None:
import random
dx, dy = actor.x - self.ship.x, actor.y - self.ship.y
@@ -1424,10 +1428,22 @@ class SimMixin:
alert = self.crew_effect()
margin = alert * LOOKOUT_MODEL.margin(kind, distance, altitude_m=altitude_m,
**environment)
bearing = math.degrees(math.atan2(dx, -dy)) % 360.0
lights = None
if lit and kind == "FLG":
lights = nav_lights.aircraft_code(actor.course, bearing, distance,
environment["visibility_nm"])
elif lit:
lights = nav_lights.code(actor.course, bearing, distance, hull_length_m(actor),
environment["visibility_nm"],
nav_lights.duty(getattr(actor, "profile", None)))
# Navigation lights in range are seen even where the dark hull is not
# (a bare sighting; the class still needs the silhouette).
if lights is not None:
margin = max(margin, 1.0)
if (margin < 1.0 or self.world.land_blocks_line(
self.ship.x, self.ship.y, actor.x, actor.y)):
return
bearing = math.degrees(math.atan2(dx, -dy)) % 360.0
epoch = math.floor((self.sim_t + 1e-9) / config.LOOKOUT_EPOCH_S)
rng = random.Random(seed * 65537 + epoch * 104729 + 0x4C4F4F4B)
measured_bearing = (bearing + rng.uniform(
@@ -1474,6 +1490,10 @@ class SimMixin:
quality=quality, now=self.sim_t, label=label,
bearing_uncertainty_deg=(config.LOOKOUT_BEARING_ERR_DEG
/ math.sqrt(3.0)))
if lights is None:
self._lookout_lights.pop(track_id, None)
else:
self._lookout_lights[track_id] = (lights, self.sim_t)
# One report per new sighting and per step up in recognition; a call
# inside the same measurement epoch leaves the track unchanged.
if level > previous_level and track.label == label:
@@ -1545,24 +1565,35 @@ class SimMixin:
self._lookout_observe(torpedo, "torpedo-wake", "TORP",
torpedo.id, classes=("TORPEDO_WAKE",
"TORPEDO_WAKE", None))
# Neutral traffic runs its navigation lights; warships run darkened.
lit = nav_lights.lit(self.world.daylight_stage(),
getattr(self.world, "visibility_nm",
config.WEATHER_VISIBILITY_MAX_NM))
civilians = {id(actor) for actor in self.civilians}
for actor in sorted(self.civilians + self.warships,
key=lambda item: item.id):
if not actor.sunk:
self._lookout_observe(
actor, "surface", "SURFACE", actor.sensor_seed,
classes=lookout_id.surface_classes(getattr(actor, "profile", None)))
classes=lookout_id.surface_classes(getattr(actor, "profile", None)),
lit=lit and id(actor) in civilians)
self._lookout_lights = {key: value for key, value in self._lookout_lights.items()
if self.sim_t - value[1] <= config.LOOKOUT_EPOCH_S * 2}
for actor in sorted(self.subs, key=lambda item: item.id):
if (not actor.sunk and actor.state != "SINKING"
and actor.depth <= config.LOOKOUT_SUB_SURFACED_MAX_DEPTH_M):
self._lookout_observe(actor, "sub", "SUB", actor.sensor_seed,
classes=("SUBMARINE", "SUBMARINE", None))
# Civil aircraft show their position and anti-collision lights;
# military aircraft fly dark.
for actor in sorted(self.flights.flights, key=lambda item: item.seq):
if actor.active:
self._lookout_observe(
actor, "flight", "FLG", actor.sensor_seed + 200_000,
altitude_m=actor.altitude_m,
classes=lookout_id.aircraft_classes(
getattr(actor, "kind", "military"), getattr(actor, "akey", None)))
getattr(actor, "kind", "military"), getattr(actor, "akey", None)),
lit=lit and getattr(actor, "kind", "military") == "civil")
for actor in sorted(self.raiders, key=lambda item: item.seq):
if not actor.despawned and actor.hp > 0:
self._lookout_observe(
@@ -1576,7 +1607,7 @@ class SimMixin:
actor, "live_air", "FLG", actor.seq + 800_000,
altitude_m=getattr(actor, "altitude_m", 0.0),
# Indistinguishable from simulated civil traffic.
classes=lookout_id.aircraft_classes("civil", None))
classes=lookout_id.aircraft_classes("civil", None), lit=lit)
self._update_lookout_land()
def _update_air_picture(self, full_scan: bool = False) -> None:
+2
View File
@@ -49,6 +49,7 @@ STATION_HELP = {
("+ / -", "help.control.engine_order"), ("help.key.chart", "help.control.mouse_map"),
("Q / E", "help.control.zoom"), ("K", "help.control.follow"),
(", / .", "help.bridge.lookout_range"), ("B", "help.bridge.lookout_glasses"),
("↑/↓ · Q/E · Space", "help.bridge.glasses_optics"),
("G", "help.control.action_stations")],
["help.note.bridge_noise", "help.note.bridge_coast", "help.note.crew"],
"help.note.bridge_tactic"),
@@ -254,6 +255,7 @@ _UBOOT_HELP = (
("help.key.left_right", "help.uboot.esm_classify"),
("help.key.enter", "help.uboot.esm_plot"),
("help.key.left_right", "help.uboot.scope_turn"),
("↑/↓ · , / . · Space", "help.uboot.scope_optics"),
("help.key.enter", "help.uboot.stadimeter"),
("help.key.uboot_fire", "help.uboot.scope_fire"),
("+ / -", "help.uboot.telegraph"),
+28 -3
View File
@@ -23,6 +23,8 @@ from src.core.i18n import message
from src.core.plot import PlotLayer
from src.physics import torpedo_dyn
from src.sensors import lookout_id
from src.sensors import nav_lights
from src.core import optics
from src.sensors import visual as visual_physics
from src.sensors.platform import MAST_DEPTH_M
from src.sonar.platforms import (OWNSHIP_SIGNATURE_KEY, OWNSHIP_TARGET_ID,
@@ -105,6 +107,9 @@ class CrewOrders:
self.scope_rel_deg = 0.0
self.sightings = []
self._sightings_seen = set()
# Navigation lights made out per sighting (never saved; the next
# look restores them).
self._lights = {}
# Attack computer: stadimeter marks by sighting (``attack_computer``).
self.tdc = {}
# Flood state of each torpedo tube, ``[state, seconds left]`` with the
@@ -274,6 +279,9 @@ class CrewedBoat:
self.sub_id = sub.id
self.orders = CrewOrders()
sub.crew = self.orders
# The uConsole's eyepiece settings: tilt, power, stabilizer (display
# only, never saved; each browser keeps its own).
self.scope_optics = optics.periscope()
# The crew takes over with the loaded tubes flooded, ready to fire.
battery = sub.weapon_battery
self.orders.tubes = ([["flooded" if tube.loaded_weapon_key is not None else "dry", 0.0]
@@ -704,7 +712,9 @@ def horizon_motion(game, boat) -> tuple:
see (display only, deterministic in sim time)."""
from src.ui.horizon import horizon_motion as motion
sea_state = getattr(game.world, "effective_sea_state", game.world.sea_state)
return motion(int(boat.sub.id), game.sim_t, sea_state)
wind_from = game.world.weather_values()["wind_from_deg"]
return motion(int(boat.sub.id), game.sim_t, sea_state,
wind_from - boat.sub.course, boat.orders.scope_rel_deg)
def _frigate_length_m(game) -> float:
@@ -754,6 +764,7 @@ def update_sightings(game, boat: CrewedBoat) -> None:
if not scope_available(boat):
orders.sightings = []
orders._sightings_seen.clear()
orders._lights = {}
return
now = game.sim_t
seed = int(sub.sensor_seed)
@@ -763,6 +774,9 @@ def update_sightings(game, boat: CrewedBoat) -> None:
rows = []
# A tired watch on the periscope needs more contrast (1.0 when fresh).
alert = boat.watch.effectiveness(game.sim_t)
# Neutral traffic runs its navigation lights; warships run darkened.
lit = nav_lights.lit(game.world.daylight_stage(), environment["visibility_nm"])
lights = {}
for target_id, actor, cls, length_m, altitude_m in _scope_candidates(game, boat):
dx, dy = actor.x - sub.x, actor.y - sub.y
distance = math.hypot(dx, dy)
@@ -770,6 +784,16 @@ def update_sightings(game, boat: CrewedBoat) -> None:
margin = alert * _SCOPE_MODEL.margin(kind, distance, altitude_m=altitude_m,
eye_m=config.UBOOT_SCOPE_EYE_HEIGHT_M,
**environment)
true_bearing = math.degrees(math.atan2(dx, -dy)) % 360.0
course = getattr(actor, "course", None)
code = (nav_lights.code(course, true_bearing, distance, length_m,
environment["visibility_nm"],
nav_lights.duty(getattr(actor, "profile", None)))
if lit and cls == "merchant" and course is not None else None)
# Navigation lights in range are seen even where the dark hull is not
# (a bare sighting; the class still needs the silhouette).
if code is not None:
margin = max(margin, 1.0)
if margin < 1.0 or game.world.land_blocks_line(sub.x, sub.y, actor.x, actor.y):
continue
recognized = cls
@@ -780,17 +804,17 @@ def update_sightings(game, boat: CrewedBoat) -> None:
/ lookout_id.CLASS_SIZE[_RECOGNIZE_CLASS[cls]],
**environment) * alert < 1.0:
recognized = "unknown"
true_bearing = math.degrees(math.atan2(dx, -dy)) % 360.0
error = (0.7 * detrand.normal(seed, "scope-bias", target_id)
+ 0.3 * detrand.normal(seed, "scope-jitter", target_id, epoch))
bearing = (true_bearing + error * config.UBOOT_SCOPE_BEARING_ERR_DEG) % 360.0
course = getattr(actor, "course", None)
aspect = (1.0 if course is None
else max(0.2, abs(math.sin(math.radians(course - true_bearing)))))
span = math.degrees(length_m * aspect / max(distance * 1852.0, length_m))
span *= 1.0 + 0.05 * detrand.normal(seed, "scope-span", target_id, epoch)
quality = config.clamp(.5 + .45 * (1.0 - 1.0 / margin), .5, .95)
ref = "V-%08X" % (detrand.bits(seed, "scope-ref", target_id) & 0xFFFFFFFF)
if code is not None:
lights[ref] = code
old = previous.get(ref)
if old is not None and recognized == "unknown" and old["cls"] != "unknown":
recognized = old["cls"] # a class once made out is held
@@ -811,6 +835,7 @@ def update_sightings(game, boat: CrewedBoat) -> None:
row["range_nm"] = row["range_sigma_nm"] = row["range_t"] = None
rows.sort(key=lambda row: (row["bearing"], row["ref"]))
orders.sightings = rows[:config.UBOOT_SIGHTINGS_MAX]
orders._lights = lights
for row in orders.sightings:
if row["ref"] not in orders._sightings_seen and row["t"] == now:
orders._sightings_seen.add(row["ref"])
+80
View File
@@ -0,0 +1,80 @@
"""Display settings of the lookout's binoculars and the periscope's
eyepiece: elevation, magnification and the horizon stabilizer.
Presentation only: the settings change the picture, never what the optics
detect (the sightings come from the contrast model), and are not saved.
"""
from __future__ import annotations
from src.core import config
class Optics:
"""Elevation (degrees, up positive), a magnification step and whether
the stabilizer takes out the hull's motion."""
def __init__(self, fov_deg: float, powers: tuple, elevation: tuple):
self.base_fov_deg = float(fov_deg)
self.powers = tuple(float(power) for power in powers)
self.elevation_min, self.elevation_max = elevation
self.reset()
def reset(self) -> None:
self.elevation_deg = 0.0
self.power_index = 0
self.stabilized = False
@property
def power(self) -> float:
return self.powers[self.power_index]
@property
def fov_deg(self) -> float:
return self.base_fov_deg / self.power
def tilt(self, delta_deg: float) -> None:
self.elevation_deg = config.clamp(self.elevation_deg + delta_deg,
self.elevation_min, self.elevation_max)
def zoom(self, delta: int) -> None:
self.power_index = max(0, min(len(self.powers) - 1, self.power_index + delta))
def toggle_stabilizer(self) -> None:
self.stabilized = not self.stabilized
def lookout_glasses() -> Optics:
return Optics(config.LOOKOUT_GLASSES_FOV_DEG, config.LOOKOUT_GLASSES_POWERS,
config.LOOKOUT_GLASSES_ELEVATION_DEG)
def periscope() -> Optics:
return Optics(config.UBOOT_SCOPE_FOV_DEG, config.UBOOT_SCOPE_POWERS,
config.UBOOT_SCOPE_ELEVATION_DEG)
def optics_key(game, sight: Optics, key: int, mods: int, zoom_keys=None) -> bool:
"""↑/↓ tilt (Shift: fast), ``zoom_keys`` (out, in; default Q/E) the
magnification, Space the stabilizer; True when the key was the optics'.
Reports the new setting in the flash."""
import pygame
from src.core.i18n import message
zoom_out, zoom_in = zoom_keys or (pygame.K_q, pygame.K_e)
if key in (pygame.K_UP, pygame.K_DOWN):
step = (config.SIGHT_TILT_STEP_FAST_DEG if mods & pygame.KMOD_SHIFT
else config.SIGHT_TILT_STEP_DEG)
sight.tilt(step if key == pygame.K_UP else -step)
game.flash(message("runtime.optics.elevation",
elevation=f"{sight.elevation_deg:+.0f}"), 1.0)
elif key in (zoom_out, zoom_in):
sight.zoom(1 if key == zoom_in else -1)
game.flash(message("runtime.optics.zoom", fov=f"{sight.fov_deg:.0f}",
power=f"{sight.power:g}"), 1.0)
elif key == pygame.K_SPACE:
sight.toggle_stabilizer()
game.flash(message("runtime.optics.stabilizer_on" if sight.stabilized
else "runtime.optics.stabilizer_off"), 1.0)
else:
return False
return True
+6
View File
@@ -519,6 +519,7 @@ def _key_action(key, mods):
def _command_key(game, current, key, mods) -> None:
from src.core.optics import optics_key
sub = current.sub
from src.ui import uboot_view
page = uboot_view.page_name(game, current)
@@ -532,6 +533,11 @@ def _command_key(game, current, key, mods) -> None:
pages = uboot_view.station_pages(local_station(game))
current.command_page = (current.command_page
+ (-1 if key == pygame.K_PAGEUP else 1)) % len(pages)
elif page == "UBOOT_SCOPE" and key in (pygame.K_UP, pygame.K_DOWN, pygame.K_COMMA,
pygame.K_PERIOD, pygame.K_SPACE):
# The eyepiece: tilt, low/high power (, / .; Q/E stay the chart's).
optics_key(game, current.scope_optics, key, mods,
zoom_keys=(pygame.K_COMMA, pygame.K_PERIOD))
elif page == "UBOOT_SCOPE" and key in (pygame.K_LEFT, pygame.K_RIGHT):
if order_allowed(game, "uboot_scope_bearing"):
step = (config.UBOOT_SCOPE_STEP_FAST_DEG if mods & pygame.KMOD_SHIFT
+1 -1
View File
@@ -4,7 +4,7 @@ This module is deliberately dependency-free because setuptools imports the
version while building the project.
"""
APP_VERSION = "1.3.41"
APP_VERSION = "1.3.45"
SAVE_VERSION = 27
SAVE_SCHEMA = "u-jagd-save-v27"
SPLASH_TEXT = (
+117
View File
@@ -0,0 +1,117 @@
"""Navigation lights an observer makes out on a vessel (COLREG rules 20-29).
Pure sensor generation: the caller passes the vessel's true course and the
geometry, the result is a short detached code the views draw, never the
course itself. A power-driven vessel shows a white masthead light over
225 degrees ahead (two from 50 m length, the aft one higher), a green
starboard and a red port side light over 112.5 degrees from ahead on either
side, and a white stern light over the remaining 135 degrees astern.
Vessels at work add their all-round lights (``DUTY``): a trawler green over
white (rule 26, a masthead light only from 50 m), a pilot vessel on duty
white over red instead of masthead lights (rule 29), a vessel restricted in
her ability to manoeuvre (survey, cable laying, research) red, white, red
(rule 27b) and a mine clearance vessel three green (rule 27f).
Code ``"<facing><masthead><red><green><stern>[<all-round>]"``: facing
``L``/``R`` (bow to the left or right as seen), masthead ``0``/``1``/``2``,
then ``r``, ``g``, ``s`` or ``-`` each, then the all-round lights top down
(``GW``, ``WR``, ``RWR`` or ``GGG``). ``None`` when nothing is lit or in range.
An aircraft (``aircraft_code``, civil traffic only; military aircraft fly
dark) uses the same code: red left and green right wingtip lights over
110 degrees, the white tail light over the 140 degrees aft, and ``AC`` for
its anti-collision lights (flashing red beacons, white wingtip strobes),
which carry furthest.
"""
from __future__ import annotations
import re
# Rule 22 ranges (NM): (length from, masthead, side, stern, all-round).
_RANGES = ((50.0, 6.0, 3.0, 3.0, 3.0), (12.0, 5.0, 2.0, 2.0, 2.0),
(0.0, 2.0, 1.0, 2.0, 2.0))
SIDE_ARC_DEG = 112.5
# Both side lights show within this angle of dead ahead (cut-off tolerance).
HEAD_ON_DEG = 3.0
# Catalog entries at work and the lights their work adds (top down).
DUTY = {
"aux_07": "GW", # fishing trawler, trawling
"aux_10": "WR", # pilot vessel on duty
"aux_04": "RWR", # research vessel: restricted in ability to manoeuvre
"aux_05": "RWR", # cable layer
"aux_08": "RWR", # survey vessel
"aux_01": "GGG", # mine clearance
}
ALL_ROUND = ("GW", "WR", "RWR", "GGG")
CODE_RE = re.compile(r"^[LR][012][r-][g-][s-](GW|WR|RWR|GGG|AC)?$")
# Aircraft position lights (CS/FAR 25.1387): wingtip lights over 110
# degrees either side, the tail light over the rest; ranges (NM) assumed
# for the eye: position lights 3, anti-collision lights 10.
AIRCRAFT_WING_ARC_DEG = 110.0
AIRCRAFT_NAV_NM = 3.0
AIRCRAFT_ANTI_COLLISION_NM = 10.0
def lit(stage: str, visibility_nm: float) -> bool:
"""Lights are shown from sunset to sunrise and in restricted visibility."""
return stage != "day" or visibility_nm < 2.0
def duty(profile) -> str | None:
"""The all-round lights a catalog vessel's work adds, or ``None``."""
return DUTY.get(str(getattr(profile, "key", "")))
def code(course_deg: float, bearing_from_observer_deg: float, distance_nm: float,
length_m: float, visibility_nm: float, work: str | None = None) -> str | None:
"""The lights visible from the observer, or ``None``."""
masthead_nm, side_nm, stern_nm, round_nm = next(
row[1:] for row in _RANGES if length_m >= row[0])
reach = max(0.0, float(visibility_nm))
# Angle of the observer off the vessel's bow, clockwise (starboard).
rel = ((bearing_from_observer_deg + 180.0) - course_deg) % 360.0
off = rel if rel <= 180.0 else rel - 360.0
masts = 0
if abs(off) <= SIDE_ARC_DEG and distance_nm <= min(masthead_nm, reach):
masts = 2 if length_m >= 50.0 else 1
if work == "WR":
masts = 0 # a pilot vessel's white over red instead
elif work == "GW":
masts = 1 if length_m >= 50.0 else 0 # abaft and above the green
side = distance_nm <= min(side_nm, reach)
green = side and -HEAD_ON_DEG <= off <= SIDE_ARC_DEG
red = side and -SIDE_ARC_DEG <= off <= HEAD_ON_DEG
stern = abs(off) >= SIDE_ARC_DEG and distance_nm <= min(stern_nm, reach)
round_lights = work if work in ALL_ROUND and distance_nm <= min(round_nm, reach) else ""
if not (masts or red or green or stern or round_lights):
return None
# Seen from starboard the bow points to the observer's right.
facing = "R" if off >= 0.0 else "L"
return "%s%d%s%s%s%s" % (facing, masts, "r" if red else "-", "g" if green else "-",
"s" if stern else "-", round_lights)
def aircraft_code(course_deg: float, bearing_from_observer_deg: float, distance_nm: float,
visibility_nm: float) -> str | None:
"""The lights a civil aircraft shows the observer, or ``None``."""
reach = max(0.0, float(visibility_nm))
if distance_nm > min(AIRCRAFT_ANTI_COLLISION_NM, reach):
return None
rel = ((bearing_from_observer_deg + 180.0) - course_deg) % 360.0
off = rel if rel <= 180.0 else rel - 360.0
near = distance_nm <= min(AIRCRAFT_NAV_NM, reach)
green = near and -HEAD_ON_DEG <= off <= AIRCRAFT_WING_ARC_DEG
red = near and -AIRCRAFT_WING_ARC_DEG <= off <= HEAD_ON_DEG
tail = near and abs(off) >= AIRCRAFT_WING_ARC_DEG
return "%s0%s%s%sAC" % ("R" if off >= 0.0 else "L", "r" if red else "-",
"g" if green else "-", "s" if tail else "-")
def valid(value) -> bool:
return value is None or (isinstance(value, str) and CODE_RE.match(value) is not None)
def facing(value: str | None) -> int:
"""Silhouette facing for a code: +1 bow right, -1 bow left (default)."""
return 1 if value and value[0] == "R" else -1
+65 -15
View File
@@ -14,8 +14,9 @@ import numpy as np
import pygame
from src.core import config
from src.core.i18n import raw_text
from src.core.i18n import message, raw_text
from src.physics import ship_dynamics
from src.sensors import nav_lights
from src.ui import layout, sight_scene, silhouettes
SCALE_COLOR = (170, 232, 208)
@@ -23,6 +24,8 @@ CROSSHAIR_COLOR = (120, 214, 180)
SCALE_LABEL_MIN_PX = 36
# Horizon motion: px per rad of wave slope, bounded.
MOTION_PX_PER_RAD = 260.0
# A stabilized binocular or periscope keeps this share of the hull motion.
STABILIZED_RESIDUAL = 0.12
# Charted coast on the horizon: rays per full circle, the observer's move that
# re-casts them, the bounded cache, and the assumed coastal heights (m; the
# chart has no elevation, so hills vary smoothly along the coast).
@@ -147,17 +150,47 @@ def blend(a, b, t: float) -> tuple:
return tuple(int(x + (y - x) * t) for x, y in zip(a, b))
def horizon_motion(seed: int, sim_t: float, sea_state: float) -> tuple:
def hull_motion(seed: int, sim_t: float, sea_state: float,
sea_rel_deg: float | None = None) -> tuple:
"""(pitch, roll) wave slopes in rad of a hull ``sea_rel_deg`` off the sea
(the direction the waves come from, relative to the bow): head or
following seas make her pitch, beam seas roll (display only,
deterministic in sim time)."""
pitch = ship_dynamics.wave_slope_rad(int(seed), sim_t, sea_state)
if sea_rel_deg is None:
return pitch, pitch
# The roll answers the same sea more slowly (longer natural period).
roll = ship_dynamics.wave_slope_rad(int(seed) + 1, sim_t * 0.7, sea_state)
angle = math.radians(sea_rel_deg)
return (pitch * (0.35 + 0.65 * abs(math.cos(angle))),
roll * (0.3 + 1.2 * abs(math.sin(angle))))
def view_motion(pitch: float, roll: float, look_rel_deg: float = 0.0) -> tuple:
"""(vertical offset px, tilt rad) of the horizon seen ``look_rel_deg``
off the bow: ahead the pitch lifts it and the roll tilts it, abeam the
other way round."""
look = math.radians(look_rel_deg)
lift = pitch * math.cos(look) + roll * math.sin(look)
lean = roll * math.cos(look) - pitch * math.sin(look)
return (config.clamp(lift * MOTION_PX_PER_RAD, -40.0, 40.0),
config.clamp(lean * 0.6, -0.25, 0.25))
def horizon_motion(seed: int, sim_t: float, sea_state: float,
sea_rel_deg: float | None = None, look_rel_deg: float = 0.0) -> tuple:
"""(vertical offset px, tilt rad) of the horizon from the wave slope at
``seed`` (display only, deterministic in sim time)."""
slope = ship_dynamics.wave_slope_rad(int(seed), sim_t, sea_state)
offset = config.clamp(slope * MOTION_PX_PER_RAD, -40.0, 40.0)
tilt = config.clamp(slope * 0.6, -0.25, 0.25)
return offset, tilt
``seed`` (display only, deterministic in sim time); with ``sea_rel_deg``
the hull pitches and rolls by her heading to the sea."""
if sea_rel_deg is None:
slope = ship_dynamics.wave_slope_rad(int(seed), sim_t, sea_state)
return (config.clamp(slope * MOTION_PX_PER_RAD, -40.0, 40.0),
config.clamp(slope * 0.6, -0.25, 0.25))
return view_motion(*hull_motion(seed, sim_t, sea_state, sea_rel_deg), look_rel_deg)
def draw_outline(s, cls: str, cx: int, base_y: int, width: int, color,
t: float = 0.0, *, rim=None, lights=None) -> None:
t: float = 0.0, *, rim=None, lights=None, nav=None) -> None:
"""Procedural side view of a coarse class, ``width`` px long, sitting on
the horizon (aircraft: hovering above it). ``t`` (display clock)
animates pitch, radar, rotor and wake."""
@@ -168,23 +201,31 @@ def draw_outline(s, cls: str, cx: int, base_y: int, width: int, color,
max(1, min(3, width // 12)))
return
silhouettes.draw_profile(s, cls if cls in silhouettes.PROFILES else "unknown",
cx, base_y, width, color, t=t, rim=rim, lights=lights)
cx, base_y, width, color, t=t, rim=rim, lights=lights,
facing=nav_lights.facing(nav), nav=nav)
def draw_horizon(s, rect, *, line_of_sight: float, fov_deg: float, night: bool,
visibility_nm: float, motion: tuple, outlines, crosshair_deg=None,
land=None, anim_t: float = 0.0, sky=None, sea_state: float = 2.0) -> None:
land=None, anim_t: float = 0.0, sky=None, sea_state: float = 2.0,
elevation_deg: float = 0.0, stabilized: bool = False,
optics_label=None) -> None:
"""The picture in the eyepiece or binoculars in the start screen's look:
sky with stars, moon or sun and clouds, the sea in motion, the charted
coast, the outlines within the field in steel with a lit rim, rain, snow
or fog, the true-bearing scale, an optional crosshair with its measuring
window (half width in degrees) and the corner brackets. ``sky`` is a
``sight_scene.sky_values`` dict; without one a clear noon or midnight."""
``sight_scene.sky_values`` dict; without one a clear noon or midnight.
``elevation_deg`` tilts the optics up (positive) or down; ``stabilized``
takes out all but ``STABILIZED_RESIDUAL`` of the hull's motion."""
rect = pygame.Rect(rect)
sky = sky if sky is not None else sight_scene.plain_sky(night)
offset, tilt = motion
horizon = rect.y + int(rect.h * 0.5 + offset)
view = sight_scene.View(rect, line_of_sight, fov_deg, horizon, tilt)
if stabilized:
offset, tilt = offset * STABILIZED_RESIDUAL, tilt * STABILIZED_RESIDUAL
lift = elevation_deg * rect.w / fov_deg
horizon = rect.y + int(rect.h * 0.5 + offset + lift)
view = sight_scene.View(rect, line_of_sight, fov_deg, horizon, tilt, lift)
with layout.clip_to(s, rect):
colors = sight_scene.draw_scene(s, view, sky, visibility_nm=visibility_nm,
sea_state=sea_state, t=anim_t)
@@ -196,7 +237,9 @@ def draw_horizon(s, rect, *, line_of_sight: float, fov_deg: float, night: bool,
visibility_nm=visibility_nm, haze_color=haze_color, colors=colors)
px_per_deg = rect.w / fov_deg
lit = sky["light"] < 0.45
for bearing, span_deg, cls, stale in outlines:
for row in outlines:
bearing, span_deg, cls, stale = row[:4]
nav = row[4] if len(row) > 4 else None
off = relative_offset(bearing, line_of_sight)
if abs(off) > fov_deg / 2 + span_deg / 2:
continue
@@ -206,7 +249,8 @@ def draw_horizon(s, rect, *, line_of_sight: float, fov_deg: float, night: bool,
fade = 0.55 if stale else haze * 0.6
draw_outline(s, cls, cx, base, width, blend(colors["steel"], haze_color, fade),
anim_t, rim=blend(colors["rim"], haze_color, fade),
lights=(sight_scene.WINDOW_LIGHT if lit and not stale else None))
lights=(sight_scene.WINDOW_LIGHT if lit and not stale else None),
nav=nav)
sight_scene.draw_weather(s, view, sky, colors, visibility_nm=visibility_nm, t=anim_t)
# Labels at least ``SCALE_LABEL_MIN_PX`` apart (the narrow lookout
# strip labels every 30 degrees, the eyepieces every 10).
@@ -234,4 +278,10 @@ def draw_horizon(s, rect, *, line_of_sight: float, fov_deg: float, night: bool,
for mark in (-1, 1):
x = rect.centerx + mark * window
pygame.draw.line(s, CROSSHAIR_COLOR, (x, rect.centery - 4), (x, rect.centery + 4), 1)
if stabilized and rect.h >= 60:
layout.blit_line(s, message("sight.stabilized"),
(rect.x + 10, rect.bottom - 22, 80, 16), CROSSHAIR_COLOR, size=13)
if optics_label is not None and rect.h >= 60:
layout.blit_line(s, optics_label, (rect.right - 250, rect.bottom - 22, 240, 16),
CROSSHAIR_COLOR, size=13, align="right")
sight_scene.draw_frame(s, rect)
+50 -19
View File
@@ -202,12 +202,16 @@ def _wrap(bearing: float, line_of_sight: float) -> float:
class View:
"""Geometry of one eyepiece picture (screen px per degree, horizon)."""
def __init__(self, rect, line_of_sight, fov_deg, horizon, tilt):
def __init__(self, rect, line_of_sight, fov_deg, horizon, tilt, lift=0.0):
self.rect = pygame.Rect(rect)
self.los, self.fov = line_of_sight, fov_deg
self.px_per_deg = self.rect.w / fov_deg
self.horizon, self.tilt = horizon, tilt
self.sky_h = max(8, horizon - self.rect.y)
# The sky (stars, sun, moon, clouds) hangs on the eyepiece's nominal
# horizon, not on the one rolling with the sea: it stays still.
self.sky_h = max(8, self.rect.h // 2)
# Tilting the optics up moves the sky and the horizon down.
self.lift = float(lift)
def x(self, bearing: float) -> float:
return self.rect.centerx + _wrap(bearing, self.los) * self.px_per_deg
@@ -220,7 +224,7 @@ class View:
def alt_y(self, fraction: float, x: float) -> float:
"""Height ``fraction`` (0 horizon .. 1 top) of the eyepiece's sky."""
return self.base(x) - fraction * self.sky_h
return self.rect.y + self.rect.h / 2.0 + self.lift - fraction * self.sky_h
def _body_fraction(alt_deg: float) -> float:
@@ -311,14 +315,28 @@ def _draw_clouds(s, view, sky, colors, t, haze):
pygame.draw.ellipse(s, color, rect)
def sea_aspect(wind_from_deg: float, line_of_sight: float) -> tuple:
"""(head, cross) of the sea as seen: the waves run from where the wind
blows. ``head`` is 1 looking into the sea (crests come at the eye), -1
looking down-sea (their backs run away), ``cross`` is +1 when they run
from left to right across the picture."""
angle = math.radians(wind_from_deg - line_of_sight)
return math.cos(angle), -math.sin(angle)
def _draw_sea(s, view, sky, colors, sea_state, t, haze):
rect = view.rect
dy = math.tan(view.tilt) * rect.w / 2.0
left, right = view.horizon - dy, view.horizon + dy
amp = 0.6 + 0.35 * sea_state
step = max(6, rect.w // 60)
crest = [(x, view.base(x) + amp * math.sin(x * 0.045 + t * 1.6)
+ 0.6 * amp * math.sin(x * 0.013 - t * 0.9))
head, cross = sea_aspect(sky["wind_from_deg"], view.los)
# The pattern lies on the sea (bearing space), so it slides past as the
# line of sight turns; along the crests it runs with the swell.
anchor = view.los * view.px_per_deg
swell = cross * t * 14.0
crest = [(x, view.base(x) + amp * math.sin((x + anchor - swell) * 0.045 + t * 1.6 * abs(head))
+ 0.6 * amp * math.sin((x + anchor - swell) * 0.013 - t * 0.9))
for x in range(rect.x, rect.right + step, step)]
pygame.draw.polygon(s, colors["sea"][0], crest + [(rect.right, rect.bottom),
(rect.x, rect.bottom)])
@@ -328,25 +346,35 @@ def _draw_sea(s, view, sky, colors, sea_state, t, haze):
shade = _cached(_SHADE_CACHE, (rect.w, depth, colors["sea"][1]),
lambda: _shade((rect.w, depth), colors["sea"][1]))
s.blit(shade, (rect.x, top))
# Wave rows: denser toward the horizon, moving with the swell.
# Wave rows, denser toward the horizon. Looking into or down the sea the
# crests are long rows that come at the eye or run away from it; across
# the sea they are short, run sideways and lean with the perspective.
rows = 9
below = rect.bottom - view.horizon
for row in range(1, rows + 1):
along = abs(head)
roll = (t * 0.12 * head) % 1.0
for index in range(rows + 1):
row = index + roll
depth_px = below * (row / rows) ** 1.7
if depth_px < 3:
if depth_px < 3 or row > rows:
continue
spacing = 24 + row * 10
length = 6 + row * 3
offset = (t * (6 + row * 3)) % (2 * spacing)
spacing = int(24 + row * 10)
length = (6 + row * 3) * (0.55 + 1.1 * along)
lean = cross * (1 + row * 0.7) * (1.0 - along)
offset = (anchor + t * (6 + row * 3) * cross) % (2 * spacing)
shade = blend(colors["wave"], colors["sea"][1], row / (rows + 3))
# Down-sea the eye sees the waves' backs: fainter rows.
if head < 0:
shade = blend(shade, colors["sea"][1], 0.35 * -head)
for x in range(rect.x - 2 * spacing, rect.right, spacing):
if (x // spacing + row) % 2:
if (x // spacing + index) % 2:
continue
x0 = x + offset
x0 = x - offset
y0 = view.base(x0) + depth_px
pygame.draw.line(s, shade, (x0, y0), (x0 + length, y0), 1)
if sea_state >= 4 and ((x // spacing) * 7 + row) % 5 == 0:
pygame.draw.line(s, colors["crest"], (x0 + 2, y0 - 1), (x0 + length - 2, y0 - 1), 1)
pygame.draw.line(s, shade, (x0, y0), (x0 + length, y0 - lean), 1)
if sea_state >= 4 and ((x // spacing) * 7 + index) % 5 == 0:
pygame.draw.line(s, colors["crest"], (x0 + 2, y0 - 1),
(x0 + length - 2, y0 - 1 - lean), 1)
pygame.draw.lines(s, colors["crest"], False, crest, 1)
# Glitter under the moon or the sun.
light = sky["light"]
@@ -382,9 +410,12 @@ def draw_scene(s, view: View, sky: dict, *, visibility_nm: float, sea_state: flo
rect = view.rect
sky_img = _cached(_SKY_CACHE, (rect.w, rect.h, colors["sky"]),
lambda: _gradient((rect.w, rect.h), *colors["sky"]))
# The horizon moves: stretch the gradient so its bottom meets the horizon.
s.blit(sky_img, rect.topleft, (0, max(0, rect.h - max(8, int(view.horizon - rect.y) + 40)),
rect.w, rect.h))
# The sky stays still: its gradient meets the nominal horizon (moved by
# the optics' elevation); above it the zenith colour.
top = int(rect.y + view.sky_h + 40 + view.lift - rect.h)
if top > rect.y:
s.fill(colors["sky"][0], (rect.x, rect.y, rect.w, top - rect.y))
s.blit(sky_img, (rect.x, top))
_draw_stars(s, view, sky, colors, t, haze)
_draw_body(s, view, sky, colors, haze)
_draw_clouds(s, view, sky, colors, t, haze)
+78 -2
View File
@@ -65,6 +65,10 @@ _WARSHIP = {
"radar": (0.34, 0.24, 0.024),
"funnel_top": (0.51, 0.14),
"masthead": (0.34, 0.252),
# Navigation lights: both masthead lights on the enclosed mast (warships
# may deviate from the spacing, rule 1e), side lights on the bridge.
"nav": {"mast": [(0.30, 0.20), (0.34, 0.26)], "side": (0.27, 0.10),
"stern": (0.995, 0.040), "round": (0.34, 0.215)},
"pitch_deg": 0.8, "pitch_hz": 0.11, "wake": True,
}
@@ -88,6 +92,10 @@ _MERCHANT = {
"panels": [],
"funnel_top": (0.91, 0.19),
"masthead": (0.061, 0.142),
# Navigation lights: masthead lights (forward, aft and higher), side
# lights on the bridge wings, stern light.
"nav": {"mast": [(0.061, 0.150), (0.80, 0.215)], "side": (0.77, 0.166),
"stern": (0.995, 0.062), "round": (0.84, 0.25)},
"pitch_deg": 0.5, "pitch_hz": 0.07, "wake": True,
}
@@ -105,6 +113,8 @@ _UNKNOWN = {
"windows": [(0.22 + i * 0.03, 0.17) for i in range(5)],
"panels": [],
"masthead": (0.30, 0.365),
"nav": {"mast": [(0.30, 0.37), (0.89, 0.45)], "side": (0.20, 0.19),
"stern": (0.99, 0.075), "round": (0.30, 0.37)},
"pitch_deg": 1.6, "pitch_hz": 0.19, "wake": True,
}
@@ -121,6 +131,10 @@ _AIRCRAFT = {
"rotor": (0.31, 0.64, 0.48),
"tail_rotor": (0.985, 0.58, 0.06),
"masthead": (0.30, 0.47),
# Position lights on the cabin sides, tail light, anti-collision beacons
# on top and underneath, strobe on the tail fin.
"nav": {"mast": [], "side": (0.20, 0.555), "stern": (0.995, 0.585),
"beacon": [(0.36, 0.615), (0.30, 0.49)], "strobe": (0.975, 0.60)},
"hover": True, "pitch_deg": 2.0, "pitch_hz": 0.23, "wake": False,
}
@@ -218,14 +232,74 @@ def _draw_rotor(s, frame: _Frame, profile: dict, color, t: float) -> None:
(c[0] + r * math.cos(angle), c[1] + r * math.sin(angle)), 1)
# Navigation light colours: white masthead/stern, red port, green starboard.
NAV_LIGHT = {"white": (255, 246, 222), "red": (255, 74, 58), "green": (96, 255, 150)}
def anti_collision(t: float) -> tuple:
"""(beacon on, strobe on) at display time ``t``: a red beacon flash
every second, a white strobe double flash every 1.2 seconds."""
beacon = (t % 1.0) < 0.12
phase = t % 1.2
return beacon, phase < 0.06 or 0.18 <= phase < 0.24
def draw_nav_lights(s, cls: str, frame: _Frame, width: float, code: str,
t: float = 0.0) -> None:
"""The ``nav_lights`` code as points of light with a soft glow; drawn at
any size, since at night the lights are what the eye picks up first."""
nav = PROFILES.get(cls, _MERCHANT).get("nav") or _MERCHANT["nav"]
masts, red, green, stern = int(code[1]), code[2] == "r", code[3] == "g", code[4] == "s"
round_lights = code[5:]
nav = nav if round_lights != "AC" else PROFILES["aircraft"]["nav"]
core = max(1, min(3, int(width / 150)))
# A trawler's single masthead light stands abaft and above her green.
mast = nav["mast"][1:] if round_lights == "GW" else nav["mast"]
points = [(mast[i], "white") for i in range(masts)]
su, sv = nav["side"]
if red and green: # head on: both side lights, just apart
points += [((su - 0.004, sv), "red"), ((su + 0.004, sv), "green")]
elif red:
points.append(((su, sv), "red"))
elif green:
points.append(((su, sv), "green"))
if stern:
points.append((nav["stern"], "white"))
spots = [(frame.point(u, v), name) for (u, v), name in points]
if round_lights == "AC":
beacon, strobe = anti_collision(t)
if beacon:
spots += [(frame.point(u, v), "red") for u, v in nav["beacon"]]
if strobe:
spots.append((frame.point(*nav["strobe"]), "white"))
elif round_lights:
# All-round lights in a vertical line down the mast, at least a
# glow apart (mine clearance: one at the masthead, one each yardarm).
x, y = frame.point(*nav["round"])
step = max(core * 2 + 3, width * 0.02)
names = {"W": "white", "R": "red", "G": "green"}
if round_lights == "GGG":
spots += [((x, y - step), "green"), ((x - step, y), "green"),
((x + step, y), "green")]
else:
spots += [((x, y - step * (len(round_lights) - i)), names[letter])
for i, letter in enumerate(round_lights)]
for (x, y), name in spots:
color = NAV_LIGHT[name]
glow = tuple(int(c * 0.45) for c in color)
pygame.draw.circle(s, glow, (int(x), int(y)), core + 2)
pygame.draw.circle(s, color, (int(x), int(y)), core)
def draw_profile(s, cls: str, cx: float, base_y: float, width: float, color, *,
t: float = 0.0, facing: int = -1, rim=None, lights=None,
wake: bool = True) -> _Frame:
wake: bool = True, nav: str | None = None) -> _Frame:
"""Draw ``cls`` ``width`` px long on the waterline ``base_y``.
``t`` animates pitch, radar, rotors and the wake; ``rim`` outlines the
polygons (moonlit edges) and ``lights`` colours bridge windows, both only
when the silhouette is large enough to show them. Returns the frame.
when the silhouette is large enough to show them; ``nav`` is a
``nav_lights`` code of the navigation lights shown. Returns the frame.
"""
profile = PROFILES.get(cls, _UNKNOWN)
width = max(3.0, float(width))
@@ -263,4 +337,6 @@ def draw_profile(s, cls: str, cx: float, base_y: float, width: float, color, *,
pygame.draw.rect(s, lights, (int(x), int(y), size + 1, size))
if wake and profile.get("wake") and detail:
draw_wake(s, frame, width, t)
if nav is not None:
draw_nav_lights(s, cls, frame, width, nav, t)
return frame
+25 -13
View File
@@ -247,7 +247,8 @@ def draw_bridge_view(game, tr=None) -> None:
station_bottom = config.STATION_RECT[1] + config.STATION_RECT[3]
_shortcut_footer(s, (x, station_bottom - 26, w, 20), (
("←/→", "bridge.footer.course"),
("↑/↓", "bridge.footer.telegraph"),
("↑/↓", "bridge.footer.glasses_tilt" if game.lookout_glasses
else "bridge.footer.telegraph"),
(", / .", "bridge.footer.glasses_train" if game.lookout_glasses
else "bridge.footer.lookout_range"),
("B", "bridge.footer.glasses_close" if game.lookout_glasses
@@ -289,9 +290,11 @@ def _lookout_land(game):
def lookout_outlines(game, sightings) -> list:
"""Detached ``(bearing, span_deg, cls, stale)`` rows of the lookout's own
tracks: the class from his report, the size from the measured range."""
"""Detached ``(bearing, span_deg, cls, stale, lights)`` rows of the
lookout's own tracks: the class from his report, the size from the
measured range, the navigation lights he makes out (``nav_lights`` code)."""
from src.sensors import lookout_id
lit = getattr(game, "_lookout_lights", {})
rows = []
for track in sightings:
if track.bearing is None or track.range_nm is None or track.range_nm <= 0.0:
@@ -305,8 +308,10 @@ def lookout_outlines(game, sightings) -> list:
cls = "merchant"
span = math.degrees(_LOOKOUT_KIND_LENGTH_M.get(track.kind, 100.0)
/ max(track.range_nm * 1852.0, 1.0))
rows.append((track.bearing % 360.0, max(1e-3, min(180.0, span)), cls,
game.sim_t - track.last_seen > config.LOOKOUT_EPOCH_S * 2))
stale = game.sim_t - track.last_seen > config.LOOKOUT_EPOCH_S * 2
lights = lit.get(getattr(track, "track_id", None))
rows.append((track.bearing % 360.0, max(1e-3, min(180.0, span)), cls, stale,
lights[0] if lights is not None and not stale else None))
return rows
@@ -373,7 +378,8 @@ def _draw_bridge_lookout(game, s, area: pygame.Rect) -> None:
s, (ix, iy, iw, strip_h), line_of_sight=game.ship.course % 360.0,
fov_deg=LOOKOUT_HORIZON_FOV_DEG, night=night,
visibility_nm=weather["visibility_nm"],
motion=horizon.horizon_motion(0, game.sim_t, weather["sea_state"]),
motion=horizon.horizon_motion(0, game.sim_t, weather["sea_state"],
weather["wind_from_deg"] - game.ship.course),
outlines=lookout_outlines(game, sightings), land=_lookout_land(game),
anim_t=game.sim_t, sky=sight_scene.sky_state(game), sea_state=weather["sea_state"])
iy += strip_h + 6
@@ -442,16 +448,22 @@ def draw_lookout_glasses(game) -> None:
course = game.ship.course % 360.0
line_of_sight = (course + game.lookout_glasses_rel) % 360.0
land = _lookout_land(game)
sight = game.lookout_optics
fov = sight.fov_deg
horizon.draw_horizon(
s, eyepiece, line_of_sight=line_of_sight, fov_deg=config.LOOKOUT_GLASSES_FOV_DEG,
s, eyepiece, line_of_sight=line_of_sight, fov_deg=fov,
night=night, visibility_nm=weather["visibility_nm"],
motion=horizon.horizon_motion(0, game.sim_t, weather["sea_state"]),
motion=horizon.horizon_motion(0, game.sim_t, weather["sea_state"],
weather["wind_from_deg"] - course,
game.lookout_glasses_rel),
outlines=lookout_outlines(game, sightings), land=land, anim_t=game.sim_t,
sky=sight_scene.sky_state(game), sea_state=weather["sea_state"])
sky=sight_scene.sky_state(game), sea_state=weather["sea_state"],
elevation_deg=sight.elevation_deg, stabilized=sight.stabilized)
pygame.draw.rect(s, config.COLOR_SONAR_RING, eyepiece, 1)
layout.blit_line(s, structured_message(
"bridge.line.glasses_bearing", bearing=f"{line_of_sight:03.0f}",
relative=f"{game.lookout_glasses_rel:03.0f}"),
relative=f"{game.lookout_glasses_rel:03.0f}",
elevation=f"{sight.elevation_deg:+.0f}", fov=f"{fov:.0f}"),
(eyepiece.x, eyepiece.bottom + 8, eyepiece.w, 24), config.COLOR_TEXT, size=18)
# All-round panorama: the bow in the middle; each sighting as a tick at
# its measured bearing, the binoculars' field as a frame.
@@ -479,10 +491,10 @@ def draw_lookout_glasses(game) -> None:
px = _panorama_x(panorama, track.bearing % 360.0, course)
color = _LOOKOUT_KIND_COLORS.get(track.kind, config.COLOR_TEXT_DIM)
pygame.draw.line(s, color, (px, panorama.y + 12), (px, panorama.bottom - 12), 3)
half = config.LOOKOUT_GLASSES_FOV_DEG / 2.0
half = fov / 2.0
left = panorama.x + int((horizon.relative_offset(line_of_sight - half, course) + 180.0)
/ 360.0 * panorama.w)
width = max(4, int(config.LOOKOUT_GLASSES_FOV_DEG / 360.0 * panorama.w))
width = max(4, int(fov / 360.0 * panorama.w))
for start in {left, left - panorama.w, left + panorama.w}:
window = pygame.Rect(start, panorama.y + 2, width, panorama.h - 4).clip(panorama)
if window.w > 0:
@@ -499,7 +511,7 @@ def draw_lookout_glasses(game) -> None:
break
what = game.lookout_visual_what(track.label) or localize("bridge.line.glasses_unknown")
in_view = (abs(horizon.relative_offset(track.bearing, line_of_sight))
<= config.LOOKOUT_GLASSES_FOV_DEG / 2.0)
<= fov / 2.0)
layout.blit_line(s, structured_message(
"bridge.line.glasses_row", bearing=f"{track.bearing % 360.0:03.0f}", what=what,
range=f"{track.range_nm:.1f}" if track.range_nm is not None else "--"),
+17 -6
View File
@@ -30,16 +30,24 @@ def draw_silhouette(s, cls: str, cx: int, base_y: int, width: int, color) -> Non
def scope_outlines(game, boat) -> list:
"""Detached ``(bearing, span_deg, cls, stale)`` rows of the sightings."""
return [(row["bearing"], row["span_deg"], row["cls"], game.sim_t - row["t"] > 1.0)
for row in boat.orders.sightings]
"""Detached ``(bearing, span_deg, cls, stale, lights)`` rows of the
sightings (``lights``: the ``nav_lights`` code made out, if any)."""
lights = getattr(boat.orders, "_lights", {})
rows = []
for row in boat.orders.sightings:
stale = game.sim_t - row["t"] > 1.0
rows.append((row["bearing"], row["span_deg"], row["cls"], stale,
None if stale else lights.get(row["ref"])))
return rows
def draw_eyepiece(s, game, boat, rect) -> None:
"""The picture in the eyepiece: sky, sea, horizon in motion, bearing scale,
crosshair and the outlines of the boat's sightings within the field."""
crosshair and the outlines of the boat's sightings within the field,
at the eyepiece's tilt, power and stabilizer."""
sight = boat.scope_optics
draw_horizon(s, rect, line_of_sight=opfor.scope_bearing(boat),
fov_deg=config.UBOOT_SCOPE_FOV_DEG, night=game.world.is_night(),
fov_deg=sight.fov_deg, night=game.world.is_night(),
visibility_nm=getattr(game.world, "visibility_nm",
config.WEATHER_VISIBILITY_MAX_NM),
motion=opfor.horizon_motion(game, boat),
@@ -48,7 +56,10 @@ def draw_eyepiece(s, game, boat, rect) -> None:
land=land_view(game.world, boat.sub.x, boat.sub.y,
config.UBOOT_SCOPE_EYE_HEIGHT_M),
anim_t=game.sim_t, sky=sight_scene.sky_state(game),
sea_state=getattr(game.world, "effective_sea_state", game.world.sea_state))
sea_state=getattr(game.world, "effective_sea_state", game.world.sea_state),
elevation_deg=sight.elevation_deg, stabilized=sight.stabilized,
optics_label=message("sight.optics", elevation=f"{sight.elevation_deg:+.0f}",
fov=f"{sight.fov_deg:.0f}"))
def sighting_rows(game, boat) -> list:
+1 -1
View File
@@ -192,7 +192,7 @@ def test_the_projection_shows_the_radio_room_without_frigate_truth():
report = view["report"]
assert report is not None and report["age_s"] >= config.UBOOT_RADIO_REPORT_AGE_S[0]
assert (report["x"], report["y"]) != (game.ship.x, game.ship.y)
assert [row["kind"] for row in view["log"]] == ["broadcast"]
assert [row["type"] for row in view["log"]] == ["broadcast"]
assert json.loads(json.dumps(view)) == view
+28
View File
@@ -1,6 +1,7 @@
"""Browser contract of the bridge lookout's binoculars (Chromium)."""
import json
import math
import shutil
import subprocess
import sys
@@ -53,7 +54,24 @@ PROBE = r'''
await until(() => relative() === '010', () => `no 10 degree step: ${status()}`);
$('bridge-glasses-bow').click();
await until(() => relative() === '000', () => `not back to the bow: ${status()}`);
// Tilt, zoom and stabilizer stay in this browser.
document.querySelector('[data-optics="glasses"] [data-optics-tilt="2"]').click();
document.querySelector('[data-optics="glasses"] [data-optics-zoom="1"]').click();
const stabilizer = document.querySelector('[data-optics="glasses"] [data-optics-stabilizer]');
stabilizer.click();
if (stabilizer.getAttribute('aria-pressed') !== 'true') throw new Error('stabilizer not pressed');
await until(() => status().includes('+2°') && status().includes('8°'), () => `no optics in: ${status()}`);
document.querySelector('[data-optics="glasses"] [data-optics-zoom="-1"]').click();
document.querySelector('[data-optics="glasses"] [data-optics-tilt="-2"]').click();
const canvas = $('bridge-glasses-canvas');
// The neutral merchant crossing ahead shows its red port side light.
const redLight = () => {
const data = canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height).data;
for (let index = 0; index < data.length; index += 4)
if (data[index] > 220 && data[index + 1] < 110 && data[index + 2] < 100) return true;
return false;
};
await until(redLight, 'no port side light in the binoculars');
const pixels = canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height).data;
const colors = new Set();
for (let index = 0; index < pixels.length; index += 4 * 97)
@@ -77,6 +95,16 @@ def test_bridge_binoculars_train_in_the_browser(tmp_path, monkeypatch):
en, de = catalogs()
game = Game(seed=917, start_menu=False, audio_enabled=False, language="en")
game.world.hour = 23.0
# A neutral merchant 1 NM ahead crossing from right to left (port side).
merchant = game.civilians[0]
for other in game.civilians[1:] + game.warships:
other.x, other.y = game.ship.x + 60.0, game.ship.y + 60.0
ahead = math.radians(game.ship.course)
merchant.x = game.ship.x + math.sin(ahead)
merchant.y = game.ship.y - math.cos(ahead)
merchant.course = (game.ship.course - 90.0) % 360.0
merchant.speed = 0.0
game.world.land_blocks_line = lambda *args: False
console = game.commander
console.port = 0
console._translations = {
+2 -1
View File
@@ -24,7 +24,8 @@ from commander_fixtures import PLOT, WEATHER_STATION
# The bridge lookout's binoculars (clear night, nothing in sight).
LOOKOUT = dict(course=90.0, fov_deg=16.0, visibility_nm=30.0, sea_state=2.0,
horizon_offset=0.0, horizon_tilt=0.0, outlines=[],
horizon_offset=0.0, horizon_tilt=0.0, motion_pitch=0.0, motion_roll=0.0,
outlines=[],
sky=dict(light=0.0, dusk=0.0, cloud=0.25, precipitation="none", intensity=0.0,
wind_from_deg=270.0, sun_bearing=300.0, sun_alt_deg=-20.0,
moon_bearing=180.0, moon_alt_deg=30.0, moon_illumination=0.8,
+86
View File
@@ -0,0 +1,86 @@
"""No role state may carry a key the browser's validator forbids.
``validateV2State`` (data/commander/js/state/schema.js) walks every published
role state and rejects the whole snapshot when any object has one of its
forbidden keys; the client then freezes with "Host sends data this browser
cannot read". Before 1.3.44 four rows used ``kind`` (the submarine's radio log,
threat intercepts and evasion order, the frigate's HQ tasks), so the picture
froze as soon as one of those lists filled. These checks run without
Chromium, so a plain ``pytest`` catches the next such field.
"""
import json
import re
import sys
from pathlib import Path
from src.commander import projections
from src.commander.v2 import schema as web_schema
from src.core import config
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "tests"))
from test_boat_radio import BROADCAST, _antenna_up, _step # noqa: E402
from test_boat_threat import _ping_from # noqa: E402
from test_opfor_sub import _crewed # noqa: E402
def _forbidden() -> set:
text = (ROOT / "data/commander/js/state/schema.js").read_text(encoding="utf-8")
match = re.search(r"const forbidden = new Set\(\[([^\]]*)\]\)", text)
assert match, "validateV2State no longer declares its forbidden keys"
keys = set(re.findall(r'"([^"]+)"', match.group(1)))
assert "kind" in keys and "target_id" in keys
return keys
def _strings(value):
if isinstance(value, str):
yield value
elif isinstance(value, dict):
for key, item in value.items():
yield from _strings(key)
yield from _strings(item)
elif isinstance(value, (tuple, list, set, frozenset)):
for item in value:
yield from _strings(item)
def _forbidden_paths(value, forbidden, path="state"):
if isinstance(value, dict):
for key, item in value.items():
if key in forbidden:
yield f"{path}.{key}"
yield from _forbidden_paths(item, forbidden, f"{path}.{key}")
elif isinstance(value, list):
for index, item in enumerate(value):
yield from _forbidden_paths(item, forbidden, f"{path}[{index}]")
def test_no_web_schema_field_list_names_a_forbidden_key():
forbidden = _forbidden()
offenders = sorted(f"{name}: {text}" for name, value in vars(web_schema).items()
if name.isupper() and name.endswith("FIELDS")
for text in _strings(value) if text in forbidden)
assert offenders == []
def test_filled_radio_threat_and_task_rows_publish_no_forbidden_key():
forbidden = _forbidden()
game, server, bridge = _crewed(seed=61)
boat = game.opfor
_antenna_up(game, boat)
game.sim_t = BROADCAST + 1.0
_step(game, boat, game.sim_t + config.UBOOT_RADIO_COPY_S + 1.0)
_ping_from(game, boat, 120.0, 1.5)
assert game._offer_task() is not None
bridge.pump(game, server, now=10.0)
states = json.loads(json.dumps(server.v2_states, allow_nan=False))
boat_state = states["uboot"]["uboot"]
assert boat_state["radio"]["log"] and boat_state["threat"]["intercepts"]
assert boat_state["threat"]["plan"] is not None
assert states["radio"]["radio"]["tasks"]
assert projections._uboot_radio(game, boat)["log"][0]["type"] == "broadcast"
offenders = [path for role, state in states.items() if state is not None
for path in _forbidden_paths(state, forbidden, role)]
assert offenders == []
+221
View File
@@ -0,0 +1,221 @@
"""Navigation lights of neutral traffic in the periscope and the lookout's
binoculars (COLREG rules 21-23): which lights show from where, only at night
or in restricted visibility, only on neutral vessels, and drawn in colour."""
import math
import sys
from pathlib import Path
import pygame
import pytest
from src.commander import projections
from src.core import opfor
from src.sensors import nav_lights
from src.ui import horizon, sight_scene, uboot_scope
from src.ui.silhouettes import NAV_LIGHT
from src.ui.stations import bridge as bridge_view
sys.path.insert(0, str(Path(__file__).parent))
from test_uboot_scope import _clear, _crewed, _environment, _place_frigate, _scope_up # noqa: E402
@pytest.mark.parametrize("course, expected", [
(180.0, "R2rg-"), # head on: both side lights and both masthead lights
(90.0, "R2-g-"), # crossing left to right: starboard side, bow right
(270.0, "L2r--"), # crossing right to left: port side, bow left
(0.0, "R0--s"), # going away: the stern light only
(225.0, "L2r--"), # fine on the port bow
])
def test_lights_follow_the_arcs_of_the_rules(course, expected):
# The vessel is due north of the observer, 2 NM off, 120 m long.
assert nav_lights.code(course, 0.0, 2.0, 120.0, 10.0) == expected
assert nav_lights.valid(expected)
def test_ranges_length_and_visibility_limit_what_shows():
assert nav_lights.code(180.0, 0.0, 4.0, 120.0, 10.0) == "R2---" # side lights 3 NM
assert nav_lights.code(180.0, 0.0, 7.0, 120.0, 10.0) is None # masthead 6 NM
assert nav_lights.code(180.0, 0.0, 2.0, 30.0, 10.0) == "R1rg-" # one masthead light
assert nav_lights.code(180.0, 0.0, 2.0, 120.0, 1.5) is None # hidden in the haze
assert nav_lights.code(180.0, 0.0, 1.0, 120.0, 1.5) == "R2rg-"
assert nav_lights.lit("night", 10.0) and nav_lights.lit("dusk", 10.0)
assert nav_lights.lit("day", 1.0) and not nav_lights.lit("day", 10.0)
assert not nav_lights.valid("X2rg-") and not nav_lights.valid(3)
assert nav_lights.facing("L1r--") == -1 and nav_lights.facing("R1-g-") == 1
assert nav_lights.facing(None) == -1
@pytest.mark.parametrize("work, length, expected", [
("GW", 40.0, "R0-g-GW"), # trawling: green over white, no masthead light < 50 m
("GW", 80.0, "R1-g-GW"), # from 50 m one masthead light abaft and above
("WR", 20.0, "R0-g-WR"), # pilot on duty: white over red instead of masthead
("RWR", 90.0, "R2-g-RWR"), # restricted in her ability to manoeuvre
("GGG", 55.0, "R2-g-GGG"), # mine clearance
(None, 90.0, "R2-g-"), # a tug without a tow: an ordinary power-driven vessel
])
def test_vessels_at_work_add_their_all_round_lights(work, length, expected):
assert nav_lights.code(90.0, 0.0, 1.5, length, 10.0, work) == expected
assert nav_lights.valid(expected)
def test_catalog_duties_and_all_round_range():
from types import SimpleNamespace
assert nav_lights.duty(SimpleNamespace(key="aux_07")) == "GW"
assert nav_lights.duty(SimpleNamespace(key="aux_10")) == "WR"
assert nav_lights.duty(SimpleNamespace(key="aux_02")) is None # tug, no tow
assert nav_lights.duty(SimpleNamespace(key="tanker_01")) is None
assert nav_lights.duty(None) is None
# A 40 m trawler from astern: stern and all-round lights carry 2 NM.
assert nav_lights.code(0.0, 0.0, 2.5, 40.0, 10.0, "GW") is None
assert nav_lights.code(0.0, 0.0, 1.8, 40.0, 10.0, "GW") == "R0--sGW"
def _neutral_near(game, boat, distance_nm=1.5, bearing=0.0, course=90.0):
"""One neutral merchant in sight of the boat, every other ship far off."""
sub = boat.sub
_place_frigate(game, boat, 40.0)
for other in game.warships:
other.x, other.y = sub.x + 60.0, sub.y + 60.0
ship = game.civilians[0]
for other in game.civilians[1:]:
other.x, other.y = sub.x - 60.0, sub.y - 60.0
rad = math.radians(bearing)
ship.x = sub.x + distance_nm * math.sin(rad)
ship.y = sub.y - distance_nm * math.cos(rad)
ship.course = course
game.world.land_blocks_line = lambda *args: False
return ship
def test_the_periscope_sees_the_lights_of_neutral_traffic_at_night_only():
game, _server, _bridge = _crewed(seed=61)
boat = game.opfor
_scope_up(boat)
_clear(game, night=True)
game._lookout_environment = lambda: dict(_environment(True), illumination=1.0)
_neutral_near(game, boat, course=90.0)
opfor.update_sightings(game, boat)
rows = [row for row in boat.orders.sightings if row["cls"] in ("merchant", "unknown")]
assert rows, boat.orders.sightings
code = boat.orders._lights[rows[0]["ref"]]
assert code == "R2-g-" # starboard side seen, bow to the right
outlines = [row for row in uboot_scope.scope_outlines(game, boat) if row[4] is not None]
assert outlines and outlines[0][4] == code
scope = projections._uboot_scope(game, boat)
assert [row["lights"] for row in scope["sightings"] if row["lights"]] == [code]
# The frigate itself runs darkened.
_place_frigate(game, boat, 1.0, bearing=180.0)
opfor.update_sightings(game, boat)
frigate = [row for row in boat.orders.sightings if row["cls"] == "warship"]
assert frigate and frigate[0]["ref"] not in boat.orders._lights
# By day in clear weather nobody shows lights.
_clear(game)
opfor.update_sightings(game, boat)
assert boat.orders._lights == {}
def test_the_lookout_sees_the_lights_of_neutral_traffic():
game, _server, _bridge = _crewed(seed=61)
game.world.hour = 1.0
game._lookout_environment = lambda: dict(_environment(True), illumination=1.0)
game.crew_effect = lambda: 1.0
ship = game.civilians[0]
for other in game.civilians[1:] + game.warships:
other.x, other.y = game.ship.x + 60.0, game.ship.y + 60.0
ship.x, ship.y, ship.course = game.ship.x, game.ship.y - 1.0, 270.0
game.world.land_blocks_line = lambda *args: False
game._update_lookout_picture()
rows = bridge_view.lookout_outlines(game, game.lookout_sightings())
lit = [row for row in rows if row[4] is not None]
assert [row[4] for row in lit] == ["L2r--"]
glasses = projections._lookout_glasses(game)
assert [row["lights"] for row in glasses["outlines"] if row["lights"]] == ["L2r--"]
# Daylight in clear weather: no lights.
game.world.hour = 12.0
game.sim_t += 1.0
game._update_lookout_picture()
rows = bridge_view.lookout_outlines(game, game.lookout_sightings())
assert all(row[4] is None for row in rows)
def test_the_eyepiece_draws_the_lights_in_colour():
pygame.init()
surface = pygame.Surface((480, 270))
sky = sight_scene.plain_sky(True)
def draw(code):
surface.fill((0, 0, 0))
horizon.draw_horizon(surface, (0, 0, 480, 270), line_of_sight=0.0, fov_deg=20.0,
night=True, visibility_nm=10.0, motion=(0.0, 0.0),
outlines=[(0.0, 10.0, "merchant", False, code)], sky=sky)
return {surface.get_at((x, y))[:3] for x in range(120, 360) for y in range(60, 140)}
port = draw("L2r--")
starboard = draw("R2-g-")
plain = draw(None)
assert NAV_LIGHT["red"] in port and NAV_LIGHT["red"] not in starboard
assert NAV_LIGHT["green"] in starboard and NAV_LIGHT["green"] not in port
assert NAV_LIGHT["white"] in port and NAV_LIGHT["white"] not in plain
trawler = draw("R0-g-GW")
assert NAV_LIGHT["green"] in trawler and NAV_LIGHT["white"] in trawler
assert NAV_LIGHT["red"] in draw("R0-g-RWR")
def test_civil_aircraft_show_position_and_anti_collision_lights():
# Due north of the observer, 2 NM off: crossing to the east shows the
# right (green) wingtip, flying away the white tail light.
assert nav_lights.aircraft_code(90.0, 0.0, 2.0, 10.0) == "R0-g-AC"
assert nav_lights.aircraft_code(270.0, 0.0, 2.0, 10.0) == "L0r--AC"
assert nav_lights.aircraft_code(0.0, 0.0, 2.0, 10.0) == "R0--sAC"
assert nav_lights.aircraft_code(180.0, 0.0, 2.0, 10.0) == "R0rg-AC"
# Further off only the flashing anti-collision lights carry.
assert nav_lights.aircraft_code(90.0, 0.0, 8.0, 10.0) == "R0---AC"
assert nav_lights.aircraft_code(90.0, 0.0, 12.0, 20.0) is None
assert nav_lights.aircraft_code(90.0, 0.0, 5.0, 4.0) is None
assert nav_lights.valid("R0---AC")
def test_the_lookout_sees_civil_aircraft_lights_and_military_ones_dark():
game, _server, _bridge = _crewed(seed=61)
game.world.hour = 1.0
game._lookout_environment = lambda: dict(_environment(True), illumination=1.0)
game.crew_effect = lambda: 1.0
for other in game.civilians + game.warships:
other.x, other.y = game.ship.x + 60.0, game.ship.y + 60.0
game.world.land_blocks_line = lambda *args: False
flights = [flight for flight in game.flights.flights if flight.active]
if len(flights) < 1:
pytest.skip("no flight in the air for this seed")
for flight in game.flights.flights:
flight.x, flight.y = game.ship.x - 80.0, game.ship.y - 80.0
flight = flights[0]
flight.x, flight.y, flight.course = game.ship.x + 2.0, game.ship.y, 0.0
flight.kind = "civil"
game._update_lookout_picture()
rows = [row for row in bridge_view.lookout_outlines(game, game.lookout_sightings())
if row[2] == "aircraft"]
assert [row[4] for row in rows] == ["L0r--AC"] # flying north seen from the west
flight.kind = "military"
game.sim_t += 1.0
game._update_lookout_picture()
rows = [row for row in bridge_view.lookout_outlines(game, game.lookout_sightings())
if row[2] == "aircraft"]
assert all(row[4] is None for row in rows)
def test_anti_collision_lights_flash():
pygame.init()
surface = pygame.Surface((480, 270))
sky = sight_scene.plain_sky(True)
def reds(t):
surface.fill((0, 0, 0))
horizon.draw_horizon(surface, (0, 0, 480, 270), line_of_sight=0.0, fov_deg=20.0,
night=True, visibility_nm=10.0, motion=(0.0, 0.0),
outlines=[(0.0, 4.0, "aircraft", False, "R0---AC")], sky=sky,
anim_t=t)
return sum(1 for x in range(480) for y in range(270)
if surface.get_at((x, y))[:3] == NAV_LIGHT["red"])
assert reds(0.05) > 0 and reds(0.5) == 0
+2 -2
View File
@@ -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.41.dist-info/METADATA") for name in wheel_names)
assert any(name.endswith("-1.3.45.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.41'; "
"from src.core.version import APP_VERSION; assert APP_VERSION == '1.3.45'; "
"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; "
+89
View File
@@ -0,0 +1,89 @@
"""Tilt, zoom and stabilizer of the bridge binoculars and the periscope
eyepiece (presentation only, never saved)."""
import sys
from pathlib import Path
import pygame
from src.core import config, optics
from src.ui import horizon, sight_scene
sys.path.insert(0, str(Path(__file__).parent))
from test_lookout_glasses import _key, _lookout_page # noqa: E402
from test_opfor_sub import _game # noqa: E402
from test_uboot_scope import _clear, _local_boat # noqa: E402
def test_optics_bounds():
sight = optics.lookout_glasses()
assert sight.fov_deg == config.LOOKOUT_GLASSES_FOV_DEG and not sight.stabilized
for _ in range(40):
sight.tilt(10.0)
sight.zoom(1)
assert sight.elevation_deg == config.LOOKOUT_GLASSES_ELEVATION_DEG[1]
assert sight.fov_deg == config.LOOKOUT_GLASSES_FOV_DEG / config.LOOKOUT_GLASSES_POWERS[-1]
scope = optics.periscope()
scope.zoom(1)
assert scope.fov_deg == config.UBOOT_SCOPE_FOV_DEG / 4.0 # 1.5x to 6x
def test_binocular_keys_take_the_arrows_from_the_telegraph_only_while_raised():
game = _game(5)
_lookout_page(game)
telegraph = game.ship.telegraph
_key(game, pygame.K_b)
_key(game, pygame.K_UP)
_key(game, pygame.K_UP, pygame.KMOD_SHIFT)
_key(game, pygame.K_e)
_key(game, pygame.K_SPACE)
sight = game.lookout_optics
assert sight.elevation_deg == config.SIGHT_TILT_STEP_DEG + config.SIGHT_TILT_STEP_FAST_DEG
assert sight.fov_deg == config.LOOKOUT_GLASSES_FOV_DEG / 2.0 and sight.stabilized
assert game.ship.telegraph == telegraph
_key(game, pygame.K_b) # lowered: the arrows are the telegraph again
_key(game, pygame.K_UP)
assert game.ship.telegraph != telegraph
def test_periscope_keys_tilt_power_and_stabilizer():
game, boat = _local_boat()
_clear(game)
_key(game, pygame.K_1)
_key(game, pygame.K_1)
sight = boat.scope_optics
_key(game, pygame.K_UP)
_key(game, pygame.K_PERIOD)
_key(game, pygame.K_SPACE)
assert sight.elevation_deg == config.SIGHT_TILT_STEP_DEG
assert sight.fov_deg == config.UBOOT_SCOPE_FOV_DEG / 4.0 and sight.stabilized
_key(game, pygame.K_COMMA)
assert sight.fov_deg == config.UBOOT_SCOPE_FOV_DEG
game.draw()
def _picture(**kwargs):
surface = pygame.Surface((400, 200))
args = dict(line_of_sight=0.0, fov_deg=20.0, night=False, visibility_nm=30.0,
motion=(20.0, 0.1), outlines=[], sky=sight_scene.plain_sky(False),
sea_state=3.0, anim_t=1.0)
args.update(kwargs)
horizon.draw_horizon(surface, (0, 0, 400, 200), **args)
return surface
def _horizon_row(surface):
"""The row of the sharpest change down a clear column (sky to sea)."""
column = [surface.get_at((200, y))[:3] for y in range(30, 200)]
jumps = [sum(abs(a - b) for a, b in zip(column[i], column[i + 1]))
for i in range(len(column) - 1)]
return 30 + jumps.index(max(jumps))
def test_tilting_up_lowers_the_horizon_and_the_stabilizer_steadies_it():
level = _horizon_row(_picture(motion=(0.0, 0.0)))
up = _horizon_row(_picture(motion=(0.0, 0.0), elevation_deg=4.0))
assert up - level >= 4.0 * 400 / 20.0 - 6 # 4 degrees at 20 px per degree
rolling = _horizon_row(_picture())
steady = _horizon_row(_picture(stabilized=True))
assert abs(steady - level) < abs(rolling - level)
+40
View File
@@ -120,3 +120,43 @@ def test_web_silhouettes_are_generated_from_the_uconsole_profiles():
import gen_web_schema
assert gen_web_schema.render_profiles() == gen_web_schema.PROFILES_JS.read_text(
encoding="utf-8")
def test_the_sky_stays_still_while_the_horizon_rolls():
sky = _sky(22.0, cloud_cover=0.9)
calm = _picture(sky, motion=(0.0, 0.0), outlines=[], crosshair_deg=None)
rolling = _picture(sky, motion=(25.0, 0.08), outlines=[], crosshair_deg=None)
# Clouds, stars and moon in the upper sky are drawn at the same place.
band = pygame.Rect(20, 30, 360, 30)
assert (pygame.image.tobytes(calm.subsurface(band), "RGB")
== pygame.image.tobytes(rolling.subsurface(band), "RGB"))
def test_the_sea_looks_different_into_across_and_down_the_waves():
head, cross = sight_scene.sea_aspect(0.0, 0.0)
assert head == pytest.approx(1.0) and cross == pytest.approx(0.0, abs=1e-9)
head, cross = sight_scene.sea_aspect(0.0, 90.0) # waves from the left
assert head == pytest.approx(0.0, abs=1e-9) and cross == pytest.approx(1.0)
assert sight_scene.sea_aspect(0.0, 180.0)[0] == pytest.approx(-1.0)
sky = dict(sight_scene.plain_sky(False), wind_from_deg=0.0)
band = (0, 110, 360, 70)
into = _picture(sky, motion=(0.0, 0.0), outlines=[], crosshair_deg=None, sea_state=5.0,
line_of_sight=0.0)
across = _picture(sky, motion=(0.0, 0.0), outlines=[], crosshair_deg=None, sea_state=5.0,
line_of_sight=90.0)
assert pygame.image.tobytes(into.subsurface(band), "RGB") != \
pygame.image.tobytes(across.subsurface(band), "RGB")
def test_heading_to_the_sea_sets_pitch_and_roll():
from src.ui import horizon
beam = [horizon.hull_motion(3, t / 4.0, 5.0, 90.0) for t in range(400)]
head = [horizon.hull_motion(3, t / 4.0, 5.0, 0.0) for t in range(400)]
peak = lambda rows, index: max(abs(row[index]) for row in rows) # noqa: E731
assert peak(beam, 1) > 2.0 * peak(head, 1) # beam seas: she rolls
assert peak(head, 0) > 2.0 * peak(beam, 0) # head seas: she pitches
# Looking abeam the roll lifts the horizon instead of tilting it.
offset, tilt = horizon.view_motion(0.0, 0.05, 90.0)
assert offset > 0 and tilt == pytest.approx(0.0, abs=1e-9)
offset, tilt = horizon.view_motion(0.0, 0.05, 0.0)
assert offset == pytest.approx(0.0, abs=1e-9) and tilt > 0
+2 -2
View File
@@ -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.41"
assert APP_VERSION == "1.3.45"
assert SPLASH_TEXT == (
"Anti Sub Marine Warfare on uConsole by Dominik Bornhäußer Version 1.3.41"
"Anti Sub Marine Warfare on uConsole by Dominik Bornhäußer Version 1.3.45"
)
+2 -1
View File
@@ -195,7 +195,8 @@ def test_projection_carries_sightings_without_truth():
assert set(scope["sky"]) == set(web_schema.SKY_FIELDS)
row = next(row for row in scope["sightings"] if row["cls"] == "warship")
assert set(row) == {"ref", "category", "cls", "bearing", "span_deg", "quality", "age_s",
"range_nm", "range_sigma_nm", "range_age_s", "solution"}
"range_nm", "range_sigma_nm", "range_age_s", "solution",
"lights"}
assert "target_id" not in row and "aspect" not in row and "x" not in row
assert "kind" not in row # a key the browser's inspector forbids
assert row["bearing"] != pytest.approx(100.0, abs=1e-9) # measured, not the truth
+25
View File
@@ -264,3 +264,28 @@ def test_starter_links_the_support_page():
source = open(app.__file__, encoding="utf-8").read()
assert "launcher.support" in source and "SUPPORT_URL" in source
assert SUPPORT_URL.startswith("https://buymeacoffee.com/")
def test_release_pruning_keeps_the_current_and_newer_releases():
import importlib.util
from pathlib import Path
path = Path(__file__).resolve().parents[1] / "tools" / "prune_releases.py"
spec = importlib.util.spec_from_file_location("prune_releases", path)
prune = importlib.util.module_from_spec(spec)
spec.loader.exec_module(prune)
tags = ["v1.3.41\n", "v1.3.40\n", "v1.3.9\n", "v1.3.39\n", "latest\n", "v1.3.40-rc1\n"]
assert prune.older_tags("1.3.40", tags) == ["v1.3.9", "v1.3.39"]
assert prune.older_tags("1.3.11", ["v1.3.11"]) == []
with pytest.raises(ValueError):
prune.older_tags("1.3", tags)
def test_release_pruning_prints_bare_tags(tmp_path):
import subprocess
from pathlib import Path
tool = Path(__file__).resolve().parents[1] / "tools" / "prune_releases.py"
out = subprocess.run([sys.executable, str(tool), "1.3.42"], input=b"v1.3.41\r\nv1.3.43\r\n",
capture_output=True, check=True).stdout
assert out == b"v1.3.41\n"
+3 -1
View File
@@ -115,7 +115,9 @@ def render_profiles() -> str:
" do not edit by hand.\n"
f"export const PROFILES = {body};\n"
f"export const DETAIL_MIN_PX = {silhouettes.DETAIL_MIN_PX};\n"
f"export const FOAM = {_array(silhouettes.FOAM)};\n")
f"export const FOAM = {_array(silhouettes.FOAM)};\n"
"export const NAV_LIGHT = {%s};\n" % ", ".join(
f"{name}: {_array(color)}" for name, color in sorted(silhouettes.NAV_LIGHT.items())))
def render(text: str) -> str:
+45
View File
@@ -0,0 +1,45 @@
"""List the GitHub releases older than the current one (one tag per line).
The Windows workflow keeps only the newest release: after publishing
``v<APP_VERSION>`` it pipes every release tag into
``python tools/prune_releases.py <APP_VERSION>`` and deletes the releases
printed here. Git tags stay, so older versions remain checkable. Only tags of
the form ``vX.Y.Z`` older than the current version are printed; anything
newer (a later run that finished first) or unparsable is never touched.
"""
from __future__ import annotations
import re
import sys
_TAG = re.compile(r"v(\d+)\.(\d+)\.(\d+)")
def _version(text: str) -> tuple[int, int, int] | None:
match = _TAG.fullmatch(text.strip())
return tuple(int(part) for part in match.groups()) if match else None
def older_tags(current: str, tags) -> list[str]:
keep = _version(f"v{current}")
if keep is None:
raise ValueError(f"invalid version {current!r}")
return [tag.strip() for tag in tags
if (version := _version(tag)) is not None and version < keep]
def main(argv=None) -> int:
argv = sys.argv[1:] if argv is None else argv
if len(argv) != 1:
print("usage: prune_releases.py VERSION < tags", file=sys.stderr)
return 2
# Plain "\n" even on Windows: a "\r" would become part of the tag.
sys.stdout.reconfigure(newline="\n")
for tag in older_tags(argv[0], sys.stdin):
print(tag)
return 0
if __name__ == "__main__":
raise SystemExit(main())