Lag Compensation

From CLUMP
Jump to: navigation, search

(Note: a full discussion of networking issues is beyond the scope of this help page. The writer has a non-expiring Network Certification from CompTIA. However, any errors are due to oversimplification of concepts and concerns to keep things within the intended audience’s grasp. For a full treatment and more precision, consult a book or article on various networking topics such as the OSI model for a more nuanced discussion of physical and logical order of networking and its related protocols. For a general grasp of what is happening when your Clan Lord client is trying to connect to the Delta Tao’s Clan Lord server and ways to root out problems, read on…)

Lag, or "weather" as it's called in character is when your ping rate rises above about 250 milliseconds (.25 seconds — roughly equivalent to 1 frame in Clan Lord). “Ping time” is the time it takes for a packet of data (in CL packets are usually under 1000 bits) to reach the clan lord server (or any server be in web, ftp streaming, etc for that matter) from your computer and receive a reply. The longer the latency (or delay) between sending a receiving a reply from the server, then the less responsive your character becomes. Because of this delay between when you act and when the server receives the command, you over shoot your targets and sometimes end up a couple of exile lengths from where you intended to go. A lot of people blame latency on DT and the CL server, but, as many a traceroute command has shown, it is almost never their fault. It's usually closer to home or on some ISP’s intra-network in between you and the Clan Lord server — well beyond Delta Tao’s control. If everyone in the world experiences lag, then you know it's the Clan Lord server or within its ISPs network. If it's just you, or a few people in your group, you know it was a router closer to you (and potentially others), between you client and DT’s network provider. The only time server lag is expected and noticeable is that caused by DT is right before an update on Wednesdays, when the World Gerbil GM loads new code and backs up the game databases. Sometimes the GMs are kind enough to post a message about such weather problems, sometimes they're not. A good measure of how close the network problem is to the CL Server, without doing a trace route is if the entire clanning world feels a hiccup — it could be the server or the within the server’s network or coming out of the CL server’s network.

If your latency is fairly static (if it's usually around .5 seconds and doesn't change very much due to your location) then you can compensate by thinking ahead of what you see and reacting earlier than you would. You know that it take .X seconds for a command to register, so go someplace and practice your timing by running in circle around a building, and then graduating to ferals and other quick prey once you've mastered that.

Other Causes of Lag

WiFi Router in Power Saving Mode

When WiFi routers are in power saving mode, they favor energy efficiency at the expense of performance by queueing packets over time. This means that there is a delay between the time the packet is received and resent both upstream to the CL server and downstream. The fix is simple if you have administration of the router or your machine. Simply make sure power saving mode is turned off. This is a feature enabled by default on my WiFi routers as well and will impact performance of any network applications that depend on low latency connections: mostly gaming or any real-time control system.

Some laptops themselves (such as MacBook Airs [MBAs]) have a power saving mode they go into by default. The workaround (until at setting to prevent low power mode is revealed) is to ping any server like so:

ping -i 10 -q ADDRESS

where ADDRESS is a server such as apple.com.

See this post for a simple script one can use as a workaround while playing CL : BASH latency-fix.command by Dyaus

Ref: CNET WiFi Dropouts in OS X… Thanks to D’ead for providing this info.

If you cannot control any of the above, then one alternative is to connect via a hardline such as Ethernet to the router. If this is not possible, then an access point extension [APE] (preferably one that has dual channels) which you can connect to the WiFi router then to the APE via Ethernet can be another solution.

Network Overload

Like processor overload, if your computer or router (though less likely) is swamped doing other networking tasks such as file transfers while you clan, you can get several seconds of lag. I've experienced this problem first hand when someone downloads a large file off of my computer over TCP/IP (the protocol the internet runs on) while I clan. The good news is that once the file transfer is complete, the bug goes away.

To monitor network Input/Output and/or the system load in OS X you can try out menumeters. It's a great little program, and it's donation-ware.

Wireless Signal Too Weak

