- Home /
When to process input in networked multiplayer game?
I watched "Deep dive into networking for Unity's FPS Sample game - Unite LA" along with a few dozen other GDCs on this topic and am a bit confused on how input is handled for high performing clients that run the game faster than network tick rate.
I am in the process of creating a networked game loop that resides in Update and is called at a regular interval. I've simplified my update loop into the psuedo-essentials:
void Update()
{
//Receive Packets
while (realTime > networkProcessedTime)
{
//Figure out how many network steps should process (generally 0 or 1)
networkStepCount++
}
for (...networkStepCount...)
{
RunNetworkStep();
}
//Send Packets
}
My question is with regard to input. Players playing at high frames will generally be able to take more actions between network steps than can be sent over in a single frame. For example a client running at 240 fps and a network tick rate of 30 might do the following:
Frame 1: Move Left
Frame 2: Move Left
Frame 3: Move Right
Frame 4: Move Right + Up
Frame 5: Move Up
Frame 6: Move Down
Frame 7: Move Down
Frame 8: Move Down
Network Step: ?
Because the game is running 8 times faster than the network tick rate I am having trouble keeping high frame rate clients responsive to their own input. It seems to me that input should be tied to the network tick rate. But is that really how multiplayer games handle this? Is input tied to network tick rate?
Thank you for reading!
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
network player only flip on LAN Host not in Lan Client 1 Answer
Light.color Sync ? 1 Answer
Controlling a network game? 0 Answers
Unity NetworkTransformChild - Syncing the Child of a Child 0 Answers