Moondog, day 21 (10 Nov): to sea

About 175 commits. The home terrain became an island, and by the end of the day there were seven kinds of ship sailing round it.

The island and the sea

I wrote the sea design first: sailing ships, separate mesh islands, and a world that wraps round. Then I worked through it.

  • A coast taper script turned the home terrain into an island with beaches, a seabed and a harbour bay on the west side. It broke four regions round the rim. They were compressed resources written back uncompressed, but a compressed file counts its offsets from after its header, so every offset was 4 bytes out and the engine couldn't load them. They're now patched inside the compressed stream.
  • One shared wind for the whole world, on the server and the client alike.
  • The sea is Caribbean blue over white sand, with waves that follow the weather and the wind. Out from the coast storms bring 25 m/s winds and 12 m seas.
  • The wrapped world. The world is a 24 km square whose edges join. Sail or swim off one side and you come round the other, with your crew and pets riding along. Interest management measures distance the short way round. Each edge is set to lead back to itself for now, which leaves room for neighbouring servers later.
  • West Isle, the first streamed mesh island, with 600 trees on its hill. A timber quay in the harbour bay.

Ships

The schooner came first: built by script, a broader hull after the first try, and a deck collider generated from the hull's own lines. She sails by the wind, has a deck you can walk on and a real anchor, and you log back in aboard her. Then came the frigate (three decks, ship-rigged), the sloop, the cutter, the outrigger, the cog and the knarr. Each had an agreed design, a script-built model with its deck file, and a live check that walks the decks, works the tiller and sails, and opens the hold.

Two bugs from the ships stand out:

  • Ships never moved smoothly. They were never added to the list of entities drawn from timed samples, so every ship snapped to each server update. None of the ship gear ran either: no smooth turning, no sails, no anchor. One missing registration hid all of it.
  • Turning stepped like a clock's second hand. Facing went over the wire in whole degrees, so a ship turning at 7°/s ticked visibly. It now goes in hundredths of a degree, and heading is interpolated from the same samples as position.

Ships also pitch and roll on the waves. That's visual only: the model leans under a pivot while the deck you walk on stays level, so movement and prediction aren't affected. On top of that:

  • Ships have holds.
  • You board by ladder or gangplank, and your pets follow you aboard and below decks.
  • Lanterns hang from mounts on deck.
  • Shallow ships like the knarr can be run up a gentle beach and pushed off again.

Network

The state packet is binary now. Another player costs about 20 bytes instead of about 30 as JSON, and your own row costs 45 instead of 75. Each state carries a counter so the client can count what it lost. With that counter I found the ENet packet throttle was throwing away 7.6% of states while a client was loading, against 1.9% without it, so it's off. For a load test I put fourteen bots aboard a frigate in a storm. The game server averaged 72% of one core, every bot stayed aboard for the whole run, and the longest wait was under 100 ms.

Trees after real photos

Oak, Scots pine, beech, spruce, maple, birch, linden and yew were all regrown from reference photos: fat oak boles with great level limbs, orange upper bark on the pines, silver fluted beech, fused twisting yew stems. Each tree got a new leaf or needle card, some from CC0 leaf scans and some modelled. I also grew sugi and hinoki, the Japanese cedar and cypress, as two new woods.

Weather

Wet surfaces, puddles and lying snow. Rain is easier to see now: the streaks are wider, brighter and kept near the camera.

Yōkai

The hikeshibaba (lights go out when she's near), the ōkaburo, a giant child who peers into your face, with a derelict farmhouse for him to haunt, and the goryō, a wronged noble's ghost who brings the storm. Creature action sounds finally play. Orochi Isle is the Yamata-no-Orochi's body at legend scale, with its eight heads standing on it and sugi and hinoki growing on its back. The killing stone is there too, sealed and split. I also went back over the vengeful ghosts so the way each one died shows on them, as it does in the old prints.