Time dilation, script time, sim fps - What's it mean???? - SLUniverse Forums
Navigation » SLUniverse Forums > Virtual World Discussion > General SL Discussion » Time dilation, script time, sim fps - What's it mean????


General SL Discussion Discuss topics related to Second Life

 
Sponsor:
Steampunk Victorian Caledon
Reply
 
LinkBack Thread Tools Display Modes
Old 03-17-2009, 05:04 AM   #1 (permalink)
The Purple
 
Chalice Yao's Avatar
HEYOO!
 
Join Date: Dec 2007
Location: Somewhere purple, Germany
Posts: 8,127
My Mood:
SL Join Date: 20. January 2007
Client: NaCl
Time dilation, script time, sim fps - What's it mean????

Hi!

Chalice here, and today I'm gonna sit down and have a talk with y'all about stuff that you hear ever so often, but also often narrow your eyes at in confusion. Sit through it. it's worth it.

Lag, 'time dilation', 'script time', 'sim fps'. Well, you narrow your eyes at the lag monster usually for other reasons than confusion. Usually to take better aim.
Anyways, we all know the issues. Sim slowdown! Lag! OH GOD MY WORLD IS AN INCARNATION OF SYRUP ARMAGEDDON FOR ME TO WADE THROUGH FOREVER.

And it ain't strawberry.

Well, yes. First off, it's important to differentiate between lag on the sim side, and lag on your PC's side.

Lag on your PC side. This is the lag that make things go -stuttery-, not smoothy-slow. When the screen does not update, when the camera only turns 3 times a second, when the client hangs and the hard drive howls. This can be caused by a slow graphics card, slow CPU, but also by slow, fragmented harddrives due to caching. And it's also not quite the topic of this post. newer hardware and cleaned up harddrives and not many system apps running is the only help for that.


No, I'm here to talk about the eerie sim-side of things. First off...sim FPS. You there! You have 12, right? And you, 34? And you there, you have a monster graphics card, you get 50.
Well, no no no. Sim FPS are not your graphics FPS.
Sim FPS are another way to say 'The sim updates/calculates stuff so many times a second'. You know, like graphics fps, just not for graphics.

Well, what are sim fps for? Everything the sim has to do. Wee.

* Sending updates of objects and avatars to other avatars..you know, when they change outfits, objects change textures and stuff. Play sounds.

* Networking stuff. Not quite the same. A sim also has to handle all sorts of networking from/to the other sims around it, asset servers, inventory/login/profile servers, sending avatars back and forth between them and whatever.

* Physics. When stuff falls, objects hit other physics objects or avs, and when somebody decides it's fun to orbit your loldog, physics come into play.

* Script time. Well, scripts do stuff. Or actually, scripts cause the sim to do stuff. And the time it needs for that is the so-calleds script time.


So lookie that. Lots for the sim to do. And now remember what I said earlier? Sim FPS. How many time a sim calculates/handles stuff a second.
And it gets 45 Sim FPS at max. So. If a sim gets 45 frames a second, how long of time is a frame? The answer:
22.222ms. 1000ms / 45.

But what does -that- mean?
Well, it simply means that the sole reason for sims getting slow is, when the sim needs to do stuff that accumulates to needing more than those 22.222ms per frame. After all, if all the listed above stuff takes 30ms per frame, you get less sim frames per second. in the case of 30ms of stuff, 1000/30 = 33 sim fps per second.

Pout. Now the sim only updates/calculates stuff 33 times a second instead of awesome 45, because the stuff going on demands so much resources. And things slow down. The term to measure a sim's slowdown is the so called 'Time Dilation' And time dilation is a simple value: It ranges from 0 to 1. And 1 means 'Everything is a-okay cap'n!'. 1 means no slowdown. 1 is playing your fave movie at 1x speed.

But what if time dilation is at, say...0.5? Well then. Your movie is playing at 0.5x the normal speed. Things are slooooow. All things. All things listed above..networking, scripts, physics. Everything. Because stuff is nomming...well? 44.4ms of time per frame. Double of what it should.


'TL;DR purple goddess of my wet dreams, what are you trying to say here?'

There is no TL;DR; summary here. First off, I want you to read the paragraph about lag again. It's important to differentiate between the two types of lag in every situation. I've seen so many people complain about sim lag while it was their PC giving having issues, that it's not funny anymore. Well, it is. In a way.

And second, it's time to talk about just what munchies those sim fps so much. My apologies to Munchflower if that just gave her a bad reputation.

* Big textures, particles, texture animations - Actually, no. Those, mostly, cause client lag. You remembered to read the paragraph about lag again, right? There is nothing big sim side going on. The only thing the sim needs to do is tell avatars 'Hey, this thing is doing this!'. While the network part of sim fps might rise due to textures, this is usually no problem unless you get to around 30 or 40 avatars. Then, yes...the network time of the sim fps gets demanding.



No, there are four much much worse contributors to sim fps lag:
Rezzing/derezzing, script amount, script efficiency and physics.

Rezzing/Derezzing:
Well, every time something gets rezzed, the sim needs to load all the info about it. That means content lists, starting scripts, sending prim geometry to the avatars around! And every time something derezzes, it either needs to send it to someone's inventory, or just kill it. This noms network time and updates, and doing so regularly with high-prim/high-script objects should be avoided. Yes, I'm talking to you, temp rezzers. Seriously, unless it's some kind of vendor that shows the model of a product temporarily on click, avoid those things for rezzing anything furniture or the like nonstop. It's not worth it.


