Skip to content

fix: co-op clients hold each mission object's state, so damage and the wing show - #1702

Open
vdmkenny wants to merge 1 commit into
mainfrom
fix/coop-objects-like-ships
Open

vdmkenny wants to merge 1 commit into
mainfrom
fix/coop-objects-like-ships

Conversation

@vdmkenny

@vdmkenny vdmkenny commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator

Co-op clients showed the host's mission objects from scene pages, which carried only their place, their turn and two flags. A client never saw an enemy's damage, and the wing window (X) was empty.

What changed:

  • Each mission object's slot is copied to every client slot for slot (network/mirror.zig). The fields that travel follow from the engine's types: every field of create.Slot is marked as sent or kept, and a new field fails the build until it is marked. Pointers into a machine's own memory never travel.
  • Each state goes as the change from the last one the client acknowledged (its input carries the last four message serials), so an unchanged object costs nothing. A client that loses track asks the host to start over, once per request.
  • An object's motion goes as a compact pose that the client's simulation carries and corrects as before (correctLane).
  • The wing comes with the objects, with the pilot's own ship first, as in single player.
  • Scene pages are gone. Protocol 48.

Measured headless with a simulated client: about 35 KB/s per client in mission 6 and 10 to 20 KB/s in mission 18, below what the scene pages used.

Left for later: running the objects' orders on clients for show, so explosions, spin-outs and cloaks appear (#1699); pilots' ships and arena rocks on the same path (#1700); a stream of the host's decisions in place of combat effects, wrecks and notices (#1701).

…e wing show

Co-op clients showed the host's AI ships and capital ships from scene pages, which carried only
their place and two flags. A client never saw an enemy's damage, and the wing window was empty.

Each mission object's slot is now copied to every client slot for slot (network/mirror.zig). The
fields that travel follow from the engine's types, and a field added to a slot fails the build
until it is marked as sent or kept. Each state goes as the change from the last one the client
acknowledged, and the motion goes as a compact pose that the client's simulation carries and
corrects as before. The wing comes with the objects. Protocol 48.

Running the objects' orders on clients for show, pilots' ships and rocks, and a stream of the
host's decisions are #1699, #1700 and #1701.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant