LanguageEnglish

sail.

Prowadzisz niewielki jacht turystyczny, a rzecz jest w przelocie, nie w wyścigu. Wiatr pozorny, trym żagli, przechył i moment prostujący, dryf, ściana prędkości kadłubowej, przeciągnięcie steru, nawietrzność — policzone naprawdę, a nie strzałka wiatru i mnożnik prędkości.

Koniec dnia
Koniec dniaŚwit i zmierzch były dotąd tak samo szare jak południe: ocieplało się tylko światło słońca, więc po wodzie szła złota ścieżka pod niebem bez żadnej barwy. Teraz gradient idzie za słońcem — nad głową ciemnieje ku fioletowi, pali się tam, gdzie jest słońce, a po przeciwnej stronie zostaje łuk przeciwzmierzchowy — a spody chmur łapią to, co morze odbija w górę.

Co to jest

Pętlą jest samo żeglowanie

Wiatr rzeczywisty wyznacza trym; trym daje napęd i dryf; napęd przesuwa wiatr pozorny; i trymujesz od nowa. Wszystko inne — kotwiczenie, silnik pomocniczy, kabestany, refowanie — jest przedłużeniem tej pętli, a nie czymś obok niej.

Kąt natarcia, nie kąt wiatru

Program liczący prędkość może założyć idealny trym i ująć wszystko w tabelę według samego kąta wiatru. Gra nie może, bo trymowanie jest robotą gracza. Szot ustawia kąt cięciwy, cięciwa ustawia kąt natarcia, a kąt natarcia decyduje, czy żagiel ciągnie, łopocze, czy jest przeciągnięty.

Uczy żeglować

Ćwiczenie „człowiek za burtą” jest zarazem lekcją: jedno polecenie naraz, nic dalej, dopóki poprzednie nie zostanie wykonane — a potem boja idzie za burtę i cała reszta zaczyna mieć znaczenie. Rozpędzenie łodzi to trzy klawisze i dwie minuty; sprowadzenie jej z powrotem w jedno miejsce i zatrzymanie tam to całe prowadzenie jachtu, i nikt tego nie ćwiczy, dopóki nie musi.

Jedna łódź, zrobiona porządnie

Seryjny slup czarterowy, około trzydziestu czterech stóp — klasa, którą najwięcej żeglarzy naprawdę prowadziło i potrafi ocenić. Jedna łódź zrobiona porządnie bije pięć zrobionych pobieżnie.

582testów w całym repozytorium
180w samej dynamice
200 Hzstały krok fizyki
4 DOFposuw, znoszenie, przechył, odchylenie — z masą dodaną

Zdjęcia

To jest wersja z biurka, a w karcie można pożeglować od razu. Całość kompiluje się na wasm32-unknown-unknown i przycisk na górze strony to otwiera: to samo morze, ta sama łódka, ten sam model, jakichś piętnaście megabajtów po drucie i niecałe pięćdziesiąt klatek na sekundę. Czego karta nie potrafi, to wspólnego żeglowania — przeglądarka nie ma UDP i nie umie rozgłaszać, więc przekaźnik, lista gier w sieci i dołączanie po adresie zostają przy wersji z biurka — i potrzebuje prawdziwej klawiatury, więc telefon musi poczekać.

Łódź żeglująca w szkwale, przechylona
Trzydzieści klatek szkwałuPrzechyla się, morze idzie pod nią, a przyrządy odpowiadają — czyli ta połowa, której nie powie żadne zdjęcie. Nagrane przez grę fotografującą samą siebie, bo przechwytywanie ekranu wymaga uprawnienia, którego serwer budujący nie ma.

Model

Każdy wiersz to arytmetyka, która może się mylić w sposób zauważalny dla żeglarza — i dlatego rdzeń niesie zestaw testów sprawdzających go względem liczb znanych z wody, a nie względem jego własnych wyników.