Physics:
Careful. Very. Very. Careful.
Physics can be used for awesome effects. It's fun to play around with them, and there are decorations for the home and sim that make use of them. Spheres rolling down stuff, other stuff getting sent up by a hard shove..it's The Incredible Machine all over. However physics, when handled wrong, can also be an instant syrup doom to the sim. In Havok 1, the old SL physics engine of 2007 to early 2008, one could crash a sim with two (2) prims if desired. Yes, two. You really gotta wonder how the grid even stayed up the way it did. With Havok 4, things are not that bad, but there are things to look out for:
Avoid intersecting, stuck, avatar-trapping and other-physicals-bumping physical prims. At least if they are to be a permanent thing in your sim. This can eat sim fps..alot of them, instantly. If you play with physics, be careful, look at the sim stats, be sure whatever product it is you use or sell can't go wrong.



Script efficiency:
This deserves a whole thread of its own. It's complex, it takes lots and lots and lots of experience and learning to get right, you will facepalm at script you wrote a year ago, and it is also the major cause of rage between scripters of every kind. It's the thing every scripter thinks they're doing right, and the other don't do quite as right. Trust me, I gotta know. I'm a scripter, and even I can't evade that effect, nor the facepalming.

To keep some basic things short:
* One listener per object, unless you need more channels.
* Don't listen on 0. Ever. Unless the concept of the object absolutely needs it to listen to chat.
* Long timers. not 0.1. Oh god, not while(1).
* There is usually a much simpler way to accomplish the same thing.
* Thus, think simple
* Badly written scripts are one of the two major sources for the average sim-side lag in SL.



Script amount:
It's scary how much nothing but the amount of scripts in a sim can bog it down. With some exceptions, every script takes 0.003ms of sim frame time.
'But Chalice, is that...lol, is that 3 microseconds?'
Yes yes. It is. 3 microseconds. Lemme tell you about 3 microseconds per script. Lemme tell you about Mystery Fashionista X, a superdramahero from another e-galaxy, visiting earth-sim with her supershiny, colorchanging thigh-high 'I'm a morally correct fan-servicing hero, my dear fellow resident, stand aside.' boots. Usually they are high prim. And, due to people thinking it will make a difference of sorts, also no-mod. So..colorchange scripts.

And colorchange scripts are the devil. There is a way to have a single, small script do all the color changing. All the texture changing. With only a single listener, and that's it. For the whole object. This is not a problem.

The problem is that 99% of SL products with color change instead have a colorchange script for every prim they recolor. 0.003ms per usual script, remember? Or more. The really, really, really bad colorchange scripts also have a listener per script. Oh lord.
This is the reason why there are boots, necklaces, watches and whatever else that is high-prim and shiny out there that eat script time. Lots of script time. 0.4ms of script time or more, just because of the recoloring scripts in lots of prims.

Do you remember what I wrote way earlier about what the sim all needs to handle, per frame? 22.222ms for physics, scripts, networking, updates, etc? If only 10 avatars in a sim wear accessories that have such crappy recoloring scripts, they eat 1/5th of the total time the sim has available already. I'm not talking 1/5th of available script time. 1/5th of time available for everything. There you have your 3 microseconds, and what they actually do.

* Keep the amount of scripts in your objects and attachments to a minimum.
* Script amount is the other major source for the average sim lag in SL.






There. It's over. You're done! And you made it through my wall of text! I thank the big brainfart, random mood and some recent in-world events for making me write this, and I thank you for making it through it, and hope you learned a few things. The thread is now open to discussion, low-resource-use lolcats, and cake.
__________________
"Have you ever noticed that anybody driving slower than you is an idiot, and anyone going faster than you is a maniac?" - George Carlin
Chalice Yao is offline   Reply With Quote
2 Users Said Yay!:
62 Users Said Thanks :
Alexa Lioncourt, Ame, Amyla Wakowski, ArchTx Edo, Ayumi, BEARintheMorning, Beebo Brink, Beezle Warburton, Bobby Baudin, Cailyn Miller, CaleVinson, Catti Ninetails, Chance Abattoir, ChatNoir Moonsoo, Cincia Singh, Cindy Claveau, Circle Widdershins, Cristalle, derevaun, Dusky Jewell, eku Zhong, FlipperPA Peregrine, Galen McGinnis, Geaven Gall, Hypatia Callisto, jacqueline trudeau, Jahar Aabye, Jeni Roussel, Khamon, Khamudy, Kira Zobel, Kirari Kujisawa, Lewis Luminos, Malkavyn Eldritch, Max Herzog, Melodie Darwin, Menchor Barbosa, Miriel Enfield, Mocksoup Graves, nadir, Nephilaine Protagonist, Nikita Weymann, Nimue Jewell, Persephone Milk, Raindrop Drinkwater, Sansarya, Sean Gorham, Sidney Kwon, Sophia Tantalus, Starry Goss, Talon DeCuir, Tamara Artis, Tati, Tengu Yamabushi, Troy Vogel, Tyche Shepherd, Vaalith Jinn, Vaelissa Cortes, virrginia tombola, Wildefire Walcott, Willow Matthews, Zorena Deckard
Old 03-17-2009, 07:16 AM   #2 (permalink)
Senior Member
 
