PDA

View Full Version : Some things to think about with GAMING!!!



Bouncer
02-09-00, 10:30 AM
Okay,
This is going to almost be an article. (LOL)

Two things have to happen for good online gaming. One, "Latency" needs to be minimised. Two, "Packet Fragmentation" needs to be minimised. In short, properly sized packets need to be sent.
Easy nuff, right?

Muuuuuuuuahahahaha...ahem. Dream on, young Jedi. http://www.speedguide.net/ubb/wink.gif

Let's talk about the three main issues to online gaming. Latency, Fragmentation, and Retransmits.

Latency:

"Latency", is the time it takes for a packet to get from you to someplace else. The lower the number, the lesser the time, the better. We'll come back to this.

Fragmentation:

Packet "Fragmentation", is what occurs when a packet is too large to be processed. It's broken down into smaller packets that CAN be processed. This, takes time. Remember how we don't want to lose time to anything? PF wastes a lot of it.

Retransmits:

Sometimes, when fragmenting a packet, or for other reasons, errors occur. When this happens the system drops the packet. Poof. Gone. So NOW, the system asks for another one, and sends that request. This is called a "Retransmit". Your system bundles up the info and sends it back. This takes lots of time. This technically known as a: "bad thing"(tm).

What to do?!

We need to start thinking about properly sizing packets.

Properly sizing packets, means optimising YOUR system for what you're dealing with on the OTHER end. If you have DSL, and the other end is 56k, then you need to set YOUR in-game comm rate at 56k.

Otherwise, you will be sending packets that are too large for the server at the other end (the one running the game) and you will get packet fragmentation. The 56k line simply CANNOT deal with your DSL/cable sized packets, so it fragments them. If it drops one during this, it then ALSO asks for a retransmit. Your system responds and sends the info.

The system says:

"crap, ANOTHER oversized packet from that doofus with the cable/dsl!"

And fragments it so that it can deal with it. It then processes the packet and informs you that his bullet arrived first and you are now a statistic. So there. This is why fragmentation/retransmits are the Darth Maul of gaming. badBadBAD!!!

Combined, these both increase latency, sometimes dramatically. Latency though, can be most noticed in games when it comes and goes. This can usually be seen in Ping Spikes. "Ping Spikes", are where you're playing a game and suddenly it takes a LONG time to get info back, or frames start stuttering. That's almost always because something is temporarily causing packet fragmentation or loss, and the latency is fluctuating wildly. If you were to graph this through continuous Pinging, it would look like a series of spikes, almost like a heartbeat monitor in a hospital, thus, Ping Spikes. If it gets bad enough, in a desperate attempt to get caught up, the system will just drop a group of packets, and WHOOSH..that guys you were fighting will warp right by you, and oh, btw, you're now dead.

Starting to get confused and or annoyed?

Let's back up a second and imagine how this works from a different perspective. A good way to visualize all this is by thinking of the postal system. No, not "going postal", the postal system. :

Let's imagine that a 56k packet is the size of a letter. Now obviously, that letter is easier for the postman (network) to carry than a 640k packet, which is roughly 12 times larger. A BIG box.

On the other side, is a mail slot (game server on a 56k connection). The letter can be slid right through the mail slot, but the box is too big has to be torn down into itty-bitty chunks. If a letter is lost, it's less stuff that has to be resent. If the box is lost, you have to get all that data together again. Which takes more time.

Now, obviously, the box is a more economical way to move data, because you can move a bunch of it at once. BUT, the letter is less likely to be lost, more likely to not have to be altered at the other end to be processed (fit through the mail slot), and if it IS lost, it's easier to gather up the info and resend it.

As a consequence, because what we want is the fastest UPDATING AND RETURN of data, not necessarily the fastest raw download, it starts to become more desireable to move data in smaller, more compatible sizes.

There is a another factor that I've not really mentioned yet. Well, two, actually. "Default Gateways", and "Static Routes". We're moving into the realm of tweaking now, so experimentation will be necessary.

Default Gateway

The "Default Gateway" is the route that you by default use to access the internet. Easy enough right? Well..no. See, there's two sides to this. On the one side, your default gateway is the router you first connect to. On the other, it's the router that connects out to the internet. These are frequently two different devices.