CzęśćUjęcie
Rigid body4 DOF — surge, sway, roll, yaw — with added mass. Heave and pitch arrive with waves.
Sail forcesHazen decomposition, with coefficients blending into flat-plate behaviour past separation
The slotEach sail bends the other's wind — the headsail downwashes the main, the main upwashes the headsail — scaled by how much of the sail doing the bending is actually set. Without that last part a main rolled up on the boom went on turning the genoa's wind by four degrees, and the boom had to be trimmed as though the main were there.
ReefingThree slabs and then she is handed: full, one, two, three, down. Each slab takes a sixth of her off, and the step from the second reef to no mainsail at all is the one you need in the forties.
Frictional resistanceITTC-57 line plus roughness allowance. Not an approximation.
Wave-making resistanceCalibrated curve shaped like the Delft series, with the hull-speed wall. The full DSYHS regression needs a dozen hull coefficients nobody publishes for a production cruiser; residuary_resistance is the seam where it drops in.
Induced resistanceClassic, with effective span below draft because of the free surface
Keel and rudderLifting-line slope with a real stall. Rudder authority goes as the square of flow speed.
StabilityGM slope blending into a GZ curve that peaks and gives way
Weather helmHeel-shifted centre of effort plus the asymmetric heeled waterplane
WindOrnstein-Uhlenbeck gusts that veer as they build, with a boundary-layer gradient. WindField is where a real GRIB2 forecast replaces it.
SeaTwenty-one Gerstner components on a Pierson-Moskowitz spectrum and deep-water dispersion, heights and periods from fetch-limited relations
Heave and pitchDistributed buoyancy over nine hull stations against the local surface
Waves on rollThe GZ curve evaluated at heel relative to the wave slope
SurfingFroude-Krylov: displacement times g times the surface slope
Added resistance in wavesCharged from the power the motion damping dissipates
IntegrationFixed 200 Hz substeps, decoupled from frame rate
Jeszcze nie policzone i wiadomo, że tego brak: pływy i prądy. Mapa rysuje w rogu znoszenie wiatrowe, dwa i pół procenta siły wiatru, i tekstura morza jest przez nie niesiona — ale kadłub już nie, więc ta strzałka jest jedyną rzeczą na papierze, której łódź nie słucha. Warto o tym wiedzieć, zanim się zaufa pozycji zliczonej. Czas płynie jeden do jednego, bez kompresji, co jest decyzją świadomą i taką, do której trzeba będzie wrócić: czterdzieści mil przy pięciu węzłach to osiem godzin.

Dźwięk

Syntezowany, nie próbkowany. W repozytorium nie ma plików dźwiękowych i nie muszą być: wiatr i woda są filtrowanym szumem, więc generowanie ich jest metodą uczciwą, a nie drogą na skróty. Dźwięk olinowania bierze się z zależności Strouhala na wancie sześciomilimetrowej, a bramkuje go to, jak równy jest wiatr — wiry nie potrafią się zsynchronizować z przepływem, który się pod nimi zmienia, więc wanta w porywie puszcza, milknie i znajduje nową nutę, kiedy poryw się ustali.

Jest też kapela, i to łódź ją pisze, a nie ktoś gra przy niej. Tempo bierze się z okresu spotkań — częstości, z jaką kadłub naprawdę spotyka fale — więc muzyka idzie w rytmie żeglowania, a nie w poprzek niego. Kurs względem wiatru wybiera metrum i język: pod wiatr jest synkopowane i kanciaste, półwiatr dostaje chodzący bas, baksztag jest rzadki. Poza tym, co łódź może znieść, język zmienia się całkiem — na coś ze zmniejszoną sekundą.

Żeglowanie razem

Od dwóch do ośmiu znajomych w jednym archipelagu. Każdą łódź liczy ten, kto nią żegluje, a serwer jest przekaźnikiem, zegarem i poczekalnią — cokolwiek innego wstawiłoby czas obiegu między czyjąś rękę a ster, a żeglarz czuje pięćdziesiąt milisekund na rumplu. Gra w tej samej sieci jest na liście, bo adres podyktowany przez czat jest błędny mniej więcej za trzecim razem.

