29 September 2009

lag hoodoo part III




Last week, we took an initial look at the Graphics settings in the Preferences dialogue in an effort to improve our frames per second (FPS) performance. This week, I was planning to take a closer look at all the options on that page, but, due to a combination of jury duty, flu in the family (not I, thankfully!), excitement at winning a chariot race, and plain old forgetfulness, I'll just have to make it short, and touch on a couple of things.

If you open the Preferences window, and select the Graphics tab, next to the the 'Quality and Performance' slider mentioned last week, there is a box labeled 'Custom'. If you select this, a score of controls will spring into view. Some of these may be greyed out, depending upon the Quality and Performance setting and the capabilities of your graphics card.

There is also a 'Recommended Settings' button at the bottom of the window, which will reset the settings to a consistent starting point, and unselect the Custom box at the same time. This is seldom the optimum result, but does provide a way to quickly get back to a known state while experimenting with settings.

If, after opening the Custom controls, you move the Quality and Performance slider, you will find that it is actually adjusting each of these controls. Play around a bit, and observe how the settings change, what their visual effect is, and what their impact on FPS is (Ctrl-Shift-1, remember). Then push the Recommended Settings button again, and re-select Custom.

While I have found all of these settings have some effect, some have more than others. Finding the optimum setting is a matter of trading off performance you can live with for visual quality you are happy with, and these values may change depending on the region you are in, and what you are doing. For instance, when I am chariot racing or in a sailing regatta (did I mention I'm the champion of the Minoan Empire in both sports?), I will set every thing to the absolute lowest setting, because I value performance above every thing else. For most purposes, though, I run at High Quality, with several of the other controls tweaked a bit.

I will wrap this up for now by noting that 'Draw Distanc'e is one of the most powerful controls if you are in a region with a large number of prims, avatars, and/or textures. If you are in a very empty area, it will not make as much difference. I have also found that the 'Water Reflections' and 'Atmospheric Shaders' selections under 'Shaders' can have a big effect.

Until next week!

23 September 2009

lag hoodoo part two

As we look at the Lag Meter, under the Help menu on most OpenSim/Second Life viewers, we see three indicators. In this post and the next two, we'll look at what those mean, and how a poor, lagged down user can influence them.

The first one is the Client. This indicator is presented as FPS, or Frames Per Second, and is an indicator of how quickly the local viewer is able to re-render the scene. The faster it renders, the smoother and more immersive the experience will feel. For comparison, standard resolution television renders at 25 or 30 FPS, HDTV ranges from about 24 to 60 FPS, standard 35 mm cinema film runs at 24 FPS, and IMAX runs at either 24 or 48 FPS.

The Lag Meter flags any rate below 10 FPS as red, and below 15 as yellow. My personal observation has been that, below 10 FPS, it starts to feel progressively more and more as if I am trying to walk through hardening cement, and appears more and more as if I am moving through a series of slowly changing pages (which is essentially what is happening). Above 10 FPS, it's generally easier to move, and above 20 FPS or so, it begins to appear much more smooth and lifelike. I have also found that in competitive activities, such as sailing and chariot racing (ask me sometime), if the frame rate drops below 15 FPS, control of my vehicle becomes much more difficult.

So, one might ask, what influences the frame rate? Why doesn't the viewer simply render at 25 or 30 FPS, and be done with it? The answer is both simple and complex, and we'll take more than one week to answer it, but the short answer is, rendering an entire scene can be very difficult, and is impacted by anything that increases complexity. A scene rendered on your computer consists of polygon edges (the wireframe), textures, and lighting. This is true not only of the land and prims, but of all the avatars within the view. The viewer must render all of these things as quickly and efficiently as possible. Having few visible prims makes the job easier, while lots of prims, with lots of textures, makes it harder. Static things make it easier, while moving things--avatars, flexiprims, lots of particles--make it harder.

The rendering is primarily the task of the GPU, the graphics processing unit, and it's supporting electronics on the graphics card. This is an area in which all are definitely not created equal. Take a look at this somewhat outdated http://s3.amazonaws.com/secondlifegrid.net/frameratesbygpu.png (comparison of frame rates by GPU) document. This is specific to older versions of the Second Live viewer, and does not include some of the newer graphics processors, but the relative comparisons still hold true. If anything, newer versions of the viewers are more demanding, and the typical rates will be lower. The ranges are due to several things, including the differences in simple and complex scenes. Also note that ATI GPUs are typically somewhat slower than equivalent nVidia GPUs, even though in a game such as World of Warcraft they may be much closer. Without going into detail, this appears to primarily a difference in drivers between the two GPU makers.

Second to the GPU, the local computer's CPU also handles a lot of the calculations, and the weaker the GPU, the harder the CPU will have to work to compensate. Third, there is memory caching, in both the graphics card and main system RAM. All else being equal, more RAM on both the system and the graphics card is a good thing, as it allows things to be kept available for quick use, instead of having to be retrieved from the server via the network, or from the local hard disk. Finally, there is the network itself. While network is a separate entry on the Lag Meter, it also affects FPS. A processor, whether GPU or CPU, that is not being given things to process as fast as it can handle them simply cannot work at its maximum potential.

So, given that, what are some quick and easy things we can do to increase FPS? There are things that will only affect the local system, and things that will affect not only the local system, but other users as well. We'll start with the former. I will be using the most current Hippo viewer version 0.5.1 set to the English language for consistency as I describe the options; other viewers and other languages may cause some of the settings to vary, or be differently labeled.

The very first thing to do is to open the Preferences window, either Control-P, or from the pull down menu, Edit->Preferences. Select the Network tab, and move the slider for the Disk Cache Size all the way to the right. This maximises the amount of on-disk storage for textures retrieved from the network. Click Apply. Note that this will increase the disk space used locally. You may not see an immediate increase in FPS, but over time, it should help in areas you frequent. Note: if you do not have sufficient space available to increase this cache by 500 MB, then you really should consider either adding more disk space, or removing something from your system.

The next step is to select the Graphics tab. If you have never made adjustments here, you should see a fairly simple dialogue, with a single slider for Quality and Performance. Unless it is already in the leftmost position, try sliding it one step to the left. You should immediately see an increase in FPS on the Lag Meter (Help->Lag Meter) or the Statistics Bar (Control-Shift-1), at the cost of some of the quality of the rendering. This is because the number of details being rendered is being decreased to reduce the rendering time, and thus increase the FPS.

Next time we'll go into more detail on this tab, but for now, if you'd like to experiment more, tick the "Custom" box. This will open up a number of boxes and sliders that you can test to see what effect they have on your system's performance.

One last thing to experiment with is decreasing the size of the viewer window. Tick the box at the top of the graphics tab, labeled 'Run Second Life in a window', if it is not already. Then try choosing different Window Size settings, or simply resize the window frame. You may find that, at smaller window sizes, you see an increase in FPS.

Until next time, cybernauts, may your lag be low!

~*~
Thoria

16 September 2009

lag hoodoo

This is the first of a series of articles I wrote for the 3rd Rock Grid community newsletter. I'm reproducing it here in hopes that it may benefit a wider audience of virtual world citizens. There is no shortage of articles on lag available through an internet search, but perhaps I will provide a collection of useful information in one place.

While this was written for 3rd Rock Grid, and is thus specific to OpenSim based grids, it will also most certainly be applicable to Second Life as well. At a more general level, much of what will be discussed may also apply to other VWs, such as Blue Mars, or There.com.


Introduction

Lag is a word that is tossed around in virtual worlds as sort of a catch all word for anything that makes the user's experience feel less than immediate. As lag gets worse, the experience of immersion begins to degrade, going from mildly annoying to exasperating to completely unusable.

I hope over the next few weeks to share some of what I've learned in nearly three years of virtual world experience and nearly 25 years of computer experience. I plan to look at what are the sources of lag, and what we as users can do to reduce its effects. While I have learned a lot working for a major computing hardware vendor, and from personal experience in virtual worlds, I certainly don't know it all, and welcome comments, constructive criticism, or additional helpful information. This is especially true for Macintosh systems, as I do not have one. Most of what I say will be applicable, but there may be some details that vary.

Performance degradation is caused by a limitation of computer resources, when a resource is trying to satisfy too heavy a demand. I started to write a lot more detail on this, but we'll save that for later. For now, we'll take a look at a couple of tools that let us see where lag is occuring.

First, there is the Lag Meter. This is sort of like the "idiot lights" on an automobile instrument panel, and is launched from the Help menu of your viewer. The Lag Meter has three indicators, for "Client" (the user's computer), "Network", and "Server" (the computer or collection of computers that run the virtual world). Each of these may be green, yellow, or red, to indicate whether there is a performance problem, and to what degree. Additionally, there is a line of commentary that provides a bit of (sometimes questionable) insight into any problems. Generally, if all three indicators are green, your experience should be acceptable. if one or more are yellow, you may notice some degree of lag, and if one or more are red, you are almost certainly noticing lag.

Second, there is the Statistics Bar. This may be reached with Control-Shift-1 (or Command-Shift-1), or from the View menu as "Statistics Bar". This provides much more detail than the Lag Meter, but parallels its information. FPS (frames per second) is an indicator of client performance, with a rate above 15 corresponding to green, between 10 and 15 to yellow, and below 10 to red.

Likewise, Bandwidth, Packet Loss, and Ping Sim are indicators of network performance, and the various items under Simulator give information about server performance. We'll look at these, plus some others that are normally hidden, in later installments.

I plan to first look at some easy adjustments that can be made, sometimes for a large improvement in performance, and then move on in later installments to some of the trickier adjustments. It is always important to keep in mind that all systems have some maximum level of performance, beyond which no amount of tweaking will improve things, but with careful observation and tuning, we may at least be able to approach that maximum level.

Finally, so that you may have some place to begin this week in improving your virtual world experience, may I suggest that you do some basic system clean up. On a Windows system, run spyware and virus scans, and defragment your hard drives. On all systems, ensure that you are not running large programs or lots of little utilities that, in aggregate, are stealing system resources from your viewer.

Until next time, happy immersion!

~*~
Thoria Millgrove