so I am messing around with CSP, learning how it flows (going for server authoritative movement with prediction), and I am using currently version 1, on the latest version of Fishnet 3.10.2. I am sure the issue is me, so forgive what might be a simple fix, but I am finding an error consistently when I use CSP in builds, I am not having the same issue in editor, just in builds. The error is c Connection Id [0] Address [127.0.0.1] sent too many past replicates. Connection will be kicked immediately. I have added time manager to my network game object and also set the allow tick dropping to see if this helped . I am looking for any advice to overcome the error please 🙂
#CSP version 1 - too many replicates error
36 messages · Page 1 of 1 (latest)
Error occurs with 2 builds or 1 editor and build?
Should be impossible to get that kick unless client is intentionally trying to exploit
2 builds , one server, one client. Inside of unity editor no kick but def kicks me as soon as I spawn
Either one webgl?
nope all local on my computer
[Replicate]
private void PawnMovement(MoveData md, bool asServer, Channel channel = Channel.Unreliable, bool replaying = false)
{
reporter.Debug(" Pawn Movement | md.Jump value " + md.Jump.ToString());
Vector3 move = new Vector3();
if (true)
{
if (md.Grounded)
{
move.x = md.Horizontal;
move.y = gravityFlipped; // * Physics.gravity.y;
move.z = md.Vertical;
if (md.Jump)
{
reporter.Debug(" Pawn Movement | we are trying to jump ");
reporter.Debug(" Pawn Movement | we are trying to jump | nextJumpTime before value " + nextJumpTime.ToString());
nextJumpTime = Time.time + jumpSpeed;
reporter.Debug(" Pawn Movement | we are trying to jump | nextJumpTime after value " + nextJumpTime.ToString());
move.y = jumpForce * (movementSpeed - gravityFlipped);
}
else move.y = gravityFlipped * (float)base.TimeManager.TickDelta; // * Physics.gravity.y;
}
else
{
move.x = md.Horizontal;
move.z = md.Vertical;
}
move.y += gravityFlipped * (float)base.TimeManager.TickDelta; // gravity is negative...
if (navmeshController)
{
reporter.Debug(" Pawn Movement | Navmesh Controller ");
transform.rotation = Quaternion.Lerp(transform.rotation,
new Quaternion(0f, characterLookAtAngle.y, 0f, characterLookAtAngle.w),
(float)base.TimeManager.TickDelta * rotationSmoothTime);
characterController.Move(move * movementSpeed * (float)base.TimeManager.TickDelta);
}
if (rigidbodyController)
{
reporter.Debug(" Pawn Movement | Rigidbody Controller ");
transform.rotation = Quaternion.Lerp(transform.rotation,
new Quaternion(0f, characterLookAtAngle.y, 0f, characterLookAtAngle.w),
(float)base.TimeManager.TickDelta * rotationSmoothTime);
rb.AddForce(move * movementSpeed * (float)base.TimeManager.TickDelta);
}
if (!replaying)
{
// effects | I.E. Jumping or Movement effects
if (!md.Jump)
{
reporter.Debug("This would be a no jumping effect");
}
if (md.Jump)
{
reporter.Debug("This would be a jumping effect");
}
}
}```
[Reconcile]
private void PawnReconciliation(ReconcileData rd, bool asServer, Channel channel = Channel.Unreliable)
{
if (navmeshController)
{
transform.position = rd.Position;
transform.rotation = rd.Rotation;
}
if (rigidbodyController)
{
transform.position = rd.Position;
transform.rotation = rd.Rotation;
rb.velocity = rd.Velocity;
rb.angularVelocity = rd.AngularVelocity;
}
}```
those are the replicate and reconcile methods
@hard lion
version 3.10.2
let me do a quick check
Working on my job project anyway today so may as well just update it's FN and give it a whirl
im wondering if its related to my timing of when i use your timemanager
i added your subscribe and on-tick methods to my internal time manager, then have that invoke a custom event system, where my internal scripts listen for that
when my internal system hears your tick from your time manager, then it runs a specific method myside
it shouldnt even be possible
its all done internal based on the redundancy count in predictionmanager
@hard lion Custom Time Manager-
VexstormBehaviours - is a base class on most of the scripts, it uses Networkbehaviour as its base.
- Inside this script I have the subscribe to method for your time manager
- Inside this script I have the OnTick and OnPostTick methods
-- theses methods invoke events when ran
VexstormTime - is a singleton class
- Inside this script i am checking if the event triggered (listening for it) and if so , i invoke another event that is listened for it, I do this so i can have a central one stop place for these timed events to take place
AvatarPawnMotorBase - is a class that has a base of VexstormBehaviours. It is used for base movement logic
- Inside this script it listens for the event to be triggered and when it does, it invokes a specific method i call RefreshHandler
My question is this, these events i am listening too, i believe i am adding the listener in the awake, or on start client. Should I be doing this in the onstartnetwork? i think that's where my issue is??
custom time manager?
Does the kick happen soon as you spawn in by any chance?
Also can you try 3.10.1 please
@pearl forge #announcements
Thank you brother
@hard lion are you still working on the too many replicates error. I seem to still be getting that inside of builds but not inside editor, on version 3.10.3
Here is the complete stack trace related to too many replicates, not sure it is supposed to be a common issue currently under perdiction v1 where its still being worked out, or perhaps I missed something or doing something incorrect? `
I'll look tomorrow, day off today. Please ping me then.
But there's no known issues with pv1 and this is the first report of this ever happening so unfortunately no immediate advice. I'm wondering if something is corrupting the packet and that just so happens to be where it's being caught.
Enjoy your day off my brother, I will investigate it further, I also agree something might be currupting the packets, or perhaps its the way I am using CSP. I will retest an example from fishnet, to see if its my project is bugged or perhaps just my code. Will let you know the results
do you still get this error when disable your hooks to the Tick events in your VexstormTime and implement a basic subscription to the TimeManager Events directly in your Pawn Script?
I removed my custom implementation of how I was using the fishnet prediction and only did precisely as the demo suggested, in terms of methods, and calls,. All prediction-related methods, and subscriptions, are now all being done in a motor script for my pawn. Using one pawn as an example I am still getting this error with too many past replicates to test out prediction with a rigid body. In the editor, my implementation is running fine. Its in the build where my implementation fails. Error as follows : ```c
@hard lion or really anyone, what can i troubleshoot from my end, to see why the software seems to think I am sending too many replicates. Obviously if I am that's bad for a number of reasons, including too much data consumption, speed challenges etc. I am using a predicted game object with rigid body set as well. Would appreciate any guidance on idenitfying where this issue is stemming from.
I'm off tomorrow but leave some notes for me plz. What you're building on. And also if you uncomment the kick and return what happens. Also print the object name when the kick would occur to make sure it lines up with clients object name
__This is what I do know: __
-I have found that the too many replicates error is definitely a result of "something" in my unique prefab (a bipedal with animation if it matters). The prediction coding I am using is basically a mirror of prediction-based logic straight from the rigid-body example you have already provided. In the editor it works but not inside a build. In a build I get kicked immediately with the too many past replicates error.
-If in the same scene, I go and take your exact prefab (the sphere with legs) and make an exact script copy of your rigid body prediction controller ( except I added a cinemachine camera as owner, so I could follow the sphere) the editor works fine, build will load and work fine unless I add another client, then I get the following error. The scene is still playable on both builds, and prediction seems to work well, although the error as shown in red above is presented on the first client.
I am honestly not sure why the "too many past replicates " is coming up on my specific prefab, as the methods and requirements for prediction (components and all), are identical to the fishnet example, aside from the animation, and additional forces calculations. I may comment out the code for the animation to see if that's what is triggering this odd behavior. Maybe even try to use older input system verus the new one, in case thats something that might be triggering it.
I am using Windows 11 Pro, all local testing currently, so not a remote server. Builds and editor are under windows. Unity Version 2021.3.28f1, with Fishnet Standard version 3.10.4. Any ideas, things to test would be very much appreciated!
I was able to overcome this issue with too many replicates, @hard lion by resolving what should have been an obvious flaw in my rigid body controller. The long and short, not only did I subscribe to the subscription manager by setting true, when the network has a connection, but I also subscribed to the event separately based on the on tick and methods. I basically oversubscribed causing multi instances of replicates to flow from the same client. So this is resolved. I have a separate issue with movement in builds, but i will open a different ticket for that to keep these organized.