Wednesday, June 19, 2013

Dance Curriculum - What Is Lag?



We have all encountered the dreaded lag monster.  You’re walking slower than molasses and then suddenly shoot through the wall 200m ahead.  Your clothes won’t rezz and you can’t even move your camera!



As a dancer/performer, lag is always a threat, with the potential to ruin many hours’ worth of work in mere seconds.  But what, exactly, is lag?  I am no expert, and I am by no means a techie person.  But after doing a bit of research, I thought I would share the information that I found. 



There are 3 types of lag: server, network, and client (or viewer) lag.



*Server lag refers to the servers that contain the information for all the sims.  The LL servers have to both keep track of everything happening in a region, and send that information to all the users who can see the region. If they have too much to do, they will slow down so as to not lose data. If too much communication is required to fetch data about objects and send them to all the users, it can become backlogged.  Things that can make the server busier include: 



    Many physical (physics-enabled) objects in the region

    Many users are in or can see the region

    Many object-embedded software scripts running in the region

    Lots of changing textures



When avatars move (especially with an AO that keeps it in constant motion), the server must make continual calculations and send information to you and every other avatar in the region.  Perhaps you want to go see a dance show, and you know there will be many other people there.  Once you teleport in (and can see), SIT somewhere.  Once an avatar sits, the server no longer has to keep track of where that avatar is, freeing up the server for other things. 



Scripts are the other usual culprit in server lag.  I’m sure you’ve all been to shows where you are asked to remove AO’s, poofers, and any other lag-causing device.  Some shows have even begun placing script counters at the entrance and restricting the show to avatars with a certain script count (generally 100 or below).  I heartily recommend purchasing a script counter (you can find some nice free ones on Marketplace) and finding out just how many scripts you are wearing without even realizing it.  Most hair, shoes, and other clothing attachments come with resizer scripts.  Once you have fitted your hair/clothes/shoes properly, you can delete the resizer scripts.  As for AO’s, most third-party viewers come with built-in AO’s that do not contribute to server lag. 



*Network lag refers to the connection between your computer and the computers at LL.  Whether or not you experience network lag depends on your internet connection. A connection speed of at least 500 kilobits per seconds (kbps) is needed to run Second Life adequately.  If you are on a wireless router, or entirely wireless connection you may not be getting these speeds.

Paradoxically, a connection speed that is too high can cause problems. Your computer has to do something with the new data as it comes in. If it is too busy, it can miss data packets, which then get re-sent. This makes the problem worse. You can adjust the bandwidth in your viewer, but there is not much else you can do to combat network lag, short of changing to a better/faster ISP.  For many people, this is not an option. 



*The last type of lag is client (or viewer) lag.  A major factor in client/viewer lag is hardware.  Having the newest, most up-to-date computer, with a good graphics card and fast processor will go a long way towards reducing lag.  However, since most of us probably can’t afford to buy a new computer, there are other things you can do to help combat lag on YOUR computer. 



Many of these options are found in your viewer’s advanced menu.  I use Firestorm, so the instructions are based on those menus.  If you use another viewer, you may need to do some research to figure out where these options are on that particular viewer. 



Go to Avatar --> Preferences --> Graphics.  There are a lot of options here that can help reduce lag on your computer.  Under the ‘General’ tab there is a slider for the graphics quality – lowering this will reduce the amount of work for your computer’s processor. 



Lowering the Draw distance can also improve performance.  Draw distance refers to the distance your avatar can ‘see’ around the region.  If you are inside a club (watching a dance show, for instance) you don’t need a large draw distance anyway.  I know of dancers who lower their draw distances to 64m to help combat lag. 



There are a lot of sliders and boxes you can play with on the ‘General’ tab – avatar imposters, avatar physics, LOD factors, atmospheric shaders, lighting and shadows, etc.  Move the sliders around until you find a set up that works for you. 



There are so many factors that is impossible to give you a settings list, because your computer may not work exactly as someone else’s does.  For instance, most of the research said that working from a wireless connection is not ideal.  However, because of my location, I use a wireless connection 100% of the time.  Just to give you an idea, here is a screen shot of my preferences (under the ‘General’ tab):








Even though I am on a wireless connection, I can set my performance quality to High.  However, all the various sliders have been lowered (LOD, Flexiprims, etc.), I do not use avatar impostors, and I do not generally have the advanced lighting (with shadows, etc.) enabled. 



Under the Network tab of the menu (Avatar --> Preferences --> Network and Cache) you will find the slider to adjust your bandwidth.  Again, you will have to play with the settings to find what works best for YOU. 



A few other notes – if you find your computer is running slow, make sure that any other programs are not open/running (Skype, Photoshop, etc.).  You may also find that some people discuss ARC (Avatar Rendering Cost) as a cause of lag.  ARC is not generally a cause of server lag.  It can, however, be a cause of client/viewer lag.  If there is a particular avatar that is causing you problems, you can mute or block them, which will grey out their avatar (note-you will not be able to hear chat coming from a blocked/muted avatar). 



Lastly, you may have been told to ‘clear cache’ in order to fight lag.  Clearing cache does not generally reduce lag and, in fact, may actually cause lag.  When you enter a region, your computer must load all of the textures/objects in the region.  Once these are downloaded to your computer, they are held in the cache.  If you clear the cache and re-enter the region, your computer must download all that information again – causing possible lag not only to you, but to the servers as well, which must provide the information.  Clearing cache also causes your inventory to reload, which can cause lag, especially if you have a large inventory.  In addition, most dancers pre-load (cache) their dances in order to avoid pauses caused by lag.  If you clear your cache, you will then have to re-load all your dances as well. 



Unless you are missing a desperately needed inventory item, it is generally not necessary to clear cache. 



I hope you found this information useful.  Below is a list of sources, which contain additional information you might find helpful.  Some of it is a bit technical, but the more you know, the better you can plan to fight the dreaded lag monster!



(If there are any mistakes in this article, they are mine, not the sources.)


Happy Dancing!
Kat


Sources: 



SLWiki   








A big thank you! to Babypea von Phoenix, who provided some additional information regarding lag.