Mac-wifi-option-menu-click.png
Sometimes, when you are far away from your wireless access point (WAP), or you have metal in between the antenna and the WAP, the signal is too weak to successfully transfer the data being sent. When this fails the data has to be resent, which delays the update of either the screen, your input, or both. Try moving closer to the WAP or move the WAP closer to where you usually clan.

On OS X, you can check the signal strength by option-clicking in the WiFi menu item. It will display the RSSI (received signal strength indicator) in decibels/meter (dBm), as well as a noise floor in dBm. taken together you get a signal to noise ratio (SNR). In this instance an RSSI of -60dBm and a noise floor of -88dBm means that my SNR is 28, which is good enough. Anything below 20SNR, and you will experience anything from intermittent freezes to disconnects.

Other sources of interefence, especially with older access points are cordless phones, microwaves, refrigerators, wireless mice and wireless keyboards.

Wireless Routers and Wireless Access Points (WAPs), come in many styles and quality levels. Even the best router/AP will eventually fail. Large temperature extremes and heavier use will shorten the life of any WAP.

In that case replacement of the access point with an 802.11N or 802.11AC type are your best choices. 802.11N access points (APs) are less expensive (~$50–$160) than 802.11AC APs (~$130–$250), but 802.11AC APs/routers have more throughput.

802.11AC and 802.11N are backwards compatible with BGN and some 802.11N APs also support 802.11A (which is on the 5GHz band). If you do replace your WiFi access point because of a weak signal, look for ones with beam forming. If you are in a congested LAN (with many devices using your WLAN) getting a wifi router with QoS (also called “Gaming Grade Router” or “Port Priority”) and Dual Radios can help alleviate internal Wireless Local Area Network (WLAN) problems as well.


—> 2014 802.11AC is the most current standard and is even faster but should not improve latency anymore than other protocols. However, if your WiFi network is very busy, the increased bandwidth of 802.11AC and above can alleviate internal congestion.


Other means of Diagnosing WiFi issues CNET:Diagnosing Wi-fi Signal Quality

Modem Too Cheap or Equipment Overloaded

If you're still on a modem, not all are made equal some cheap ones may route a packet much slower than others. Also if you're on a shared connection or going through a busy network lag could be caused by the overloading of network equipment before you even get out to the internet.

ISP is Terrible

Not all ISPs are created equal, some are on a back bone (A main through fare on the internet) while some are leasing their connection from others ISPs which are leasing their connection, etc. and they might be far away from a backbone. If it is your ISP, consider switching ISPs.

Processor Overloaded

Sometimes when you are running multiple programs or running many 3rd party extensions, your processor can't send your commands to the server right away. In that case quit some open applications to free up time on your CPU. If that doesn't work look for 3rd party additions to your system that act in real time first and disable those. If that still doesn't work, then you might want to consider upgrading your computer. this is the least likely scenario. Any machine made after 2000 should not have this problem unless there are many programs open and a major lack of available RAM. (Too little RAM causes programs to be swapped between active RAM and temporary page file on the hard drive.) If even after closing out all other apps this problem persists, check background processes for those that can be closed and/or to upgrade your machine’s RAM.

Firewall port not configured properly

If you have a hardware firewall (cable/DSL _router_ is one such device) then you need to configure it to allow ports 5000/UDP and 5010/UDP & TCP in to your network from the internet (to be safe limit it to the IP address of server.deltatao.com - currently 23.253.101.192). Otherwise those packets more than likely will NOT make it to your computer and this will usually prevent you from playing.

See also this:

Router about to fail

At least two people, myself included, have had this happen to them. If you find your Clanlord client locking up at times, such that you have to leave/rejoin the game or worse, restart the Clanlord client, then take a look at your router. It may be ready to fail. Ours went into diagnostic mode and was unable to get an IP from our ISP. Nor were we able to ping it from the inside. This is happening more frequently. It also manages to crash the wireless access point attached to it occasionally.

