4 Replies Latest reply: Aug 6, 2010 10:22 AM by 843853 RSS

    Game Server tick rate

      I've written a game server that has it's tick rate set to 100 MS, and after each loop it will sleep for (100-timeSpent) milliseconds, or skip the sleep if processing took over 100 MS. With 2,000 bots connected to the server on a VPS I purchased, it takes 102 MS to do all the code in the main loop. I was told by someone that this is unacceptable, because the 2 MS will make the server "unsynchronized", and that it will delay everything by 2 MS. I understand this, but I don't think 2 MS of lag will bother any players. This person also claims that on every real MMORPG out there, all lag is caused by the network, and the server hardware is never ever responsible for even the slightest amount of lag. I was just wondering if what this person saying is true, do I HAVE to improve my code to run in under 100 MS or get faster hardware?
        • 1. Re: Game Server tick rate
          ry60003333 wrote:
          do I HAVE to improve my code to run in under 100 MS or get faster hardware?
          Have you experienced any actual problems?
          • 2. Re: Game Server tick rate
            Nope, I just developed a really fast algorithm to update the 2,000 players, and the 2 MS isn't causing any real problems. Some people are just saying that its unacceptable in game server development to have this kind of thing.
            • 3. Re: Game Server tick rate
              I don't think you are going to create the perfect environment where you can keep everything 100% synchronized, but you can correct for errors, for example by forcing the clients to fix their state to the server's reality every X ticks. It might be necessary to incorporate some form of interpolation here as well, as otherwise the hard syncs might cause players to jump from spot A to their real spot B for example.

              Its no easy material and unfortunately I'm only really familiar with the theory behind these things myself. I've seen some very interesting discussions about these matters on [http://www.javagaming.org|http://www.javagaming.org] though, you might want to check that forum out.
              • 4. Re: Game Server tick rate
                The client can handle packets that are delayed, the players just move at a faster rate. The 2 MS was with 2,000 test bots connected, and it wasn't noticeable. When the amount of lag between update packets gets around 350 MS, then you can see things slowing down. But thats for the link to the other forum, I will definitely take a look at it!