Open metalgearsloth opened 1 year ago
Rng could be server-synced, i.e a RNG component in the gun that stores & network syncs the seed and so ensures both client and server get the same next value for accuracy. Requires of course that this component is used by only shared systems or that the RNG rolls are the same client and server.
The easiest way to lag comp entities back in time is to store a short array of positions, which is updated in TransformComponent each frame. When a shot happens the server needs to know exactly the tick it is based on so it can walk the entity back in time. This gets more tricky with clientside prediction if the server and client disagree on where the target was that frame.
You almost need to walk the target back to the last network sync relevant to the client and then predict it forward. But only if we have prediction diverge between client and server (do those tend to diverge?).
I imagine that target input controls changing is going to be the main source of divergence.
You almost need to walk the target back to the last network sync relevant to the client and then predict it forward. But only if we have prediction diverge between client and server (do those tend to diverge?).
We have a lagcompsystem which is currently used for melee which you would also use here for some validation.
Mirror mentioned it, worth a shot.
Pros: