#Is there a way to have “monotonic” ticks in the prediction loop with NetCode for Entities?

1 messages · Page 1 of 1 (latest)

hoary nacelle
#

I’m trying to make a physics based platformer with heavy use of physics prediction.

To save bandwidth I’ve tried to make some moving platforms that move in a predictable way that is easily calculated based on the currently simulated tick index. This way I don’t need to send the platform’s transform over the network.

Unfortunately this doesn’t seem to work as I’d expect. After printing out the NetworkTime singleton and SystemAPI.Time.ElapsedTime I am noticing some discrepancies in how the the ticks update frame to frame.

Perhaps it’s due to tick batching, but I’m wondering, what’s the best way around this? Ideally I’d like to write all of my gameplay logic in the predicted physics loop, but it’s tricky when I can’t use a reliable tick index or global time that will update the same on the server and the client.

median sand
#

I wouldn't try fighting the prediction system. Let it do its thing. If I remember right, all physics get moved into the predicted physics systems. If you want to avoid that then I guess you could move your platforms directly client side without physics.

hoary nacelle
#

Oh no, I'm not trying to fight the prediction system at all. I'm loving that it just works for the most part! I'm just trying to figure out the most accurate way to use it. I would have thought that prescribing the path of an object and exactly where it should be at any point in time should be a good use case for a predictive system.

median sand
#

The prediction system is pretty automated. You can move your platforms with forces on the server and it will just work