sail-server --seed 42

Pobierz

macOS

curl -fsSL https://raw.githubusercontent.com/kapoost/sail/main/dist/install.sh | sh

Linijka w terminalu, a nie plik do pobrania, i to celowo: macOS kwarantannuje to, co zapisze przeglądarka, a nie to, co ściągnie curl — a odkąd macOS 15 usunął otwieranie prawym przyciskiem, nie ma innej prostej drogi obok komunikatu „Sail is damaged and can't be opened” na programie, za który nikt nie zapłacił Apple'owi za poręczenie.

Windows

irm https://raw.githubusercontent.com/kapoost/sail/main/dist/install.ps1 | iex

To samo w drugą stronę: „Windows protected your PC” bierze się ze znacznika pochodzenia z sieci, który dokłada program pobierający — przeglądarka dokłada, Invoke-WebRequest nie. Sail.exe ze strony wydań też działa, jeśli wolisz kliknąć More info i Run anyway.

Pożegluj w karcie

Bez instalowania, jeśli wolisz najpierw zobaczyć: ta sama gra zbudowana dla przeglądarki, w karcie. Zaczyna z wachtą na pokładzie i pilotem u steru, na otwartej wodzie, żeby pierwszą minutę dało się spędzić na patrzeniu — a Esc → MISSIONS → SAILING 101 oprowadza po łódce, jedno urządzenie naraz. Potrzebuje WebGPU, a w praktyce znaczy to Chrome albo Edge — Safari ma WebGPU i maluje wszystko na czarno, co jest sporem silnika z przeglądarką, a nie usterką tej gry, i strona mówi o tym, zanim cokolwiek pobierze. Jakichś piętnaście megabajtów po drucie, a chodzi w niecałych pięćdziesięciu klatkach na sekundę wobec sześćdziesięciu na biurku. Tylko samotnie: strona nie znajdzie gry, którą kolega uruchomił w sąsiednim pokoju.

Ze źródeł

cargo run -p sail-app --release      # gra
cargo test -p sail-core              # zestaw testów
cargo run -p sail-core --release --example polar   # polara prędkości

Klawisze

Lista jest generowana z ekranu pomocy w samej grze — naciśnij ? albo F1, a zobaczysz dokładnie to samo. Została po angielsku celowo: gra jest po angielsku, więc przetłumaczona lista przestałaby pasować do tego, co widać na ekranie, a przy okazji byłaby drugą kopią tej listy — czyli dokładnie tym, czemu ta strona ma zapobiegać.

Ekran pomocy w grze
Ta sama lista, w programieZa znakiem w rogu, czyli pierwszą rzeczą, w którą każdy klika. Lista powyżej jest wygenerowana ze źródła tego ekranu.

AT THE HELM

← →
the tiller, and it holds the angle you leave it at
Space
centre the helm, and put the view back where it looks
Shift
fine — hold it with anything for a smaller bite
P
autopilot on and off
O
and whether it steers a compass course or a wind angle
, .
move its target ten degrees — one with Shift
 
with it engaged, Space is the view only: the pilot has the helm

THE SAILS

W S
mainsheet: haul in, ease
Q E
genoa winch: ease, grind in
1 2
pick a line out of the clutch bank
A D
and work the one you picked
X Z
order a headsail: genoa, code 0, gennaker, spinnaker — the foredeck rolls the old one away, bends the new one on and sets it
T
a hand on the sheet: once for the sail that leads
shift T
call the watch on deck, or stand them down — they sail her while you steer, and a hand on any rope takes it back
 
press again for the other — main first upwind, headsail off it
G
back the genoa — the only sail that can be, and the way out of irons
F
the preventer: rig it for a long run, take it off before you gybe

WHEN IT BLOWS

R
dump: once eases until the deck is steady and the pilot can hold her
 
again, or held, lets everything go — cloth flogging, and she stops
1 2 A D
the reef and the furling line are lines in the bank

WHERE YOU ARE