Miriel Enfield's Avatar
Behold, the power of flopsy ears.
 
Join Date: Sep 2007
Posts: 2,526
Nice post, Chalice. Thank you for writing it.

I do have a couple nitpicky comments, of course. And a question.


You mention the various lag sources as the typical problems in typical sims -- by which I assume you mean sims that aren't all that populated -- but a note about avatars themselves may be in order, since any crowded sim is going to be suffering performance issues just from all the people.


Regarding scripts... the LSL wiki says that:

Quote:
Originally Posted by LSLwiki.net
Each script receives a time slice (portion) of the total simulator time allocated to scripts. So a simulator with many scripts would allow each individual script less time rather than degrading its own performance. In addition, each script executes within its own chunk (section) of memory, preventing scripts from writing into protected simulator memory or into other scripts (which can include multiple scripts in the same prim or object), making it much harder for them to crash the simulator.
I honestly don't know: is this true? If it is, then how do excessive scripts drag down total sim fps? I can see a small performance hit, but it seems like it should mainly just hurt the performance of other scripts.


Quote:
Originally Posted by Chalice Yao View Post
Lag on your PC side. This is the lag that make things go -stuttery-, not smoothy-slow. When the screen does not update, when the camera only turns 3 times a second, when the client hangs and the hard drive howls. This can be caused by a slow graphics card, slow CPU, but also by slow, fragmented harddrives due to caching.
Or by inefficient building. Most builds in SL are laggier than they need to be. (And even efficient builders are stuck with things like sculpties, which are pretty slow in their own right.) The fact that you're getting low framerates in SL does not automatically mean your computer is slow.


Quote:
Big textures, particles, texture animations - Actually, no. Those, mostly, cause client lag. You remembered to read the paragraph about lag again, right? There is nothing big sim side going on. The only thing the sim needs to do is tell avatars 'Hey, this thing is doing this!'. While the network part of sim fps might rise due to textures, this is usually no problem unless you get to around 30 or 40 avatars. Then, yes...the network time of the sim fps gets demanding.
And does it ever. My working theory is that the relative lack of sim lag at my yearly jewelry fair is primarily due to my draconian texture restrictions. I'd bet money that a good chunk of Hair Fair's awful sim lag was caused by the bad combination of big textures + adjoining sims + lots of people. That said, I could be talking out of my butt, since I never thought to check the texture sim time for either.


Quote:
* One listener per object, unless you need more channels.
* Don't listen on 0. Ever. Unless the concept of the object absolutely needs it to listen to chat.
Not really disagreeing with you, but I'll say that my experience with listener script time has been that they're not the sim one shotters they're frequently made out to be, not even in a chatty environment. (I posted about an experiment I did with this, but I can't find the post anymore.) Channel 0 listens aren't good of course, and they will hurt performance if you get too many of them, but too many people act like even one will dramatically increase script lag.

Still, it was a good list.
Miriel Enfield is offline   Reply With Quote
1 User Agreed:
Old 03-17-2009, 07:27 AM   #3 (permalink)
The Purple
 
Chalice Yao's Avatar
HEYOO!
 
Join Date: Dec 2007
Location: Somewhere purple, Germany
Posts: 8,127
My Mood:
SL Join Date: 20. January 2007
Client: NaCl
Quote:
Originally Posted by Miriel Enfield View Post
You mention the various lag sources as the typical problems in typical sims -- by which I assume you mean sims that aren't all that populated -- but a note about avatars themselves may be in order, since any crowded sim is going to be suffering performance issues just from all the people.
Yes, that's what I was referring to when I said that textures in a high-population sim can indeed cause sim side stress :> (along with, of course, agents sending updates back and forth).

Quote:
I honestly don't know: is this true? If it is, then how do excessive scripts drag down total sim fps? I can see a small performance hit, but it seems like it should mainly just hurt the performance of other scripts.
I don't think the wiki is really up to par there. A whole sim's acitvities can be lagged into oblivion merely through scripts, not just affecting other scripts. This is especially noticable if it's done out of malicious purposes.

Quote:
And does it ever. My working theory is that the relative lack of sim lag at my yearly jewelry fair is primarily due to my draconian texture restrictions.
Way, way way too many people use 1024's, or even 512's in appropriately. :| And then they wonder why their stuff loads in so slowly.

Quote:
Not really disagreeing with you, but I'll say that my experience with listener script time has been that they're not the sim one shotters they're frequently made out to be, not even in a chatty environment. (I posted about an experiment I did with this, but I can't find the post anymore.) Channel 0 listens aren't good of course, and they will hurt performance if you get too many of them, but too many people act like even one will dramatically increase script lag.
Nah, a couple of listens don't hurt the sim overall at first, however it -does- slow down the whole listen events of all scripts in the objects the more listeners are in it (try that :3), and it's an advice mostly for commercial product creators. Their products spread in SL, and if it's stuff like furniture, poseballs, huds and things like that, listeners in a sim can accumulate very very quickly.
Chalice Yao is offline   Reply With Quote
1 User Said Thanks:
Old 03-17-2009, 07:43 AM   #4 (permalink)
Senior Member
 
Miriel Enfield's Avatar
Behold, the power of flopsy ears.
 
Join Date: Sep 2007
Posts: 2,526
Quote:
Originally Posted by Chalice Yao View Post
I don't think the wiki is really up to par there. A whole sim's acitvities can be lagged into oblivion merely through scripts, not just affecting other scripts. This is especially noticable if it's done out of malicious purposes.
Thank you. That's what I guessed, but I'm not very familiar with sim workings, and the wiki's explanation sounded sort of plausible.

Quote:
Nah, a couple of listens don't hurt the sim overall at first, however it -does- slow down the whole listen events of all scripts in the objects the more listeners are in it (try that :3), and it's an advice mostly for commercial product creators. Their products spread in SL, and if it's stuff like furniture, poseballs, huds and things like that, listeners in a sim can accumulate very very quickly.
Very true. I just mentioned that because I've seen people, who maybe aren't all that knowledgeable, acting like a single listener on channel 0 is catastrophic. It bugs me a bit -- of course, most pieces of technical information run through the resident rumor mill wind up bugging me.
Miriel Enfield is offline   Reply With Quote
1 User Agreed:
Old 03-17-2009, 07:48 AM   #5 (permalink)
*yawns loudly*

*SLU Supporter*
 
Misty Harley's Avatar
always in need of coffee
 
Join Date: Aug 2008
Location: US
Posts: 4,733
SL Join Date: Septemper 06'
Client: catznip,exodus,nirans
quick question:

Way, way way too many people use 1024's, or even 512's in appropriately. :| And then they wonder why their stuff loads in so slowly.


I always thought those were the sizes to use..preferably the 512's?
Misty Harley is online now   Reply With Quote
Old 03-17-2009, 08:08 AM   #6 (permalink)
Script Kitty
 
Jahar Aabye's Avatar
 
Join Date: Sep 2008
Location: Between our dreams and actions, lies this world
Posts: 10,876
SL Join Date: 2/16/2007
Business: Black Operations
Client: Singularity
Excellent post. I facepalm at stuff I wrote even a few months ago, just because every script that one writes gets progressively more efficient (or at least, it should). I also firmly believe that any scripter who doesn't facepalm at older stuff had better either be a scripting genius or (more likely) is simply too lazy to bother to script correctly.

When I script, what I've found helps me write things efficiently is to go back to the skills I learned about writing policy papers. Policy papers, for those of you fortunate enough to have never worked in government or public policy, are short little "book reports" essentially, in which the author has to distill hundreds or even thousands of pages of regulations, history, arcane facts relevant to the topic, options for courses of action, and predictions down to maybe at most 10-20 pages. It also must be written in such a way that an executive or legislator or policymaking bureaucrat can read it and get the information that they need from it in the 15 minutes (if that) that they have in their busy day to read through it. They're sort of like the sim in that they've got a lot to do and not a lot of time to spare for your crap, keep it short, keep it sweet, keep it simple, and make the essential points.

So when I script, I think of the VM as that policymaker or executive or legislator. Short on time, short on attention span, lots of other stuff to do. Keep the code short and sweet, get to the point, and don't include too many distractions.


On the subject of people putting scripts in every subprim for stuff that could be done in a single prim, a while back, like probably mid-2007, I bought a combat vest. It looked cool, had the option to change labels and stuff via a menu....but.....

It had about 80-90 scripts in its subprims, and it gets worse: each one had a listener script in it! Yes, instead of having one central listener, each script was listening. Now granted, it appeared to be on a backchannel (7, I think), but even so, every time one used the dialog menu to select a feature, the listen() event on 80+ scripts was activated!

Why dear lord, why????

The worst part was that a lot of this was for simple stuff. I can understand using scripts in subprims if he was using primmove, but this was for simple alpha toggles and texture toggles....actually, scratch the texture toggles, I think he actually used a prim with each texture on it instead, and just alpha toggled them. I was soooo tempted to IM him with the lsl wiki page for llSetLinkAlpha()....but I resisted.

It was a pity, too, because the guy was a decent builder, but apparently wanted to script everything himself. That's another important thing: builders, when you need something that involves complex scripting, find a good scripter. I know most of us are antisocial, arrogant, elitist assholes who get high on being able to make prims magically do things like we're in The Sorcerer's Apprentice, but we can be very useful.


With channel 0 listeners, they can be used efficiently if they are set to discriminate to the owner (or another specific avatar UUID), but it must be done in the llListen() function when the listen is set, it's not enough to simply have the listen open and check the key in the listen() event. That and making sure to check llStringLength() and cap it at a reasonably short amount (if it's commands for an object, you can probably reasonably set the script to ignore any string greater than 20-30 characters long).

This has the twin effect of making sure that the script isn't handling an ungodly amount of text, but also automatically filtering out most of the things set in chat in the first conditional, since I'd guess that the vast majority of statements are greater than 20 characters.

However, because that tends to get complicated, I would concur that it's best to just tell people "no channel 0 listens" because that's usually the best. The only problem is that I do occasionally have people tell me that it means that our scripts must be laggy because they have a channel 0 listen (and ironically, I get this from people whose objects will often pull twice the EPS).
__________________
Quote:
Originally Posted by Ava Glasgow
But I cannot take your arguments seriously when you back them up with links to ridiculously bad information. It's not bad because I disagree with it, it's bad because it really is bad. These sites demonstrate zero knowledge of the science they are discussing, they link almost exclusively to other non-information, and when they DO link to an authoritative source, they misrepresent what the source actually says.
Jahar Aabye is offline   Reply With Quote
Old 03-17-2009, 08:13 AM   #7 (permalink)
Novice Harpist

*SLU Supporter*
 
Khamon's Avatar
Thumbs Up Sweetie
 
Join Date: Jun 2007
Location: Alabama
Posts: 9,627
My Mood:
SL Join Date: November, 2003
Blog Entries: 1
Quote:
Originally Posted by Chalice
Sending updates of objects and avatars to other avatars..you know, when they change outfits, objects change textures and stuff. Play sounds.
It seems reasonable to pin this point down to every move we make & gesture we invoke. When in a crowd, sit down, remove texture rotating attachments, turn off those godsawful AOs.

Quote:
Physics. When stuff falls, objects hit other physics objects or avs, and when somebody decides it's fun to orbit your loldog, physics come into play.
Again, every step we take charges the physics engine; the avatars are always physical.

Great post! There is one more lag issue caused by connection bottlenecks. We can reference sim ping time in that same screen to see if that bears further investigation.
__________________
[16:43] Vinney Lorenz: unban me and give me my land, or i will get u in front of the courtyard
Khamon is offline   Reply With Quote
Old 03-17-2009, 08:20 AM   #8 (permalink)
Senior Member
 
Miriel Enfield's Avatar
Behold, the power of flopsy ears.
 
Join Date: Sep 2007
Posts: 2,526
Quote:
Originally Posted by Misty Harley View Post
quick question:

Way, way way too many people use 1024's, or even 512's in appropriately. :| And then they wonder why their stuff loads in so slowly.


I always thought those were the sizes to use..preferably the 512's?
Shortish answer: no. 512's are overkill in a lot of instances (including vendor images), and 1024's are almost always too big. I've used maybe two 1024's in my entire time building.

Longer answer: Mostly no. There's no one texture size for everything. If you have to have a baseline texture size, 256 x 256 is a good choice, but it really depends on what you're doing. Many things can be smaller, or not square, though a few really do need to be larger. You should use the smallest texture you can get away with. In a lot of instances, this will be smaller than you think, and certainly smaller than 512 x 512.

Texture sizes do, however, need to be a power of two. They don't need to be square, but all the dimensions must be a power of two. So 512 x 128 is fine, and so's 32 x 64, since 32, 64, 128, and 512 are all powers of two.
Miriel Enfield is offline   Reply With Quote
1 User Agreed:
Old 03-17-2009, 08:21 AM   #9 (permalink)
Script Kitty
 
Jahar Aabye's Avatar
 
Join Date: Sep 2008
Location: Between our dreams and actions, lies this world
Posts: 10,876
SL Join Date: 2/16/2007
Business: Black Operations
Client: Singularity
Quote:
Originally Posted by Misty Harley View Post
quick question:

Way, way way too many people use 1024's, or even 512's in appropriately. :| And then they wonder why their stuff loads in so slowly.


I always thought those were the sizes to use..preferably the 512's?

No.

They are almost always inappropriate, and also generally unnecessary. Here's why:

Most LCD monitors have a native resolution of 1280x1024, and will not run any higher. For HDTVs, it's 1920x1080. Some CRT monitors can do much higher resolutions. But at any rate, it is rare to see anyone running SL at anything higher than 1280x1024, or 1920x1080 in the extreme cases, and even then, many people run it at a lower resolution so as to get a better framerate.


Now, at 1280x1024, this means that the image displayed on the screen itself is 1024 pixels high. This means that a 1024x1024 texture is only going to be displayed in full resolution if someone zooms in on it such that it fills their entire screen. Since an HDTV monitor is still only 1080 vertical pixels, this holds true even then. There are literally not enough pixels to display the full resolution unless they zoom in all the way, it is just physically impossible. Thus their client is just going to resize the texture anyways.

Even with a 512, the texture would have to take up half of their screen for it to render in full resolution. If they're zoomed out any farther, the image will be resized. And keep in mind that this is in 1280x1024 or 1920x1080. In 800x600 or 1024x768, which is more common for CRT monitors, you would never even be able to render the 1024x1024 texture fully, and the 512x512 texture only becomes visible when zoomed in almost all the way.

So those 512 or 1024 textures are almost never going to actually be viewed in full resolution. Thus there is very little point to having a 1024 or 512 texture if it's going to be resized to a much smaller texture on everyone's machine. Nobody is going to see the texture in high resolution unless they zoom in really close, but they still have to download the entire full resolution texture from the server.

So this means that using 1024 or 512 textures means that people will have to wait longer for them to load, but they will still only really look the same as a 256 or 128 texture would. Add to this the amount of memory that these textures take up, and an object with 100MB worth of textures (yes, they do exist) is using up half of your 256MB graphics card's memory (and then even after the object is no longer being rendered, that's still taking up a decent amount of cache space).

This is one reason why ARC fails, because it fails to take into account texture sizes.
Jahar Aabye is offline   Reply With Quote
2 Users Agreed:
Old 03-17-2009, 08:39 AM   #10 (permalink)
Script Kitty
 
Jahar Aabye's Avatar
 
Join Date: Sep 2008
Location: Between our dreams and actions, lies this world
Posts: 10,876
SL Join Date: 2/16/2007
Business: Black Operations
Client: Singularity
Quote:
Originally Posted by Khamon View Post
It seems reasonable to pin this point down to every move we make & gesture we invoke. When in a crowd, sit down, remove texture rotating attachments, turn off those godsawful AOs.
Yeah, the gestures also add to database calls when they're using sounds and animations, so spamming gestures can increase sim lag in that manner as well.



Quote:
Again, every step we take charges the physics engine; the avatars are always physical.
Unless the avatar is actively penetrating an object or being penetrated, or having a lot of things collide with it, it's actually not that big of a deal for an avatar to just move around. An avatar is represented as a single physical box, and walking or even running doesn't involve high speeds.

So just just walking around isn't going to make a huge impact on the physics engine, it's just a single physical object moving around. Where the physics engine tends to get screwy is not so much with moving a single object, but with moving a lot of objects linked together (hence the 32-prim physical link limit), or when handling collisions.

Collisions tend to be the big physics killers. Fortunately H4 can handle interpenetration fairly well, H1 did not. I still remember one time at Rausch (which is a very good place to go to get plenty of lessons in what not to do when scripting), a guy got the bright idea to make a "movelock" using a prim, I think a torus, twisted into a corkscrew shape, wrapped around his body, and made physical. Note that this was not attached to him (attachments are phantom), but rather he rezzed it and placed it around him.

The result of this was that the prim was penetrating his body in several places, and because of how it was shaped, it couldn't get free. This was back in the bad old days of H1, and the result was that this single idiot managed to unintentionally slow the entire sim down to a crawl. Fortunately, since this was Rausch, this was not out of the ordinary. Several of us kept telling him to remove the damned thing or the sim would crash. He refused for whatever reason, possibly related to the fact that according to his profile he had just recently "graduated" from the teen grid. Sure enough, after a few minutes of 0.2 and 0.1 time dilation, the sim crashed.



Quote:
Great post! There is one more lag issue caused by connection bottlenecks. We can reference sim ping time in that same screen to see if that bears further investigation.
That's generally a connection issue between you, your router, your ISP, and LL's servers. When Grey was deployed in Iraq, that was a serious problem, and imposed some severe limitations. I'd classify that as a subset of client-side lag, since it's a function of your connection.

Connection bottlenecks within LL's network, such as between servers, database, asset cluster, etc would show up as increased net time, and that is a source of server-side lag.
Jahar Aabye is offline   Reply With Quote
Old 03-17-2009, 08:52 AM   #11 (permalink)
Adult Content
 
Rhonda Huntress's Avatar
 
Join Date: Dec 2008
Posts: 1,484
My Mood:
Just to toss this in to the script time slice discussion.
Going by the wiki, there is a set ammount of time allowed for scripts.The more scripts there are, the smaller bit time they get to run. If a script is not through, it has to wait for the next time slice and continue from there. So the smaller the time slice a script gets, the longer it takes to run. Again, we percieve this as lag. Like clicking on the dance ball at a club. When it is sparse, you get the pop up right away to start dancing. When it is crowded with all those scripted bling boots belts and other stuff, it "takes forever" just to start dancing; "this place is laggy as hell!" The time dilation could well be .90+ but it will seem laggy to the people there.
Rhonda Huntress is offline   Reply With Quote
Old 03-17-2009, 08:56 AM   #12 (permalink)
The Purple
 
Chalice Yao's Avatar
HEYOO!
 
Join Date: Dec 2007
Location: Somewhere purple, Germany
Posts: 8,127
My Mood:
SL Join Date: 20. January 2007
Client: NaCl
Quote:
Originally Posted by Rhonda Huntress View Post
Just to toss this in to the script time slice discussion.
Going by the wiki, there is a set ammount of time allowed for scripts.The more scripts there are, the smaller bit time they get to run. If a script is not through, it has to wait for the next time slice and continue from there. So the smaller the time slice a script gets, the longer it takes to run.
There is both, really, scripts just running slow, and scripts causing everything else to slow down by their resource usage. The issue is, time dilation is one thing, the script showing the CPU who it's daddy is is another. And sadly enough, at times, one causes the other. it is, as I said, quite possible to make a sim go catatonic in all regards, merely with abusive scripts that don't rez anything.
Chalice Yao is offline   Reply With Quote
Old 03-17-2009, 09:06 AM   #13 (permalink)
Senior Member
 
Eata's Avatar
:confusedcat:
 
Join Date: Sep 2007
Posts: 1,271
My Mood:
Business: Breach
It's a shame that a lot of fashion makers don't really know anything about scripts leading to the many scripts for alpha/colour/texture change, like the bad old days before we had llSetLinkPrimitiveParams with all the options.

I want to say a bit more about frames as it might help the confusion between sim and client frames.

People might expect the simulation to happen smoothly in "real time", whilst it appears this way just like video you are actually getting a sequence of snapshots that gives the impression of real time. Everything only gets updated once every 22MS, inbetween nothing happens as such, the sim does all the calculations and packages them up for the next frame.

