Closed tedbarth closed 1 year ago
I tested again. It is working when the latency is added on both sides, the client and server: The Client sees the direct response and the server handles it 1000 ms later. I'm pretty unsure if this is correct. This would require all peers to have the same latency. How would I simulate the situation where all clients have 100ms pings and just one 1000 ms?
Could it be that the latency simulator adds latency to one communication direction only, for instance, only outgoing packages, but not incoming?
EDIT: My apologizes, I have confused the bug issues. I will move this and all following comments into a separate issue, soon.
@FirstGearGames I uploaded an example project with video displaying the problem: https://github.com/tedbarth/FishNet-Bug-Doubled-Forces
I suspected RigedBody2d.inertia
which affects the rotational reaction to an angular force, but printing them both per tick showed that they are the same.
Debug.Log($"Inertia: {_body.inertia}, Mass: {_body.mass}");
Another hint: If I do not call my [Reconcile] private void Reconcile() { ... }
method for the owner, the problem disappears. Obviously this is not a solution: I want reconciliation. :-)
Unity version: 2021.3.18f1 Fish-Networking version: 3.3.2
Describe the bug When enabling the Latency Simulator with some latency > 0 ms, CSP with RB2Ds prediction does not work because the latency seems to also delays the Physics simulation: For a latency of 1000ms the RB hosting object and its predicted Graphical Object is reacting to its forces applied at first after 1000ms have past.
I have checked the execution of network tick and post tick callbacks, they are fine at the setup tick rate. Rigid bodies are getting their forces applied on network tick correctly and unaffected of latency.
I'm unsure if the Latency simulator does affect the physics simulation steps or the physics simulation is not updated on the client at all.
To Reproduce Steps to reproduce the behavior:
Expected behavior The RB should react on its forces immediately and get corrected at first 1000ms (if necessary at all).
Relevant methods of my network motor script of the game object using CSP