Jump to content
Sign in to follow this  
Rubberene

Script time priorities?

Recommended Posts

I have a product I sell which consists of a HUD and an attachment. Two scripts. 0.06069 ms script time.  I have sold nearly 700 of them since I first listed them last May. The vast majority of people who buy them have no trouble, but occasionally I get a message from someone who says it "stopped working."  I think so far I have gotten this message about six times.

Inevitably I find that they are wearing a ton or three of scripts, for example:

[12:39] Script info: '*Anonymous* Resident': [336/376] running scripts, 20988 KB allowed memory size limit, 1.193797 ms of CPU time consumed.

In the case of this person, during the conversation I suggested several times that they take off some scripts, but they ignored this and insisted all they needed was a replacement "that worked." Furthermore, they insisted I give replacements to three of their friends, apparently just in case. I did all this, of course, but told them if they kept wearing so many scripts, the new ones would probably stop working for them before long. So far they are apparently happy. Fingers crossed.

I know from dealing with some of the others that when they get rid of all the unnecessary scripts, my product "magically" starts working again. What I would like to know, though, is why this happens. Is there some priority given to scripts based on script time, or something else? I think if I understood the reason this happens, I might be able to explain it to my customers in a way that would convince them that so many scripts are not a good idea. All the other reasons a gajillion scripts are a bad idea aside, of course. :)

 

 

Share this post


Link to post
Share on other sites

If you look at the Statistics Bar in your viewer (CTRL + Shift + 1), you'll be able to find a breakdown of how much time the region's servers are devoting to various tasks.  Generally speaking, as long as there is some "Free Time" showing, the servers are not having trouble handling all the work they are being handed.  As "Free Time" vanishes, though, the first thing that gets squeezed is Script Time.  That is, scripts do not create lag for the servers, but they can create lag for each other.  A script that is suddenly eating up a pile of server time will make other scripts slow to a crawl (or may simply stall).  I'm not sure if there is a pecking order among scripts when that happens, but I do know that the problem shouldn't normally happen at all until the region's servers are already busy juggling a pile of avatars, physical objects, and other stuff.

Share this post


Link to post
Share on other sites

This is a quite good tutorial for script resources: http://www.unitedjousters.com/index.php/tournaments/script-lag-very-important

My experience has been that if a sim runs over it's allocated resources then scripts start being delayed (and rarely failing) randomly. If a sim can only execute 80% of all scripts over a few seconds that should have run in one second, then there is a 20% chance that your script is delayed to the next second, a (0,2 x 0,2=) 4% chance that your script is delayed at least two seconds and an even lower chance that it is delayed more than 2 seconds or that it completely fails.

From your description I would guess that the relation between an avatar wearing many scripts and the HUD not working is purely coincidental. It is more likely that you have some code in there that crashes the HUD or stops it somehow.

Ok, your statement that getting rid of other scripts made your HUD working again doesn't fit my theory. But what you say really contradicts everything that I have experienced in SL.

Are you using a listener that might use a common channel and the commands that you transfer over the channel are common too? Maybe other attachments use the same channel and commands and interfere with your HUD? That's also unlikely but it would make more sense to me than blaming the general script load of an avatar.

That said, no avatar should put more than 0.25 ms script load on the servers! 1ms and more is antisocial behaviour!

Share this post


Link to post
Share on other sites

Hmmm .. I made load tests with a few 1000 scripts. Adding 100 scripts with a combined low CPU time of 1-2ms will not stop anything - there will only be short delays. You need much more for a noticeable effect. So I doubt that this will stop your hud completely. Maybe you make assumptions about the order of events happening and things fail.

I have an automatic vehicle flying though the sim. (0.03 CPU time) Even 80 slightly overscripted avatars on the sim didn't stop it. It will go a bit jumpy that's all.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...