You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iterating over all replicated entities and their replicated components to identify which components need to be sent to clients
allocating intermediary 'world diffs' for each client, which contain all the diffs they will be sent this tick
Solution
The first problem can be mitigated with per-entity change detection, so you don't need to iterate over components in entities that haven't changed in a while.
Here are three ideas to mitigate the second problem (as discussed on discord).
Serialize diffs directly into per-client buffers instead of allocating intermediary representations. Easy to implement, fast. Can work with diff fragmentation by allocating a new buffer representing a new packet whenever the current buffer is packed (with some byte shuffling to manage entity boundaries).
Build a world diff history cache that has per-tick diffs for replicated entities (only most recent changes are cached). Client packets are built by directly serializing into buffers from the diff cache. Moderate difficulty to implement, faster than current code but slower than (1) because the cache must be allocated. Also supports diff fragmentation.
Bundle-based replication using auto-generated systems to collect diffs. Hard to implement, equivalent to (1). Also supports diff fragmentation.
In conclusion, (1) seems like a safe bet.
The text was updated successfully, but these errors were encountered:
Problem
World diff collection involves:
Solution
The first problem can be mitigated with per-entity change detection, so you don't need to iterate over components in entities that haven't changed in a while.
Here are three ideas to mitigate the second problem (as discussed on discord).
In conclusion, (1) seems like a safe bet.
The text was updated successfully, but these errors were encountered: