Connexion | M’enregistrer




Poster un nouveau sujet Répondre au sujet  [ 1 message ] 
Auteur Message
 Sujet du message: Reducing the lag in second life
UNREAD_POSTPosté: Jeu Oct 18, 2007 5:45 am 
NooFondateur
Avatar de l’utilisateur
Inscription: Mar Jan 09, 2007 3:21 am
Messages: 1161
Ci-joint pour info et à traduire, un certain nombre de conseils pour améliorer la fluidité de votre navigation dans second life.




=================================
Kex Godel's Guide to Reducing Lag in Second Life
=================================

Note: If the date indicated in the name of this notecard is old, please check for an updated version, included with the Unofficial SL FAQ, which is distributed from [?? ], or send me an IM for the newest version.

This notecard was last updated with Second Life version 1.10.4


### Introduction ###

There are a few different types of "lag" in Second Life. SL is a very cutting edge application which will manage to push the limits of much of your computer hardware. Your video card, CPU, memory, and your network bandwidth will all be utilized to a great degree while you are exploring the SL world.

Second Life is a highly complex and dynamic system unlike any other in existance, and so even if you are experienced with online programs, you may find some new and interesting ways to experience lag in Second Life that you have not encountered before =)


### Client Lag ###

These are three different possible sources of 'lag' for your client: CPU, Video, and Network. Often, when one is causing lag, the others can appear to have been affected as well.

::: Video :::

The first type of "lag" that most people notice when they are new to SL is a slow frame rate. While in SL, your graphics card will be constantly busy. Things will almost always be moving around, disappearing as they go out of view, reappearing when they come into view, and you will always be loading textures as you move about the world.

Unlike any 3d games you have played, Second Life is a completely dynamic world. There is no "precompiled" map here. Everything you see in Second Life can change at any time:

- 3d objects can appear, move, rotate, disappear, change texture, color, transparency, give off light, etc
- avatars can appear, move, rotate, disappear, animate, change clothing, shape, etc
- the sun moves slowly across the sky, and shadows and lighting adjust with it as well as darken with night
- the sky can change colors and is reflected off of shiny objects (which can spontaneously change to/from shiny)
- the surface of the ground can rise or fall, or change texture at any time

All of this dynamic content means your video card has to work a lot harder to "cull" out any objects which are not in your view. If you are familiar with 3d terminology, SL's dynamic nature makes it practically impossible to use a 'BSP Tree'. When most 3d games are made, most of what you see in a 'map' will not change during your entire play session (say a building, or a parked car), which is all compiled into a static scene which can speed up video rendering tremendously. In the end, you wind up with a scene which only contains a few "active" objects which are what you typically interact with, among a bunch of walls and other obstacles that never move.

Unfortunately, this can't be done in SL with current technology; compiling a map takes a lot of time and isn't something that lends itself well to an always-changing environment. This means is no matter how good your video card, your frame rate will be lower in SL than what you get in most 3d games.

It is quite typical to get only 10-20 Frames Per Second even in quiet areas of the SL world, even with a fairly new graphics card. DRAW DISTANCE can have one of the biggest effects on your frame rate, and is one of the first things I recommend lowering if someone is getting a severely low frame rate (in addition to turning off all of the 'Performance Options' in the graphics preferences) .

Your video drivers can have a big impact on your performance as well. Video card manufacturers are always finding faster ways to do the functions that your video card does, and they usually incorporate these optimizations into their newest drivers. If your drivers are more than a few versions behind or more than a half a year old, it is highly suggested that you check for an upgrade.

As a personal recommendation, if you are shopping around for a new video card, I highly suggest getting an nVidia brand card if you plan to spend a lot of time in Second LIfe. SL has had a history of issues of instability with ATi video cards, while those people using nVidia cards have reported far fewer problems with crashes and odd visual glitches.


::: CPU :::

The CPU does a lot of work in SL compared to most 3d games. Everything that moves in the world has to be updated all the time, and SL does it's best to try to cull out stuff that's not visible without the benefit of BSP trees and thelike. As explained in the Video section above, SL is a very dynamic world. SL will almost always run your CPU at full 100% utilization the entire time you have the program running.

Surprisingly, If you have an older computer, you may find a lot more benefit to upgrading your CPU rather than your video card to get an increase in performance. In fact, if you get a brand new video card, but keep your old CPU, you may not see much improvement at all.


::: Network :::

Your internet connection will also be used heavily, especially as you're flying around the world. Expect your bandwidth to idle at around 20-50 kilobits per second once you've stopped moving and everything is loaded, and peak in the 100s of kilobits per second while moving around the world or hanging out in a crowded area.

In the far top right corner of your SL window, you should see two small vertical bars, just right of your money display. Usually these will be mostly black if you're just standing/idling.

The bar on the left is your 'Packet Loss'; the one on the right is your 'Current Bandwidth'. These indicators can be green, yellow, or red, depending on the percentage being indicated.

The 'Packet Loss' indicator occasionally may show a little bit of loss, this isn't really that bad. But if the bar starts to fill up and turn yellow or red, this can cause serious lag problems since data is being retransmitted, and possibly getting out of date.
If you have problems with high packet loss, try turning your bandwidth availble to SL down in preferences -> network.

### Client Optimization Tips ###

::: Preferences :::

Here are the settings I recommend for those who are using an older computer, or are having trouble with crashes:

Open the Preferences window (Ctrl+P)


Graphics:

- If you do not run in a window, use a low resolution, such as 800x600 or 1024x768.

- Set 'Draw Distance' to 64 (very important, this is the *biggest* factor in video speed)


Graphics Detail:

- Shaders: Uncheck all of these

- Avatar Rendering: set to "Normal"

- Lighting Detail: set to "Sun and moon only"

- Terrain Detail: set to "Low"

- Mesh Detail sliders: Move all of these to the left. This will cause curved objects to look more squared off, and avatars and trees will look less detailed from a distance. If this bothers you, maybe try setting these somewhere in the middle.


Adv. Graphics:

- Uncheck Anisotropic Filtering

- Check "Enable AGP" if you have the option to do so (unless you have stability problems with this on)

- Set your 'Graphics Card Memory' size to 16MB or 32MB. If you experience too much blurryness and don't mind it running a little slower, you can turn this back up some. Even if you have more video memory, turning this down will cause SL to use smaller textures, and download much less texture information.

- Set 'Max Particle Count' to 256. You may get odd effects from particle emitters since most people keep this at 4096, and people rarely test their particle creations at lower preferences settings. You can also temporarily disable particles in the View > Beacons > Hide Particles menu.

- Set 'Fog Distance' to whatever you like. This doesn't appear to have much of an effect.

- Set 'Outfit Composite Limit' to 0. This means you will not see dynamic changes to other avatars while they are in appearance mode.

Additionally, it can help a lot to make sure you have the newest video drivers installed. If your drivers are more than a year old, chances are you will probably get some improvement by upgrading them.


Network:

- Bandwidth

1) Start with 300 kbps as your default.

2) If you're not experiencing any packet loss, but feel like the world is loading too slowly and your bandwidth indicator is often yellow or red, then raise your bandwidth higher.

3) If you are experiencing significant packet loss, reduce your bandwidth down in small steps until it goes away or drops into the 'green' indicator.

- Disk Cache Size

I recommend a resonable setting around 200MB. Higher cache sizes tend to slowly degrade performance over a long period of time. If you set it too low, then you're always downloading things over and over again. 200 seems like a reasonable compromise in size and performance.


Audio & Video:

- Disable Streaming Music and Streaming Media. You should definitely disable Streaming Media if you are getting crashes while flying around.


::: Additional Tips :::

- Rebooting your computer before starting SL can help get better performance.

- Close as many background programs as you can while running SL, especially P2P programs (Kazaa, Gnutella, Shareaza, etc)

- Defragment your hard drive occasionally.

- SL works optimally with 1 GB of RAM (that's 1024 MB) or more. If you have less than 512MB and you spend a lot of time in SL, you may want to consider a memory upgrade before anything else.

Additional Information:

- To view your video and network status, go to 'View > Statistics Bar' in the menu
- Typical framerates are between 10-20 FPS in non-busy areas
- Typical network traffic is between 20-50 kbps in non-busy areas

Lag occurs most when:
- Your Draw Distance is too high
- There are many physical (physics-enabled) objects nearby
- There is a large group of people nearby
- You are moving (and therefore loading new geometry, textures, and sounds)
- You or other people are playing sounds or animations
- When many objects are moving around nearby
- You have "fancy" graphics features enabled (Anisotropic Filtering, Ripple Water, etc)

Example Frame Rates with various configurations:
- 20-30 fps with nVidia 6800GT, Athlon64 x2 4400, 2GB memory
- 20 fps with nVidia Ti4400, Athlon XP 2100+, 1GB memory
- 10-15 idle FPS with nVidia MX420, 533 Celeron, 256MB RAM

(please IM Kex Godel with your frame rate, video card, CPU, and memory to contribute to this list)


### Server Lag ###

The Second Life World is divided up into a grid of servers, which you can see distinctly when you open your map. Each region is run on one server, and some servers run more than one region. Server Lag is another aspect of overall lag, but it's a little harder to control unless you own a lot of land in the region.

Note that the words "region", "sim", and "simulator" are the same thing. The term "server" is almost the same as "sim", but sometimes multiple sims are run on one server.

Server lag can sometimes co-relate with client lag, but it also can cause some distinct problems even if your client is running great:

- If there is a high Time Dilation, you can feel like you're moving in slow motion

- Lots of physical moving objects with complex geometry (ie toruses, rings, etc) can require many calculations to render their behavior accurately.

- Every script that is running needs a little bit of the server's time to see if there are any new events pending. Having a lot of scripts running, even if they aren't doing anything, can slowly add up to a good chunk of a server's processing time. Any one little script probably won't add any noticable lag, but thousands of scripts in one region can potentially start to make things miserable.

- Large gatherings of people create an exponential update load. Even if your client handles rendering 30 avatars at 50 fps, the server still has to maintain all the crosstalk to keep everyone updated. Every time someone moves, chats, animates, or makes a sound, those updates have to be sent to every other person in the area.

The cross-communication can grow exponentially. Imagine when a group of friends all each say hello to each other once. It won't take long for 2-3 friends to do this, but a dozen or two could add up to a lot of "hellos".

- Post-update synchronization can cause serious lag. When the Second Life grid is updated to a new version, a lot of data needs to be re-synchronized between the asset server, the regions, and all of the people trying to log on after patiently waiting for the grid to be reopened. No matter how fast your client machine is, all you can do is have patience until the grid starts to recover from the downtime and the wave of people logging in.


### Server Statistics ###

To view information about the server you are currently on, open the statistics panel by going to 'View > Statistics Bar' in the menu.

At the top you will see some client information, such as your frame rate, current bandwidth, and packet loss.

::: Basic :::

Ping Sim: how long it takes for a command to be sent to the server which runs the current region your avatar is in (more literally the region your 'agent' is currently in)

Ping User: how long it takes to send a command to the centralized server which handles grid-wide messaging (user server).


::: Simulator :::

Under the Simulator section, you can see many statistics about the server which you are currently standing in.

- Time Dilation: This should stay close to 1.0. The lower this number goes, the more everything will appear to go into "slow motion". If this is goes down to 0.5, everything will move half as fast. If it gets down to 0.1, everything will move at 1/10th of the speed.

- Sim FPS: As long as this stays >= 45, you should be ok for the moment. This represents how many complete simulation cycles can be performed per second.

- Physics FPS: This should also be close to 45. It indicates how many times per second physical calculations are performed. It may go lower if there is a lot of physical interactions occurring in the region, which may also be reflected in the Time Dilation.

- Agent Updates/Sec: This should stay at about 20. This is the number of times per second that any changes in an avatar's position is relayed to everyone else.

- Main Agents: the number of people in the region. Generally the more people there are, the slower things will get, since updates to each person have to be sent to every other person. This can grow exponentially, which is why regions are usually capped with a maximum number of people per region.

- Child Agents: the number of people in nearby regions who are recieving updates from this region. This can slow down the region as well, but not as much as Main Agents.

- Active Objects: the number of objects in the region which have running scripts in them. The higher this goes, the more time the server has to spend handling their various behaviors, which can nibble away at overall performance.

- Active Scripts: the total number of scripts which are currently running in the sim.

- Script Perf: how many instructions per second are being processed by scripts.

- Pending Downloads: This number should stay near 0 most of the time. This indicates how many assets are pending to be downloaded to residents. Usually right after an upgrade this number will be high. As long as this number is not steadily increasing, it should be ok.

- Pending Uploads: This will probably be 0 most of the time. It indicates assets which are being sent to the region, usually by residents uploading things (images, sounds, etc).

- Time (percent or ms) - These show how much time is spent doing various tasks in the simulator.


::: Show Updates :::

You can see what objects are being updated with the "Show Updates" option checked under the Debug menu (if you do not have the debug menu, press Shift+Ctrl+Alt+D).

Anything (object, avatar, etc) that gets updated will have a small indicator float up from it, with a color representing what kind of update occurred:

Blue: minor update (only one part of the object was changed)
Red: full update (the object had to be entirely re-described)
Green: deleted (the object was derezzed)

The more often you see an update float off an object, the more network traffic (and probably sim resources) that object is using. Red updates are the worst. If you see an object emitting lots of red updates, it probably is using up a signifcant portion of the network traffic you are receiving.

[Note: this feature has been buggy lately so may or may not be working at the time you are reading this]


### Building Tips ###

Here are some simple tips to help keep server and client lag to a minimum when creating new things in SL:

::: Texture Size :::

Upload textures at 256x256 by default. Use 512x512 only if you absolutely need that extra detail. Anything higher is just excessive, and should be used VERY rarely. In some situations (ie clothing) anything above 512x512 will be scaled down anyway when it is baked onto your avatar.

If your texture will only be shown on a tiny surface, use a smaller texture. This will not only save space and bandwidth, but sometimes using too large of a texture on a small surface will result in a glitch where the higher resolution image never finishes downloading.

::: Scripting :::

- As tempting as it may be to always want to get as many updates as possible, try to use llSetTimerEvent() with as high of a value as you can tolerate. In most cases, anything below 0.5 seconds will default back to 0.5 anyway.

- Listens have a significant impact on the sim's performance. Try to limit how many llListen() handlers you create.

::: Prims :::

Prims with lots of curves will cause the client to render more triangles, which will impact their frame rate negatively. Try to use cubes and other straight edged geometry when possible if you would like your visitors to have the best experience possible.

Keep in mind that SL does not have very robust culling, so using a wall to hide complex objects will not speed up rendering significantly.

::: Light :::

Use light sources very sparingly. Ideally, you should not have more than a few light sources overlapping at once. Don't even bother trying to use more than six light sources in an overlapping area, as nobody will be able to see all of them at once.

:::

Please send me more suggestions for building tips!

### End ###

If you have any questions, please feel free to ask on Live Help, under the Help menu, or email support@secondlife.com or send me an IM if you see me online.

If you have any suggestions for how to improve this guide, please send me an IM =)

This text document is licensed under the Creative Commons Attribution-NoDerivs License.
http://creativecommons.org/licenses/by-nd/2.0/

You are welcome and encouraged to share this notecard with others, but only in an unmodified state. If you would like to contribute additions, or suggest a change please send me an IM. This way we will only have one most up-to-date version =)

Thanks for reading!

-- Kex


 Hors ligne
 

Afficher les messages postés depuis:  Trier par  

Poster un nouveau sujet Répondre au sujet  [ 1 message ] 


Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité

Panel

Haut Vous ne pouvez pas poster de nouveaux sujets
Vous ne pouvez pas répondre aux sujets
Vous ne pouvez pas éditer vos messages
Vous ne pouvez pas supprimer vos messages
Rechercher:
Aller à:  
 cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Traduction par: phpBB-fr.com
Dizayn Ercan Koc