As a result, finding a fast default gateway can make things faster and decrease latency. The reason for this is that you will still physically go out your directly connected router. After that point though, if you set a different default gateway THAN that router, the packets will be forwarded to THAT default gateway to reach the internet. Like so:

Before change:

You >>> first hop router >>> whatever is available to get out to internet (might be a T1)

You >>> first hop router >>> specific gateway to internet (might be a T3!)

You see the advantage I'm sure.

Now, obviously the key is to find out what gateways are available to you. Look for mapping programs, or trace programs. Run a series of traces, and see what addresses one or two hops away tend to pop up a lot. Those are gateways. If you can remove even one hop out of your path, you can reasonably expect the latency to go down by anywhere from 10-50ms.

Static Routes.

A "Static Route" is simply a set path to a destination.

Windows, has the ability to let you add a Static Route, so that packets to a particular destination will ALWAYS go out a particular gateway. This can help a bit because if you are in, say, Virginia, you will be able to tell windows that you always want packets destined for your friend in Texas to go out the gateway in Atlanta, as opposed to the gateway in New York.

This is done with the "route add"
command through a dos prompt. You can type in:

route add /?

For more information on how to do this.

Remember that these routes WILL NOT survive a reboot, so if you do something wrong, and the network stops running, reboot and it will be gone. Mind you, should you want to permanently add a route, there are ways to do that as well, though it a bit more involved.

I should point out that, even now, most new games were designed to be played over lans or dialup internet access. High speed internet connections aren't the primary system they were optimised for. As a consequence, some games (Falcon 4 comes to mind) are particularly poor at rates above 33.6kbps!

In Falcons case it has more to do with coding issues and the way the game engine updates things, particularly in campaign mode. But the point is, the more data you (and other players) send to the server, the more time it takes to send, be processed, and be returned.

For me, I'm currently playing the heck outta Half-Life /CS. And I've noticed that I seem to do better (not always, but frequently) when I have my rate set to that of a dial up connection as opposed to a cable modem. This seems to be especially true in larger games (up to 20 players) where there's a large amount of updating being done. I've actually seen how changing my rate took me from a very choppy (really unplayable) game to a smooth game.

In the end, you will have to find the combination that works the best for you and your connection, but it is important to remember that sometimes, less, is more.

Regards,
-Bouncer-


------------------
"Yeah Baby, YEAH!!!"


[This message has been edited by Bouncer (edited 02-11-2000).]

cableboy
02-09-00, 03:52 PM
Moved to online gaming forum.


jk. heheh... good points all!

cb

Voyd
02-09-00, 06:38 PM
uh, why would anyone host a server on a 56k modem? all servers are at least cable, and the vast majority are T1 or better.

as far as getting better results by lowering your rate, it probly depends on the game. but for sure this does not apply to action/fps games unless you have a horrible connection. i play UT every day, and by lowering the rate my ping goes way up and the game becomes sluggish, just as if id be playing at 10fps.

Bouncer
02-09-00, 08:09 PM
Some good thoughts there guys.

What I attempted to do was to paint a broad picture of the issues involved for people who may not have considered or known about these issues. I rather specifically did not go into MTU's, the IP stack, the OSI model, multihop routing issues and the like.

Fundamentally though, you are still bottlenecked by the single slowest link on your route. So the question becomes, do you want packet fragmentation, or not? If not, then you need to have a packet size that will pass through the slowest link as fast as possible, and is easily acceptable by the server on the other end.

Voyd, I'd tend to disagree. I'm not sure if you were referring to pay servers. I was really refering more to direct IP gaming, like through Gamespy. Some servers ARE set up on cable modems or DSL, but most private ones certainly aren't on T1's, since the cost of doing so would be tremendous.

Again, the point to me is that if you are on a cable modem, playing on a DSL server, if you set your rate too high, fragmenting will occur, increasing latency, likely increasing the number of retransmits, further increasing lag, and getting you killed more often. As always, your mileage may vary.

Regards,
-Bouncer-


------------------
"Yeah Baby, YEAH!!!"

Brent
02-09-00, 08:45 PM
Actually this probably does belong in the Online Gaming section :-)

[This message has been edited by Brent (edited 02-09-2000).]

PhoneTech
02-09-00, 08:52 PM
Bouncer, what name do you use in CS? I play almost every night. I'll look for you.