Shift B
the glasses, which name the place rather than the thing
B
and ask whether what is in them is enough: a mark near enough to read names itself, and three well spread name the coast
Shift N
the hand bearing compass; aim with the right button held
N
and shoot: hold the notch on it, and it says whether it caught
 
one instrument at a time, and either one puts you in the cockpit
M
the chart in the corner, and [ ] to zoom it
Shift M
spread on the table: dividers, ruler, parallel rule, protractor, pencil, watch, log, rubber, and the fix
 
bearings and what you have made out go in the DECK LOG; click a line there to lay it on the chart, and again to take it off
 
right-drag moves the paper — lost, it does not follow you about
 
the log writes itself up while it is spread: tack, stay on deck, and the pencil runs on the old course until you come back to the table
L
stream the log and read it: a minute of glass, and the bar says when to stop her
Shift Backspace
somewhere at sea with the sails set and no idea where — it throws the passage away, which is why it is nowhere near the keys you sail with
F12
a picture of the screen, into your Pictures folder — the fault you cannot describe is the one nobody fixes

STOPPING FOR THE NIGHT

V
let go, and veer five to one on the water under her — press it again to weigh
 
the chart draws the anchor and the circle she can swing in: inside it is lying to it, outside it is dragging
 
the windlass lifts chain, not a boat — if the cable is bar taut, sail up to it and take in the slack as it comes

IF SOMEBODY GOES IN

Enter
throw the lifebuoy — and the throw is the part that cannot be late
 
the same key alongside: the boathook reaches by itself, and the catch is timed to the sea — take it as she comes level
Esc
then MISSIONS practises the whole thing on Oscar

THE ROD, AND THE SCREEN

J
the rod over the stern — and the lift, with one alongside
↑ ↓
the reel: wind in, give line — and line out is depth
- =
the drag: a third of the line's strength is the rule
Shift
low gear: slower, and it winds when high gear will not
U
pump: lift the rod, and wind as you let it down
I
what swims here, how to troll for it, and what you have had
C
view: behind her, ahead, down the wake, under it
H
hide the console
K
mute
3 - 7
the signal halyard, while there is a ship to talk to: K ask, L stop, X wait, P carry on, U danger — and 0 hauls it down
F11
full screen, and back — Alt Enter does it too
Esc
settings — sound, picture, weather, the passage, together, drill

Polara

Prędkość łodzi w węzłach, według rzeczywistego kąta i siły wiatru — policzona przez symulację, nie narysowana. Najlepsze VMG pod wiatr przy dwunastu węzłach wypada na 40 stopniach: 5,6 węzła przez wodę, 4,1 zyskane, 21 stopni przechyłu, 3,6 dryfu. To są liczby z prawdziwej łodzi.

charter sloop 34 — LWL 9.20 m, disp 5500 kg, sail area 64 m2, hull speed 7.36 kn
reefed to hold heel at or below 22 deg; * marks a point that did not converge

  TWA       6kn       8kn      12kn      16kn      20kn      25kn     <- boat speed, kn
   30     1.20*     1.56*     2.74      3.10      2.87*     2.91*
   35     2.35      3.42      4.90      5.03      4.89      5.18 
   40     3.22      4.28      5.65      5.84      5.62      6.21 
   45     3.78      4.63      5.89      6.29      6.10      6.57 
   50     3.98      4.78      6.20      6.53      6.65      6.82 
   60     4.29      5.22      6.54      6.94      6.95      7.15 
   70     4.53      5.48      6.71      7.27      7.41      7.36 
   80     4.64      5.60      6.78      7.40      7.71      7.80 
   90     4.63      5.60      6.79      7.43      7.89      8.10 
  110     4.35      5.30      6.64      7.32      7.80      8.27 
  120     4.10      5.03      6.46      7.19      7.68      8.15 
  135     3.64      4.53      6.00      6.82      7.36      7.84 
  150     2.98      3.78      5.15      6.26      6.92      7.49 
  165     2.63      3.39      4.72      5.86      6.67      7.31 
  180     2.34      3.04      4.28      5.35      6.26      6.96