Add possibility to omit calling Reconcile methods per tick #283
Replies: 4 comments 5 replies
-
Reconcile doesn't invoke if there's no data. if (base.TimeManager.LocalTick % 3 == 0) Reconcile(...) //asServer true. If the client doesn't have a reconcile for the tick nothing bad will happen it will just catch the next one. |
Beta Was this translation helpful? Give feedback.
-
It is not about not sending Reconcile data to the client. Instead I want to avoid sending Replicate data to the server. With FN 3.4.3 (and all 3.x.x I tested earlier) the server still calls my Reconcile method's body (below
MoveData here matches MoveData's |
Beta Was this translation helpful? Give feedback.
-
Both replicate and reconcile methods will only call, if you actually call them in your code. If you do not have any lines calling the methods, they will not run. However, replicates are intentionally run(assuming you call them) even when data is default. This is important because you might want to do something like add gravity in the replicate. But on the plus side, unless you are actually changing inputs the data will not be sent to the server. Keep in mind, there is some redundancy but eventually it stops sending. |
Beta Was this translation helpful? Give feedback.
-
Added as gotcha/limitation inside guides. In prediction v2 this is much less of a concern/problem. Expect to see better options in version 2. |
Beta Was this translation helpful? Give feedback.
-
FishNet's CSP using Reconcile and Replicate methods can't well work with on-demand updates, meaning that you always have to call the Replicate method with some data per tick on the client. But not calling the Replicate method is something you want to do to safe bandwidth, especially if the Replicate data struct has some more properties.
If you instead just omit the call of the Replicate method on the client, the Replicate method on the server is called with a default replicate data object as argument, which in most cases is no valid data.
Additionally there are use cases where objects (e.g. projectiles) may not want to send user input data at all to the server but still want to receive more complex updates from the server and benefit from PredictedObject implementation (Interpolation, etc.). In those situations NetworkTransform just doesn't send enough data. Other frameworks have additional components, for instance NetworkRigidBody. But even those might not be enough. In such situation (e.g. when wanting to send transform, rigidbody and other data - Only those properties you really want to sync - and don't want to send actions) the only way to always receive valid Replicate data in the Replicate method body on the server is to send an empty Struct. This probably is not bandwidth-friendly.
Proposal:
Beta Was this translation helpful? Give feedback.
All reactions