This isn't quite how the networking works, your client only needs to be told a pretty small about of information. Sure when an object is created you need to know all of its properties, so loading the sim can take awhile but once it's there you only need to get partial updates on changes, if any. The more externally active objects are the higher your networking time is going to be as the sim lets the clients know what's up.

Last edited by Eata; 03-17-2009 at 09:13 AM.
Eata is offline   Reply With Quote
Old 03-17-2009, 09:07 AM   #14 (permalink)
Script Kitty
 
Jahar Aabye's Avatar
 
Join Date: Sep 2008
Location: Between our dreams and actions, lies this world
Posts: 10,876
SL Join Date: 2/16/2007
Business: Black Operations
Client: Singularity
Quote:
it is, as I said, quite possible to make a sim go catatonic in all regards, merely with abusive scripts that don't rez anything.
I concur. I have personally witnessed situations in which sims have been slowed to a crawl by a few very badly written scripts. In some cases, these weren't even malicious scripts, just very poorly written ones. I have even seen sims crash as a result of this.

When it's lag caused by a few scripts, or generally when it's a single object, the main culprits are often:

short timers that are doing a lot in the timer() event

short llSensorRepeats() with a lot going on in the sensor() event

Lots of linked messages flying around with poorly implemented (or else nonexistent) discrimination such that every script winds up going through dozens of conditionals for each linked message....and often they're using multiple linked messages to convey information that could be condensed into a single linked message.
Jahar Aabye is offline   Reply With Quote
Old 03-17-2009, 10:17 AM   #15 (permalink)
is a pussy.
 
Hypatia Callisto's Avatar
Laughs and sneers in LOLCat
 
Join Date: Jun 2007
Posts: 8,120
My Mood:
SL Join Date: February 8, 2006
Quote:
Originally Posted by Jahar Aabye View Post
No.

They are almost always inappropriate, and also generally unnecessary. Here's why:

They can be used to good effect to tile many textures (texture atlas), which reduces the amount of textures in general called for. One texture at 1024 = four 512 textures or 16 textures at 256.

For signage in shops its a great thing.
__________________
"To begin with," said the Cat, "a dog's not mad. You grant that?"

"I suppose so," said Alice.

"Well, then," the Cat went on, "you see, a dog growls when it's angry, and wags its tail when it's pleased. Now I growl when I'm pleased, and wag my tail when I'm angry. Therefore I'm mad."

"I call it purring, not growling," said Alice.

"Call it what you like," said the Cat.

Last edited by Hypatia Callisto; 03-17-2009 at 10:24 AM. Reason: added wikipedia link
Hypatia Callisto is offline   Reply With Quote
1 User Said Thanks:
Old 03-17-2009, 10:56 AM   #16 (permalink)
Senior Member
 
Eata's Avatar
:confusedcat:
 
Join Date: Sep 2007
Posts: 1,271
My Mood:
Business: Breach
I would bet good money he's aware of that...
Eata is offline   Reply With Quote
1 User Agreed:
Old 03-17-2009, 11:05 AM   #17 (permalink)
is a pussy.
 
Hypatia Callisto's Avatar
Laughs and sneers in LOLCat
 
Join Date: Jun 2007
Posts: 8,120
My Mood:
SL Join Date: February 8, 2006
Quote:
Originally Posted by Eata View Post
I would bet good money he's aware of that...
needs to be said and as it wasn't, I did
Hypatia Callisto is offline   Reply With Quote
Old 03-17-2009, 11:14 AM   #18 (permalink)
Script Kitty
 
Jahar Aabye's Avatar
 
Join Date: Sep 2008
Location: Between our dreams and actions, lies this world
Posts: 10,876
SL Join Date: 2/16/2007
Business: Black Operations
Client: Singularity
Despite being a scripter, I am fully aware of using texture maps as a way to load many textures as one single texture.

However, that is really the only situation in which using 1024 or 512 textures is appropriate. I was responding to a post in which someone said that they had been told that those were "the sizes to use." I wanted to explain why using a single texture at 1024 or 512 was very inappropriate, and were not "the sizes to use" in most situations.

But yes, they make sense if you're combining many textures together on one large texture, but remember that while it means being able to load multiple textures as a single file, that single file will still take a while to load, so for something like vendor images, you're better off keeping the textures lower.
Jahar Aabye is offline   Reply With Quote
Old 03-17-2009, 11:19 AM   #19 (permalink)
is a pussy.
 
Hypatia Callisto's Avatar
Laughs and sneers in LOLCat
 
Join Date: Jun 2007
Posts: 8,120
My Mood:
SL Join Date: February 8, 2006
Quote:
Originally Posted by Jahar Aabye View Post
But yes, they make sense if you're combining many textures together on one large texture, but remember that while it means being able to load multiple textures as a single file, that single file will still take a while to load, so for something like vendor images, you're better off keeping the textures lower.
actually, they load faster and are lower lag. Because there's less stress on the asset server to load a lot of little textures, so they actually end up rezzing faster.

We've used this for many situations in Caledon where texture lag was a major factor, and it's something the Lindens agree on. It's fairly technical but it in fact reduces stress all around on your video card and sim network traffic. And it allows me to do some odd things with texture sorting that you wouldn't normally think of
Hypatia Callisto is offline   Reply With Quote
Old 03-17-2009, 11:46 AM   #20 (permalink)
*yawns loudly*

*SLU Supporter*
 
