I’m writing a multiplayer game with bullet physics and zay-es. I decided that I want to run the physics simulation both on the server and the client to increase the input responsiveness.
I have a PhyicsSystem that reads the positions of the rigid bodies and sets a PositionComponent on the entity. I manually sync the two physics simulations and I have a physicsstate on both the server and the client. Now the Problem is that the RemoteEntityData on the client is read-only but the PhysicsState has to write the position! I have thought of two solutions:
- Extend RemotEntityData and allow writing of PositionComponents
- Make a mutable PositionComponent
Both are a little bit hacky and i’m starting to think that i’m going in a totally wrong direction