Wednesday 22 January 2014

A Basic Guide To Lag

A few players have reported that they experience lag at spawn and after both myself and Tatankore spending some time testing and getting player feedback it appears that this affects less than 1 in 30 players. Looking over the modreq history etc we also found that players reporting lag at spawn were far more likely to have experienced severe lag in the past, often when others found the same area to be fine or just 'a little' laggy.

I have put together the following basic lag guide to help anyone who does experience issues to try and diagnose them:

Firstly there are 4 kinds of lag you can experience playing on a Minecraft server...

Server lag: 

This will affect everyone on the server and is caused, for example, when someone world edits a large chunk of landscape and the server processor spikes to 100% or when server memory peaks to 100%, with Tekkit Classic this usually only occurs when certain items are placed in extreme excess.

Network lag:

This will usually affect everyone on the server but may be limited to players in a certain geographic location, for example if the hosting company experiences a problem with the data routing between the UK and USA then only players in the USA will generally experience the lag.

Block lag:

This is where a broken block almost instantly reappears or there is a noticeable delay in seeing it break, it can also be noticeable when using levers, doors, chests, etc. This is simply because of the way Minecraft events are handled, it's improved in later versions of Minecraft but with Tekkit Classic being based on Minecraft 1.2.5, just 30-35 players is really considered the maximum to have online at once before this becomes an issue. This can be confused with client lag, however server related block lag will always affect everyone on the server, never just individuals or groups of players.

Client lag: 

This is lag caused by insufficient resources at the client (player) end. This is why you often see someone say "I'm lagging" and then someone else reply "I'm not", it is by far the most common type of lag. Client side lag can be caused by many different factors, but mostly these 'big six':

  1. Internet connection: Having a good connection speed can be a major factor in how smoothly your client runs, most people seem to recommend a bare minimum of 8 MB download and 1MB upload to get a smooth and reliable player experience. Bear in mind that, for example, every time red alloy wire switches state it will send around 0.5 MB both ways between your client and the server, if your upload speed is only 1 MB that's potentially 50% of your bandwidth temporarily taken up by  a single in game action which combined with other in game actions can of course make you lag. Playing over wireless, especially with a weak signal or many connected devices, can also have a very detrimental effect on performance.
  2. Java: Minecraft is based on Java, which version you have installed can have a massive impact on client performance, if it's older than a few months then you should probably update it or if you started noticing lag after an update then uninstall it and re-download the previous version.
  3. Graphics card: Minecraft doesn't need a top end graphics card but it does need something reasonably powerful to run smoothly, this is most important on a laptop as basic integrated graphics chips rarely give good performance, really a basic Nvidia card is a minimum for smooth play.
  4. Background services: Other programs running on your computer at the same time can leave Minecraft with limited resources or create issues, for example McAfee anti-virus has been known to cause major issues with Minecraft clients, especially older versions such as that used by Tekkit Classic, if you have client lag close programs and disable background services you don't need (lots of help available on Google) and think carefully about what software you are running. If you use McAfee then consider switching to a better alternative such as Avast, the free version is fine for general home use and far more efficient than most paid for antivirus programs so switching doesn't need to cost you anything at all. Make sure you try temporarily disabling any malware/spyware scanners too, they can potentially have a massive performance impact when playing games.
  5. Out of date software: Got outstanding system or driver updates? Updating software, especially drivers, can make a very dramatic difference in some circumstances. Like Java though if lag starts only after installing an update it's time to switch back to the older version for a while.
  6. In game settings: Tekkit Classic includes optifine which offers various visual enhancements to the game in addition to Minecrafts own settings, the default settings are rarely the most suitable so take a good look through and tweak them as you feel appropriate, below is a list of some graphics settings that can have a big impact.
You can find the following under 'Options', 'Video Settings':

Graphics: Changing this to 'fast' will optimise the game to reduce lag.
Smooth Lighting: Turning this off can make a huge difference for slower graphics chips.
3D Anaglyph: The benefits of turning this off vary wildly but for some players it helps a lot.
Particles: Turning this off can make a noticeable difference for slower graphics chips.
Render Distance: The lower this is the better your graphics performance.
Performance: Selecting 'max fps' will prioritise reducing lag over pretty effects etc if needed.
View Bobbing: Turning this off only really makes a difference for old/slow computers.
Clouds: Turning this off only really makes a difference for old/slow computers.
Advanced OpenGL: This one is complicated, it may or may not make a massive difference for you depending on your computers hardware, the only way to know for sure is to try it and see!

I hope this guide will help players understand lag a little more and help those players experiencing client lag to pin down and hopefully resolve the cause/s!