lightyear icon indicating copy to clipboard operation
lightyear copied to clipboard

Update the way we collect world changes that need to be replicated?

Open cBournhonesque opened this issue 11 months ago • 1 comments

Currently, replication works like this:

  • we have systems that track entity spawn/despawn for all entities that have the Replicate component
  • for each component in the protocol, we have one system that tracks component adds/updates, and one system that tracks component removals
  1. That's a lot of systems. Maybe we can try to benchmark against an archetype approach where we iterate through all archetypes that have the Replicate component? The code would be similar to having a custom WorldQuery:
  • we need to update the cached State with the new archetype information (which ones contain Replicate)?
  • then we iterate through all the components in the archetype
  1. Maybe we can use the new ComponentHooks and Observers ECS patterns to more efficiently accomplish this?

cBournhonesque avatar Mar 22 '24 03:03 cBournhonesque