Misty Harley's Avatar
always in need of coffee
 
Join Date: Aug 2008
Location: US
Posts: 4,733
SL Join Date: Septemper 06'
Client: catznip,exodus,nirans
ok..so 1024-512's aren't necessarily a bad thing..but for optimal performance...a smaller texture would be best. Especially if your building a smaller item (for instance...smaller mushrooms versus what Hypatia uses the larger textures for). But over all....1024 and smaller is still better then anything larger then a 1024? Hope I got that right.

What about for skins? I use 512 when I do the eloh mod's..which seem to rez alot faster and stay rezzed (I don't get the blur as often) then other skins.

I want to thank Chalice for starting this thread and everyone giving information...there are a few things I honestly did not know and need to as a builder (novice for the most part compared to all of you though).

One thing I do know that I wish more sim owners realized....using the same textures throughout the sim helps with client lag that someone feels as well. I notice a huge difference in my own lag when I remember to do that versus the area's I went a little texture crazy and still need to go back and fix.
Misty Harley is online now   Reply With Quote
Old 03-17-2009, 11:48 AM   #21 (permalink)
*yawns loudly*

*SLU Supporter*
 
Misty Harley's Avatar
always in need of coffee
 
Join Date: Aug 2008
Location: US
Posts: 4,733
SL Join Date: Septemper 06'
Client: catznip,exodus,nirans
oh and another texture question....I have heard the smaller you go, the less of fine detail you will. I question that now when taking into consideration a person doesn't fully load up the texture to begin with...so would this still hold true?
Misty Harley is online now   Reply With Quote
Old 03-17-2009, 11:53 AM   #22 (permalink)
is a pussy.
 
Hypatia Callisto's Avatar
Laughs and sneers in LOLCat
 
Join Date: Jun 2007
Posts: 8,120
My Mood:
SL Join Date: February 8, 2006
Quote:
Originally Posted by Misty Harley View Post
What about for skins? I use 512 when I do the eloh mod's..which seem to rez alot faster and stay rezzed (I don't get the blur as often) then other skins.
Skin artists who use 1024s are just contributing to lag, because your client will reduce the textures to 512 and reupload them as that after baking.

Better to do that texture reduction yourself on clothing and skin items. I do often work at 1024 or even 2048 when doing avatar texture work, but I reduce it before uploading to SL.
Hypatia Callisto is offline   Reply With Quote
1 User Said Thanks:
Old 03-17-2009, 11:56 AM   #23 (permalink)
Senior Member
 
Miriel Enfield's Avatar
Behold, the power of flopsy ears.
 
Join Date: Sep 2007
Posts: 2,526
Quote:
Originally Posted by Misty Harley View Post
ok..so 1024-512's aren't necessarily a bad thing..but for optimal performance...a smaller texture would be best. Especially if your building a smaller item (for instance...smaller mushrooms versus what Hypatia uses the larger textures for). But over all....1024 and smaller is still better then anything larger then a 1024? Hope I got that right.
You can't go larger than 1024, actually. SL doesn't allow it.

Smaller is better. Textures can cause huge amounts of lag, so go as small as you can. 1024 x 1024 is (unless you're doing the texture atlasing thing) too big for almost everything. 512 x 512 is too big for most things. Don't aim for 1024 x 1024 and under -- that's too big. If you want a texture size to stay under, try 512 x 512 (not 512 x 512 and under, just under 512 x 512, period).

Quote:
What about for skins? I use 512 when I do the eloh mod's..which seem to rez alot faster and stay rezzed (I don't get the blur as often) then other skins.
Skins and non prim clothing get automatically resized to 512 x 512 when you're wearing them, no matter what size they started as. So 512 x 512 is fine.
Miriel Enfield is offline   Reply With Quote
1 User Said Thanks:
1 User Agreed:
Old 03-17-2009, 12:00 PM   #24 (permalink)
*yawns loudly*

*SLU Supporter*
 
Misty Harley's Avatar
always in need of coffee
 
Join Date: Aug 2008
Location: US
Posts: 4,733
SL Join Date: Septemper 06'
Client: catznip,exodus,nirans
just about everything I use is 512 x 512 when I make them myself. With one exception where I did a 1024x512..grass I think although I can't remember why I did that..playing probably.

Thank you! be a pain to re-size everything if I had to go smaller then what I already do.
Misty Harley is online now   Reply With Quote
Old 03-17-2009, 12:04 PM   #25 (permalink)
is a pussy.
 
Hypatia Callisto's Avatar
Laughs and sneers in LOLCat
 
Join Date: Jun 2007
Posts: 8,120
My Mood:
SL Join Date: February 8, 2006
Quote:
Originally Posted by Misty Harley View Post
oh and another texture question....I have heard the smaller you go, the less of fine detail you will. I question that now when taking into consideration a person doesn't fully load up the texture to begin with...so would this still hold true?
That's true on a lot of things, especially buildings where a 256x256 doesnt have enough detail.

One trick I use is I repeat the use of a texture. If I have a large texture on a build, I am sparing in the number of those textures, and repeat and reuse wherever I can.

Keeping the number of unique textures down is really important, just as important as keeping the size of textures down to the smallest necessary.
Hypatia Callisto is offline   Reply With Quote
1 User Said Thanks:
1 User Agreed:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On