Lag Compensation

Revision as of 11:54, 1 April 2022 by Mwadmin (talk | contribs) (→‎Self Inflicted: —changed FPS pause to 5)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to 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[edit]

Computer Overloaded[edit]

Sometimes your computer (networking stack) itself is overloaded and the reason for the latency. Try restarting before you get into tearing apart your network. A Clues it is your computer is it the first hop in traceroute takes an abnormally long time (anything over 100ms). if you want to get fancy, you can try traceroute -P UDP “-P” stand for protocol and UDP stands for Universal Datagram Protocol, which is the way the CL client get and sends data to the server.

WiFi Router in Power Saving Mode[edit]

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 or

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 stream a video from the internet (youtube or another service) to force the computer or your router to high power mode or persistent connection. If that doesn’t work, you can try connecting via a hardline such as Ethernet (those cables that have jacks the look like a wide telephone cables) 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[edit]

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[edit]


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[edit]

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[edit]

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[edit]

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 restart your computer. 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 which slows down your entire computer.) If —even after closing out all other apps & restarting— this problem persists, check background processes for those that can be closed and/or to upgrade your machine’s RAM. A lot of machines sold do not include enough RAM to give your computer '“breathing room”' so it doesn’t have to do memory swaps. If you are buying a new machine, and the RAM is not replaceable (hello Macs)always bump your computer up to the next configuration of ram at least. This can also lead to a computer you can keep longer, so $200–400 (or more) is a small price to pay for adding years of life to a computer’s usefulness.

Firewall port not configured properly[edit]

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 - currently 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[edit]

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[edit]

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 5' 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).


  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[edit]

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 and hit return. You'll see something like this:

computer:~ username% ping
PING ( 56 data bytes 64 bytes from icmp_seq=0 ttl=52 time=172.249 ms
64 bytes from icmp_seq=1 ttl=52 time=152.167 ms
64 bytes from 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 NOT or 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,

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 and hit return (on Windows replace traceroute with tracert). You'll see something like this:*

Wed Dec 03 20:13:24 user@computer:~$  traceroute
traceroute to (, 64 hops max, 52 byte packets
 1 (  18.833 ms  7.420 ms  6.912 ms
 2 (  25.383 ms  27.928 ms  17.080 ms
 3 (  29.921 ms  84.454 ms  15.615 ms
 4 (  18.661 ms  15.825 ms  15.153 ms
 5 (  31.963 ms  30.343 ms  21.568 ms
 6 (  23.104 ms  25.103 ms (  18.124 ms
 7 (  26.423 ms (  31.319 ms (  16.543 ms
 8 (  24.406 ms  26.071 ms  20.570 ms
 9 (  27.775 ms  29.386 ms (  15.673 ms
10 (  62.091 ms *  60.131 ms
11 (  55.053 ms (  64.626 ms  68.238 ms
12 (  76.691 ms  56.499 ms  61.965 ms
13 (  55.116 ms  64.208 ms  55.106 ms
14  * * *
15 (  75.193 ms  74.590 ms  99.256 ms
16 (  55.561 ms  55.540 ms  58.537 ms
17 (  55.411 ms (  80.706 ms  66.465 ms
18 (  59.857 ms  62.439 ms  54.958 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 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 (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 20 and 30 milliseconds which is also excellent.

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

Note the 14th 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 15 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 15 thru 17 are routes within Rackspace until finally it reaches Delta Tao’s server in line 18. 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[edit]

"After X minutes I get disconnected from CL"[edit]

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: 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[edit]

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.