CH net interactions

Phase 1: Multiplayer discovery/handshake: two instances become aware of each other, one offers to host the game and becomes the host, the other accepts and becomes the guest.

Phase 2: Host picks a stage and transmits the arena data to the guest. This might just be “stage 123, player 2” or it might be a representation of the arena to allow sharing custom stages on the fly.

Phase 3: Host and guest eventually notify each other they’re ready to go. Some kind of tick synchronization might be necessary to make the timing work. This is the kind of stuff I’m doing this to learn!

Phase 4: Game behavior triggers various types of events:

  • “prop available at n“: a prop was placed on gateway n on the other arena and appears on gateway on this arena. Details about the prop are transmitted, also.
  • “prop removed from n“: the prop was picked up from gateway n on the other arena and is no longer available on gateway n on this arena.
  • “event n triggered”: event n was triggered globally on the other arena and should be delivered to anything that consumes n on this arena.
  • “object glassed”: the other player flagged an entity for this player to see. Identifying information sufficient to display a picture of the object is transmitted as well.
  • “goal n reached”: the other player’s character has activated goal n. If the host knows that both its player and the guest have reached goal n, the stage is completed.

Phase 4 continues until the stage is completed (or either player has quit, going to Phase 5). At that point, flow returns to Phase 2.

Phase 5: One of the players quits and broadcasts a goodbye, or they don’t respond for a given timeout.