Raider_CTE
02-09-00, 09:37 PM
I think most everything relies on the ISP and your location.Right now I have a 56k modem but only connect at 45 or 48 and I have a friend that also has a 56k and connect at 48 or 50. Right now we both use the same ISP so our hops are less and our ping times are always below 250 usually around 200. When we were on different ISP's our ping were closer to 300. Just food for thought. We can both host games on the zone and find people that don't have very much lag and most don't live anywhere near us.

knicks00
02-09-00, 11:10 PM
Originally posted by Bouncer:
Okay,
This is going to almost be an article. (LOL)

Two things have to happen for good online gaming. One, "Latency" needs to be minimised. Two, "Packet Fragmentation" needs to be minimised. In short, properly sized packets need to be sent.
Easy nuff, right?
Muuuuuuuuahahahaha...ahem. Dream on, young Jedi. http://www.speedguide.net/ubb/wink.gif

Let's talk about the three main issues to online gaming. Latency, Fragmentation, and Retransmits.

Latency:

"Latency", is the time it takes for a packet to get from you to someplace else. The lower the number, the lesser the time, the better. We'll come back to this.

Fragmentation:

Packet "Fragmentation", is what occurs when a packet is too large to be processed. It's broken down into smaller packets that CAN be processed. This, takes time. Remember how we don't want to lose time to anything? PF wastes a lot of it.

Retransmits:

Sometimes, when fragmenting a packet, or for other reasons, errors occur. When this happens the system drops the packet. Poof. Gone. So NOW, the system asks for another one, and sends that request. This is called a "Retransmit". Your system bundles up the info and sends it back. This takes lots of time. This technically known as a: "bad thing"(tm).

What to do?!

We need to start thinking about properly sizing packets.

Properly sizing packets, means optimising YOUR system for what you're dealing with on the OTHER end. If you have DSL, and the other end is 56k, then you need to set YOUR in-game comm rate at 56k.

Otherwise, you will be sending packets that are too large for the server at the other end (the one running the game) and you will get packet fragmentation. The 56k line simply CANNOT deal with your DSL/cable sized packets, so it fragments them. If it drops one during this, it then ALSO asks for a retransmit. Your system responds and sends the info.

The system says:

"crap, ANOTHER oversized packet from that doofus with the cable/dsl!"

And fragments it so that it can deal with it. It then processes the packet and informs you that his bullet arrived first and you are now a statistic. So there. This is why fragmentation/retransmits are the Darth Maul of gaming. badBadBAD!!!

Let's back up a second and imagine how this works from a different perspective.

A good way to visualize all this is by thinking of the postal system. No, not "going postal", the postal system. :

Let's imagine that a 56k packet is the size of a letter. Now obviously, that letter is easier for the postman (network) to carry than a 640k packet, which is roughly 12 times larger. A BIG box.

On the other side, is a mail slot (game server on a 56k connection). The letter can be slid right through the mail slot, but the box is too big has to be torn down into itty-bitty chunks. If a letter is lost, it's less stuff that has to be resent. If the box is lost, you have to get all that data together again. Which takes more time.

Now, obviously, the box is a more economical way to move data, because you can move a bunch of it at once. BUT, the letter is less likely to be lost, more likely to not have to be altered at the other end to be processed (fit through the mail slot), and if it IS lost, it's easier to gather up the info and resend it.

As a consequence, because what we want is the fastest UPDATING AND RETURN of data, not necessarily the fastest raw download, it starts to become more desireable to move data in smaller, more compatible sizes.

I should point out that, even now, most new games were designed to be played over lans or dialup internet access. High speed internet connections aren't the primary system they were optimised for. As a consequence, some games (Falcon 4 comes to mind) are particularly poor at rates above 33.6kbps!

In Falcons case it has more to do with coding issues and the way the game engine updates things, particularly in campaign mode. But the point is, the more data you (and other players) send to the server, the more time it takes to send, be processed, and be returned.

For me, I'm currently playing the heck outta Half-Life /CS. And I've noticed that I seem to do better (not always, but frequently) when I have my rate set to that of a dial up connection as opposed to a cable modem. This seems to be especially true in larger games (up to 20 players) where there's a large amount of updating being done. I've actually seen how changing my rate took me from a very choppy (really unplayable) game to a smooth game.

