NetCode multiple command systems

I am currently trying to use multiple command systems in NetCode. According to the documentation, this should work:

I am struggling to understand how this should work in practice. I only have one CommandTargetComponent, because there is exactly one connection entity per client. So I can only point it to one other entity, that should hold the command buffer data. If I simply add two buffers to that entity, both for a different ICommandData implementation, the CommandReceiveSystem doesn’t seem to be able to distinguish the data between them - so a CommandReceiveSystem tries to deserialize data that is actually meant for CommandReceiveSystem.

Am I missing something here, or are multiple and simultaneously sending/receiving command systems not supported currently?

I’m having the same problem. Tried adding another command data buffer to the same entity for rotating the cube (also added the systems for parsing that data) and everything broke. Checked all the code for sending and receiving, but still didn’t find anything related to the problem.

@timjohansson could you please clarify if there is such a problem? Or is it us two making a mistake somewhere?

What that text means is that you can have multiple command data types which you switch between by setting a different entity as the command target. So you could switch between different commands for a player on foot and a player in a vehicle for example. It does not mean you can have multiple command streams at the same time, to do that you would have to create a AandB ICommandData and merge/split the streams manually.

1 Like

Got it, thanks for the clarification! Is there any intention to support multiple simultaneous command streams without having to do the manual splitting/merging?

It is not something we have had a concrete use-case for so far so it is not on our short-term roadmap. If you have a compelling use-case we can add it to our backlog and prioritize it. What do you need it for?