If your router hasn't totally failed, to recover from this situation you will need to power off both the router and the cable/dsl modem AND disconnect all wired connections - except your DSL/Cable modem wire (e.g. WAN) to your router. Then power up your cable modem, wait for it to get to ready status. Then power up your router and wait until it is ready. Once that is done, then you can reconnect all your internal (LAN) the wired connections to the router. Then you can look at replacing your router.

Tom's hardware has one of the few scorecards on routers, albeit a little out of date. Router speed charts

*When I replaced a router without QoS with a Netgear Nighthawk AC1900 (R7000) 802.11AC dual band router with QoS (and configured CL ports as the highest priority) all the lag caused by congestion in my LAN cleared up.

Self Inflicted

Symptoms: You cannot move but everyone else can - this is called one-way lag. Jerky stalls with out of control speeding up of your characters movement. This type of lag is usually a client issue. The following are possible causes in their most likely order.

Look for these problems:

  1. Non Quicktime (e.g. not MP3s) in the clanlord/data/music folder.
  2. Running iTunes, Firefox with many extensions or other intensive program.
  3. VirusScan or Spyware scan in progress.
  4. Check for pauses in endless loops. Using more than 'pause 4' appears to cause a one or more second delay in accepting input.
  5. Check for multiple endless loops. Try to consolidate them into one loop.
  6. Unintentional endless loop. Try to code a break key into it.
  7. An endless loop with many actions (e.g. spams your text log or message area).
  8. On the PC, using @Next to scan through players list (reported via Noivad by Gorvin).


