Hey everyone, hope you find this topic interesting! I'm excited to share a few new things I learned, and I found a few new FREE tools to help with building Multiplayer games too! Check 'em out!
@tarriochu95 Жыл бұрын
this is extremely helpfull and insane. I will recomend this to my peers
@git-amend Жыл бұрын
Great to hear!
@seansmith502211 ай бұрын
Hey I know it's a shot in the dark but I have a problem when running on the client and pressing q to teleport, it teleports back and forth a random amount of times as the client's lastserverstate is getting set to 20 on the Z when it shouldn't be. This doesn't happen when the clientnetworktransform's authority is set to server but when it's set to server, there's no instant movement. So the point in the video at 4:00 never works for me unless I'm the host and I'm certain the code is the same, I've gone through it so many times. Any help would be greatly greatly appreciated!!
@josuealgarzia10 ай бұрын
hi! I solved this problem by getting rid of both Client Network Transform and Network Tranform atached to the player prefab and using a ServerRpc to coordinate updating the location of a given client to all other clients: [ClientRpc] void SendToClientRpc(StatePayload statePayload) { if (IsOwner) { lastServerState = statePayload; } else { moveThisPlayer(statePayload); } } I don't know if it's a correct solution but it worked for me.
@jack-zc3gj Жыл бұрын
these are great! thank you!
@git-amend Жыл бұрын
Thank you!
@castlecodersltd5 ай бұрын
Another great, helpful video. Thanks 🙂
@git-amend5 ай бұрын
My pleasure!
@joshdev0911 ай бұрын
i have this implemented in my state machine movement controller, and im having a issue, i have a boat with a rigidbody and when the boat moves i want the player to move with it, but the server thinks the movement is wrong and stops the player from moving, so if the object is parented i need it to include the parents velocity and position how would incorperate this
@mrtnt1666 Жыл бұрын
is there a using parameter for "CountdownTimer" or something? sorry having some trouble
@git-amend Жыл бұрын
There is a Timer class in the Utils folder of the repository (and some other useful classes) github.com/adammyhre/Unity-Multiplayer-Kart/blob/master/Assets/_Project/Scripts/Utils/Timer.cs
@git-amend Жыл бұрын
There is a Timer class in the Utils folder of the repository (and some other useful classes) github.com/adammyhre/Unity-Multiplayer-Kart/blob/master/Assets/_Project/Scripts/Utils/Timer.cs
@mrtnt1666 Жыл бұрын
@@git-amend Thanks! I'm having the same problem with "AuthorityMode and "ClientNetworkTransform" did I miss something else or no?
@git-amend Жыл бұрын
@@mrtnt1666 I believe that was created in the episode before this one. At any rate, all files are in the repository. Look in the /Scripts folder.
@desine_ Жыл бұрын
thank you
@josuealgarzia10 ай бұрын
thank you so much for your videos, they are short but packed with information, which is why I have already watched them several times. what I can't understand is why the reconciliation happens so often, at least in my game, since I'm doing a fps conpetitive game I can't set the threshold above 0.1f. I know it is a low threshold but in theory the discrepancy between the server and the client must be almost zero without lag or cheating. However, I notice that the discrepancy between the client's position according to the server and that of the client widens very quickly causing a reconciliation almost every frame. I also investigated to make sure the motion and gravity calculations were 100 percent deterministic and that it wasn't a problem given the limitations of floating points but still the problem persists. do you have any advice?
@desine_ Жыл бұрын
I have a problem. My client's authority flickers on the server. Because of this, when server goes through ProcessMovement for Reconciliation check it tries to add velocity - which is not possible for kinematic rigidbodies Do you have any idea why this is happening?
@desine_ Жыл бұрын
private void Extrapolate() { if (IsServer && extrapolationTimer.IsRunning) { //transform.position += extrapolationState.position.With(y: 0); body.velocity = extrapolationState.velocity.With(y: 0); } } I know I'm wrong about signing velocity, but if I do this "transform.position += extrapolationState.position.With(y: 0);" the client flies away at insane speed
@git-amend Жыл бұрын
Sorry, but I don't really have enough information to debug that issue for you. Debugging Netcode issues is challenging. It could be any number of things, but I would suggest looking first at the method calling Extrapolate, and also the conditions for ending the extrapolationTimer.
@donavilon Жыл бұрын
Hello I'm having some wierd issue that the te extrapolation does not stop, and the server keeps going away
@git-amend Жыл бұрын
I'll need more information to be able to give any advice. Make sure to compare your code against the code in the repository. You should be able to spot any discrepancies there.
@muriilouwu4 ай бұрын
did u find a solution? my problem is the same, even after the method extrapolate is called, the game continues to extrapolate the position and never give back the player's power to change its direction
@DavidVerified Жыл бұрын
Oh maaan I'm just too stupid to understand this... I mean you showed at 6:54 that the server and laggy clients position are almost identical on server side. Only for the laggy client everything else is lagging behind. So why shoud you need Extrapolation to simulate movement on serverside? They are almost identical. So Extrapolation is supposed to benefit the lagger? EDIT: Oh wait!! Is it actually supposed to benefit everyone else by even removing the smallest discrepancy between server position and laggy-player position on serverside?
@desine_ Жыл бұрын
you are not stupid, you just need some mode time and you will get there
@git-amend Жыл бұрын
You are correct - extrapolation is for the benefit of the other players, with the hope that the lagging player will recover and resume playing as normal.
@desine_ Жыл бұрын
It's ok at this point that client interpolates constantly, right?
@git-amend Жыл бұрын
Yes, you can use both interpolation and extrapolation at the same time.