April 27th, 2021 Livestream Q&A: Is the Vehicle lag in Multiplayer a challenge?

April 27th, 2021 Livestream

Q&A: Is the Vehicle lag in Multiplayer a challenge?

https://youtu.be/K58fUTWGpzU

This question has a related video
Suggested Wiki Reference Code <ref name="yt-K58fUTWGpzU">[https://youtu.be/K58fUTWGpzU YouTube - April 27th, 2021 Livestream - Q&A: Is the Vehicle lag in Multiplayer a challenge?]</ref>

Topics

Transcript

is the vehicle lag and multiplayer challenge oh hell yeah it's like, anything that has to do with, like physics and multiplayer is like pain in the ass just because of like all the different like use cases and states that can happen, it's it's a mess it's an actual mess just having okay so I usually use this example whenever I talk about the complexity of multiplayer right so say that you have a light switch in your game right, you have a light switch right you walk up to it you press the button it turns on the light right okay that's two states on that light switch it's on or off there's also two states on the light switch itself but or like the the switch itself right so okay four potential states there right there's also like the cases of like if there's bugs in the game which you have to like kind of think about as well like the different potential states unless you make something deterministic where you know that like I mean it's possible to program this light switch where you cannot turn on the light unless the switch is in the state which you can check locally okay right locally okay right multiplayer makes that 10 times more complicated that simple example just because you can have states where client can walk up to a switch and flick it and nothing happens okay and you're like that's annoying we should give the client some feedback when they're hitting the switch that they did hit the switch all right you walk up to the switch you flick it and nothing happens like then nothing happens because like then this cases of like what if the switch is on a server but it's not on client, like what is the issue like there's a bunch of reasons why the issue can happen like is it locally on client where the bug is happening like or is it not receiving the replication of the switch, so it just ends up that like that light switch can be in so many different states by itself and that's just from like the simple two-state example now let's look at vehicles where there are a lot more states because you're driving there's also movement which is also like you can't, in networking you can't like have a server tell a client like here's where the car is here's where the car is here's where the car is here's what the car is because that makes it super laggy because the update rate on client will not match the server and it's like almost it's like theoretically possible I guess but it's like almost practically impossible to have them do that so what you need is you need to have client-side prediction where the client would be like I think the va is going to be over here but then you have the problem like okay but when the server tells the client that no the car is over here then you need to adjust for that but if you adjust for that every time you get a message from the server then you're going to end up in the same situation where the vehicle is just like constantly lagging around so which means that you have to have client-side prediction that's also smart enough to like figure out what how to handle when states mismatch what happened all the time because you know client-side prediction can only do so much like you can only predict so much it's kind of like rolling a die and be like ah it might be six and if it's not six you're like oh it's two like this is a weird way to explain this but, it's complicated okay but that's that's what I'm trying to get at here like there's so many variables in play and so many things that can go wrong and you need to make like smart systems to make it fluent for the player on the client side, etc etc so it's it's just like yeah client-side speculation it's just like it's such a mess making multiplayer games you guys, it's it's it's a it's a miracle that the game works in multiplayer right now, but the positive thing here is that there's still so many things we can do to optimize there's still like it's not like, we're in a position where where we don't know we don't know what to do next to improve multiplayer like we have a big list, so yeah long story short yes it's very tricky to do vehicles and clients or it's very complicated six plus select six is four