Hiya,
while working on mprEdit i started thinking about the way the netcode of LFS is working. I think most people here agree that lfs multiplayer is working remarkably well, given the nature of the internet.
While i am trying to figure out how to get hands on the lapcount or racetime information i tried to get a bigger picture of the communication.
My theory:
Client sends controller input to server
Server collects all clients controller input
Server sends to all clients the controller input of all other clients
Clients do physics calculation (the actual movement of the cars)
And every now and then (few times a second) there is a "position" packet containing the actual car position from the server to all clients to be sure that each players position is in sync on all clients.
What i am unsure:
Who keeps track of the current standing in the race? Server, Client, both?
Who decides when to display a split time, when a lap is finished, when the pit entry/exit line is crossed? Server, Client, both?
So what is your opinion? Do you agree/disagree? Any knowledge? This thread is open for all speculation :-)
while working on mprEdit i started thinking about the way the netcode of LFS is working. I think most people here agree that lfs multiplayer is working remarkably well, given the nature of the internet.
While i am trying to figure out how to get hands on the lapcount or racetime information i tried to get a bigger picture of the communication.
My theory:
Client sends controller input to server
Server collects all clients controller input
Server sends to all clients the controller input of all other clients
Clients do physics calculation (the actual movement of the cars)
And every now and then (few times a second) there is a "position" packet containing the actual car position from the server to all clients to be sure that each players position is in sync on all clients.
What i am unsure:
Who keeps track of the current standing in the race? Server, Client, both?
Who decides when to display a split time, when a lap is finished, when the pit entry/exit line is crossed? Server, Client, both?
So what is your opinion? Do you agree/disagree? Any knowledge? This thread is open for all speculation :-)