Skip to content

Idea for better client/server synchronization #4

@maksmaisak

Description

@maksmaisak

Copied this over from the workflowy:

  • Each Entity has a NetworkFlagsComponent with a collection of bit arrays (arrays of boolean flags).
  • Each bit array corresponds to a client.
  • Flag at index i means that the state of a Component with index i needs to be sent to the client.
  • If a client does not need to know about a particular Entity (say it's too far away from the player), then that Entity's NetworkFlagsComponent does not have flags for that client.
  • A System cycles through all Entities with network flags and composes different messages for different clients, based on which flags are set.
  • When a client connects, set all flags corresponding to Entities around it to true.
  • Similar to what we currently have, but:
    • Supports multiple clients with different subsets of the world state.
    • Only sends data when it changes or on client connect.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions