metaworking / channeld-ue-plugin

Enables distributed simulation with Unreal Engine's dedicated servers. 为虚幻引擎专用服务器提供分布式模拟能力的开源插件.
Apache License 2.0
122 stars 32 forks source link

Support multiple replicated SceneComponent in one Actor #76

Open indiest opened 1 year ago

indiest commented 1 year ago

PR #48 added support to multiple replicated ActorComponents in one Actor. However, if the ActorComponents are SceneComponent, it won't work, as the SceneComponentStates still share the same NetGUID (Actor).

To make it work, we need to:

  1. Add the compName field for all the states of the ActorComponent that inherit SceneComponent;
  2. Generate the ComponentStates message to aggregate all the component state mentioned above, and map them by the compName

The design above should have some performance issue, as the component states are wrapped in two levels of map in the Global channel data, and to avoid that, there's another design:

  1. Use the Actor NetGUID + Component Name to globally index the actor component;
  2. So the component state map in the Global channel data should be like this: map<string, unrealpb.SceneComponentState> sceneComponentStates