Replication
Starting with Version 1.1 the component can be used in multiplayer. All you need to do is switch on the "Component Replicates" setting of the deformation component, which is the case by default.
If the component is used in single player, the "Component Replicates" setting can and should be deactivated in order to save some performance.
The component is not yet tested in combination with dedicated servers.
How it works
When network replication is active, all hits are recognized by the server and forwarded to all relevant clients. Each client calculates the deformation independently (locally) based on the data received from the server. In general, the hits are always recognized by the server, with the exception of when the actor is a pawn and this pawn is controlled by a player (e.g. a possessed chaos vehicle). In this case, the hits are recognized by the controlling client and then sent to the server.
Each hit is also stored in the hit history. This hit history is used to be able to restore the current deformation at any time. This is particularly important as for example a player who joins later should see the same deformation as all other players. The same concept applies to actors that only become relevant for a client later and/or under special conditions. In both cases, the hit history is "replayed" client side so that all players subsequently see the same deformation.
We are currently aware of two limitations in the way our network replication works:
- Firstly, there is always a certain delay in deformation, as all data must first be sent to the server and then back to the client. This can be optimized in future using client-side prediction.
- Secondly, the hit history only supports a maximum of ~300 entries (hits). The reason for this is that Unreal Networking has a fixed maximum packet size (also called "maximum bunch size") and this is currently reached after ~300 hits. Once the maximum number of hits has been reached, the oldest hits are always deleted from the hit history for every subsequent hit and are therefore lost.