Solutions:

  1. Remove all non music/quicktime files from the clanlord/data/music folder. By design the Windows client will open any files in there and attempt to play them. You can also mitigate this by turning the Music off in the menu Options/Music (CTRL+M).
  2. Close iTunes, Firefox or your other intensive program. iTunes is known to be a memory hog and can cause stuttering if it is playing music and especially when playing videos/movies. Some versions of Firefox had memory leaks which causes the entire PC to slow down.
  3. Pause or stop your Virus/Spyware scan. Try scheduling it for times you normally don't clan.
  4. Try to remove extra pauses (if able to) in your scanning (endless) loops.
  5. See AlternateDefault for mother of all scanning loops, and how to move long scan checks into other macro files (e.g. Readtext.mac).
  6. See Macros_Contributed for examples of break keys and their incorporation.
  7. Use a counter vice a pause to execute actions every X frames. One the counter is greater than your desired pause, then execute the actions (don't forget to reset your counter) - see AlternateDefault DHAwakeAFK for the example.
  8. Replace @Next with command used in Noivad's version of ExilePicker located at <<need ref>>

How to check the problem

First in the Clan Lord client, check your packet loss by going to the Options menu and Choose Network Stats... If you are losing packets, it is most likely not processor overload. The problem could be anywhere on the connection between your computer and the Clan Lord Server.

Next, open up your terminal application (on Windows open a command prompt) and type ping server.deltatao.com and hit return. You'll see something like this:

computer:~ username% ping server.deltatao.com
PING server.deltatao.com (209.128.94.98): 56 data bytes 64 bytes from 209.128.94.98: icmp_seq=0 ttl=52 time=172.249 ms
64 bytes from 209.128.94.98: icmp_seq=1 ttl=52 time=152.167 ms
64 bytes from 209.128.94.98: icmp_seq=2 ttl=52 time=172.108 ms

hit <control-c> to stop the pinging of the server after a few seconds.

Please note you need to ping server.clanlord.com NOT www.clanlord.com or clanlord.com. The website is hosted on a different location than the game server. Also the billing and character server is on a different location as well, admin.clanlord.com.

Read the last number on each line and that's how many milliseconds it takes to reach the server and get an answer. If that number is over 250ms (over 1 frame of CL time) , the lag is somewhere in the connection.

To find out where the lag is on your connection and determine if there is anything you can do about it, use the trace route command. Type traceroute server.deltatao.com and hit return (on Windows replace traceroute with tracert). You'll see something like this:*

Wed Dec 03 20:13:24 user@computer:~$  traceroute server.deltatao.com
traceroute to server.deltatao.com (23.253.101.192), 64 hops max, 52 byte packets
 1  10.0.1.1 (10.0.1.1)  2657.156 ms  1.154 ms  1.082 ms
 2  173-228-69-1.dsl.dynamic.sonic.net (173.228.69.1)  8.475 ms  8.636 ms  9.123 ms
 3  133.at-2-3-0.gw3.200p-sf.sonic.net (70.36.211.1)  9.533 ms  8.736 ms  9.752 ms
 4  0.ae2.gw.200p-sf.sonic.net (70.36.211.53)  8.586 ms  8.802 ms  9.132 ms
 5  as0.gw2.200p-sf.sonic.net (208.106.96.250)  9.209 ms  9.082 ms  8.880 ms
 6  0.ge-7-2-0.gw.pao1.sonic.net (69.12.211.117)  9.097 ms  10.083 ms  9.193 ms
 7  te0-0-0-15.ccr21.sjc04.atlas.cogentco.com (38.104.141.81)  10.410 ms  10.058 ms  10.441 ms
 8  be2013.ccr21.sjc03.atlas.cogentco.com (154.54.5.105)  10.329 ms  11.257 ms  10.353 ms
 9  zayo.sjc03.atlas.cogentco.com (154.54.10.194)  10.518 ms  10.136 ms  10.473 ms
10  ae10.cr2.sjc2.us.above.net (64.125.31.73)  21.079 ms  13.629 ms  14.995 ms
11  ae1.cr2.lax112.us.above.net (64.125.31.234)  19.396 ms
    ae8.cr1.sjc2.us.above.net (64.125.20.253)  11.336 ms  11.410 ms
12  ae3.cr2.iah1.us.above.net (64.125.21.85)  53.832 ms
    ae0.cr1.lax112.us.above.net (64.125.26.25)  24.548 ms
    ae3.cr2.iah1.us.above.net (64.125.21.85)  53.665 ms
13  ae6.cr1.iah1.us.above.net (64.125.20.213)  58.061 ms
    ae2.cr1.iah1.us.above.net (64.125.20.209)  63.959 ms
    ae6.cr1.iah1.us.above.net (64.125.20.213)  58.617 ms
14  ae0.cr1.dfw2.us.above.net (64.125.20.197)  57.380 ms  58.659 ms  57.527 ms
15  ae11.er1.dfw2.us.above.net (64.125.20.66)  87.950 ms  58.676 ms  60.303 ms
16  128.177.70.86.ipyx-076520-900-zyo.above.net (128.177.70.86)  60.380 ms  61.244 ms  58.932 ms
17  * * *
18  be41.corea.dfw1.rackspace.net (74.205.108.113)  66.290 ms  58.630 ms
    be41.coreb.dfw1.rackspace.net (74.205.108.117)  67.021 ms
19  po2.coreb-core9.core9.dfw3.rackspace.net (74.205.108.47)  61.257 ms
    po1.corea-core9.core9.dfw3.rackspace.net (74.205.108.45)  60.380 ms
    po1.corea-core10.core10.dfw3.rackspace.net (74.205.108.49)  63.949 ms
20  core9-aggr160a-5.aggr160a-5.dfw3.rackspace.net (72.32.10.113)  68.888 ms
    core10-aggr160b-5.aggr160b-5.dfw3.rackspace.net (72.32.10.119)  60.836 ms  61.432 ms
21  server.deltatao.com (23.253.101.192)  60.387 ms  60.319 ms  63.845 ms

(Note: I live very physically close to the server — probably within a 2 hour drive — and that has a big impact on average latency. From home, my ISP is sonic.net which tends to have great service and staff, and very rarely suffers from high latency thanks to their highly competent staff. The same cannot be said for other, larger ISPs such as AT&T and Comcast in my area where latency can spike above 100ms within the first few hops.)

The first line is your computer’s connection router's IP (or modem IP). If the ping time is long, your problem is on your end, and you can do something about it. Try lowering local network traffic: video/downloads etc. If there is not a lot of traffic, you can try restarting the client, then the computer. if that doesn't work, you'll have to do a little research on the internet or contact a friend who knows how to troubleshoot your computer.

The second line is usually your ISP's connection to your home router. If this number is high, the first thing you can do is reset the connection. Turn off your modem/router to get a fresh connection. If that doesn't work, contact your ISP's tech support to report the problem. A good ISP will investigate the problem or if they already know the problem, give you an answer, such as one of their servers or routers went down.

The third number is probably your ISP's router to the gateway or another router. In the example above the ISP sonic.net (which is part of Earthlink) routes to sonic’s network until line 6, which is the gateway to the internet, or their upstream provider. You can report a problem, or ask why the connection is slow. In this case the ping times are between 8 and 10 milliseconds which is excellent.

The seventh line in this example is cogent for lines 7 to 9 that has an average ping time between 10 and 11 milliseconds which is also excellent.

Then it goes to above.net in lines 10 to 16 which has pings between 13 milliseconds and 60 milliseconds.This is great times since they are all under 100ms.

Note the 17th line where there is an asterisk on the last of the three pings. That indicates a failed ping. And could indicate one of the problems. Line 18 shows it winds up at Rackspace (an ISP for many business where they locate their servers, and most likely who host’s Delta Tao’s severs. Lines 18 thru 20 are routes within Rackspace until finally it reaches Delta Tao’s server in line 21. The three pings there are about 60 milliseconds — well below the threshold of noticeable lag.

After your network and ISP, you can't do much about it. At most you can call your ISP, and hope to get a competent tech (Note: with large ISPs you often have to speak to a level 2 or higher support technician to get a real answer and have a real tech that understands latency and real networking issues and is not just a person reading a script which is the case with both AT&T and Comcast in my experience.) If the problem is on the last few lines, then it's Delta Tao's host's problem (Rackspace currently), and you can report it to DT.

If the problem is constant, and it's your ISP, you might want to change ISPs, and/or contact your ISP and tell them you might leave because of the lag in their system.

If the problem is intermittent, then it's probably:

    • The internet itself that is either overloaded or a backbone or gateway's is down, and causing more traffic than normal on the other routes through the internet.
    • Or your Router is about to fail.

Other Network Problems

"After X minutes I get disconnected from CL"

The Linksys WRT series (version 4 and under) and possibly other routers have a firmware bug where UDP streams (what the Clan Lord client and server use to communicate with each other) are dropped after about 12 minutes (or less) of activity. The solution for Linksys WRT Series routers is to either upgrade or downgrade your firmware. I believe is was version 4.2.1 that had this problem. Sometimes that helps. If not, you can try replacing the router.

QoS

QoS: a Solution to Network and Router Overload.

  • If you have a "QoS" option in your hardware firewall or cable/dsl router configuration then add ports TCP 5000 and TCP&UDP 5010 to the list of ports served by QoS (aka Gamer ports). Also upgrade your router's firmware to the latest if you drop frequently…

Cl-port-priorty.png More about what QoS is here: Beginners Guide to QoS

Replacing your Router

In my experience, routers also tend to last from 3 to 7 years before the hardware starts to break down with the constant thermal changes from loads. A generation for WiFi routers tends to be about 18 months but it often takes about 3 years (thanks to standards adoption) before the technology advances enough to justify replacement. Each generation tends to at double through-put speeds. For these reasons when you replace your router, I suggest looking into QoS routers. If you have the resources and/or can’t wait a generation or until your router breaks, if the local network & router overload problems as well as weak signals that are in your control, I suggest replacing the router to save the headaches associated with bad routers.

Both Netgear (my current consumer level favorite), DLink and some Belkin routers offer QoS on their routers (also called “Port Priority” “Gaming Grade” and other terms) that can be configured for gaming on CL ports noted in the preceding section. Newer routers (802.11N & newer 802.11AC) tend to be more efficient, have longer range. Some N & AC even use advanced beam forming techniques to direct the signal towards clients, thereby reducing errors that cause slow downs. Prices on these vary from about $100 to $200, and tend to be configurable via a web browser with a good GUI.