Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About hornta

  • Rank

Personal Information


  • Github

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. But isn't it pretty common to choose to run the server simulation in a pretty low tickrate, say 20 frame. If I am polling input on the client every 20 frame I would risk to "miss" a key that has been held down between the "ticks"?
  2. But now you can't choose to run the server at maybe 20 hz while you run the clients at 60hz or even 128hz?
  3. In my current implementation of netcode I followed Gabriel Gambettas article to implement client side prediction and input handling. For each game loop update I capture the input into a packet like this: 1 bit - Go west 1 bit - Go east 1 bit - Go north 1 bit - Go south 4 bit padded 4 bytes - deltatime(float) <- How long did I simulate this command on the client Why do I include the deltatime for each input command? Because I need the server to know for how long to simulate this input for my entity. The problem with this implementation is that I have to constantly send input commands even when my keys are not changed. For example say my computer runs fast at roughly 200 FPS, that is 0.3 ms. I will be sending 200 packets each second to the server. With 10+ players the server needs to simulate 2000 packets / second, and that is if everyone is running their clients at 200 FPS. I should constrain the interval that I capture the input a fixed interval, say 60 FPS. I will save a bit, but it still feels like I can do better. I have read that I only should change input delta. So only when my input state changes I will send a new packet with the new command. But then I can't rely on the deltatime I will send along with the input state to the server. It bugs me that neither Gabriel Gambetta or Valve is talking about "ticks" as a time unit or using it with simulation. https://developer.valvesoftware.com/wiki/Latency_Compensating_Methods_in_Client/Server_In-game_Protocol_Design_and_Optimization. If you know some article I should read or if you have any input on this I will be very happy.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!