In the end, you will have to find the combination that works the best for you and your connection, but it is important to remember that sometimes, less, is more.

Regards,
-Bouncer-



thanx bouncer for imforming me on how packets are being transferred when gaming. i have one question though. where do u change these settings or rates to try and match those of the person or server u are playing??
thanx for u help.


------------------
$COS$

Bouncer
02-09-00, 11:23 PM
Umm...
You're not really going to do this through the registry, as registry settings tend to be global.

You're going to do it through your individual game setup. It's basically trial and error, finding out what works the best for you, and remembering that the more players in the game, the busier the server.

Smaller packets will usually equal faster response and less lag in that environment.

Regards,
-Bouncer-

------------------
"Yeah Baby, YEAH!!!"

LoachDuke
02-09-00, 11:44 PM
Yes, these things all cause problems in multiplayer gaming.
The info you should state is the following: (rubbing hands together feverishly)
The current IP stack is made of several fields, and the packet can go from 20 something bytes to 64 kilobytes.
Many different things along the data pathway create latency. Your choice of packet size can affect the latency before and after the server. I.e.: your ISP's choices of switches and routers can affect it. We are all familiar with the MTU value, so if you optimize that, you reduce the latency between you and your ISP. If your game servers' ISP does not match, then you can see a problem before the server itself. It will have to re-size your packet in order to send to the server. Blah blah.
In my opinion, the biggest source of net-play latency is the growing army of high-speed junkies (sweat beading on forehead). We demand the 'fast play' but are not ready to accept the fact that many regions on Earth are not capable of such demands. We are are also very short on hindsight, forgetting what it was like to play at 28.8 or 56k. (huh)
If we want to play, then carefully select where the server is. If you find that your HL server is located in rural China (ah-so), chances are the game will be unplayable. Stick to the modern mega-cities for your game play.
Also, check the routing of your server with Neotrace or similar, you may be surprised to find that your data is flowing to Timbuktu, and then to your server located in your city. Or, the data could route through 'Ma Kelly's Laundry and Internet Service". Who can say where it goes? Arghhhhhhh! http://www.speedguide.net/ubb/mad.gif

Bouncer
02-10-00, 10:05 AM
Heya,

=SAF=Bouncer

Things to know:

1) I'm still pretty much a novice. I say that now so I have an excuse when I get my butt kicked. http://www.speedguide.net/ubb/smile.gif

2) I suck at sniping. I mean it. You hand me a sniper rifle and we are BOTH deadmen. (LOL)

3) I'm a handgun psycho.

4) I have a personal rule. When I start a new round, I will buy my pistol, but the first rifle I get will be the one that I take off the guy I just killed with my pistol. After that, I'll buy. Sometimes, I go without a rifle for a loooong time. (LOL)

"Body Armor, it's not just for fashion shows anymore."

My proudest moment to date was when the rest of my side got killed, and I whacked the last four guys solo. Mostly luck, but they suddenly started teaming up on me after that. (LOL)

Seeya!
-Bouncer-


------------------
"Yeah Baby, YEAH!!!"

gt_jones
02-10-00, 11:34 PM
Hey Bouncer,

You never mention

Latency:

"Latency", is the time it takes for a packet to get from you to someplace else. The lower the number, the lesser the time, the better. We'll come back to this.

But you never come back to this. What is the best way to reduce latency/ping. I am learning that ping and thoughput are not the same.

If this topic is planned for a future "Article" forgive me for being impatient.

Thanks

wilkie d
02-11-00, 03:13 AM
I would like to post this article on a few web sites that are directly connected to gamming,if its ok with the bouncer i will of coarse give him the credit.

Bouncer
02-11-00, 09:17 AM
No problem with that.
Let me clean it up just a tad.

Okay, all cleaned up. http://www.speedguide.net/ubb/smile.gif
I added some stuff in there on Static Routes and Default gateways and Latency. Re-read it, and tell me if you think there's something I obviously missed.

Regards,
-Bouncer-

------------------
"Yeah Baby, YEAH!!!"


[This message has been edited by Bouncer (edited 02-11-2000).]

wilkie d
02-11-00, 11:11 PM
thanks,looks KOO ill let you know how they like it and what kinda responses it gets.you rule