XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

Best way to reduce Network lag?

Last post 8/28/2009 9:42 PM by jwatte. 3 replies.
  • 8/28/2009 5:10 PM

    Best way to reduce Network lag?

    I understand that using prediction will help smooth out the game, but what ways can I actually speed up the Networking? Is it the more info I send across the wire the more it lags?

    Currently I have up to 4 players, where everyone sends their input to the host and the host sends back what to draw and where to draw it. It's not the best way (but it's the easiest for me). Now I was sending information about positions every frame, and it worked well. But simulating poor networking conditions looked terrible. So I thought if I send the information every 2 or 3 frames it might speed it up. But it just made the good connection look worse, and was hard to tell any difference with the poor connection. If I develop prediction will it look better on both speeds, or shall I send info every frame and only use prediction on poor connections (and how would that even work?)

    Basically, are there any guides on what actually reduces lag the most?
  • 8/28/2009 8:23 PM In reply to

    Re: Best way to reduce Network lag?

    FlukeDude:

    Basically, are there any guides on what actually reduces lag the most?


    Network latency is a direct result of two things:

    • How many miles of wire the data must travel along
    • How many switches/routers/hubs it must pass through

    To reduce latency, you need to move your players physically closer together, and put them on the same or closely linked networks to reduce the amount of switching.

    Controlling either of these things is not usually feasible for Internet games (although it might work fine if you are designing for a LAN party) so latency is usually just a fact of life that you have to live with and work around, not something that you get to directly control.
    XNA Framework Developer - blog - homepage
  • 8/28/2009 9:18 PM In reply to

    Re: Best way to reduce Network lag?

    Well, technically latency should also be affected by how many connections are pending, on the server side... Correct me if I'm wrong.

    And a faster/better handling of those connection would reduce the lag times...
  • 8/28/2009 9:42 PM In reply to

    Re: Best way to reduce Network lag?


    a faster/better handling of those connection would reduce the lag times

    Either the server can keep up with all packets, in which case there is no lag, or the server cannot keep up, in which case lag is not your biggest problem.
    However, almost all servers are time-stepped -- simulate one physics frame 60 times a second, say. It is true that waiting for the next simulation step after a packet arrives does add some latency.
    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
Page 1 of 1 (4 items) Previous Next