If you are trying to put on a performance in Second Life that depends on well-timed scripting, you know it can sometimes be a challenge. Dance Shows, Theater, Sports Events, Combat Events, Amusement Parks, Particle Shows, many kinds of events fall into this category. This article will talk about some of the unique issues and also outline some of the tools I have created to handle them.
Enemy #1 : Script Lag
Unfortunately for those of us who depend on well-timed scripted logic, Regions give scripts the lowest possible priority. Regions take care of everything they need to do first: simulate physics, track avatars, send content to viewers, etc.. and with whatever time is left they process scripts that ask for attention. If the region doesn’t have enough time left to handle all the scripts that want attention, all scripts get delayed and we call this script lag.
In the past, script lag could actually cause avatars to crash. Luckily this is no longer the case, but it can still ruin your event, if that event depends on scripts running in a timely fashion!
One saving grace is that regions start with a large amount of unused capacity. Assuming you have the authority to manage objects on a region, with proper planning you can insure that you have enough resources to run a successful script-intensive event, even after many guests with their own scripted attachments arrive.
Strategy #1, Groom your Region
The first and best strategy should be to simply avoid using up the pool of sim script time in the first place by removing costly scripted objects that are not needed. This can be easier said than done, because traditionally it is difficult to determine which objects are the most costly, where they are in the region, and exactly what the costs mean.
To help solve this issue I’ve created a tool “MetaHarpers Region Script Performance Report” which inventories all scripted objects on a sim, measures their impact, and gives you a handy dashboard.
The dashboard tells you two very important pieces of information: Firstly “How much of my script time am I using right now?” and secondly “Based on this usage, how many typical visitors can the region host without script lag?”. These two pieces of information will give you the information you need to know if your next big event is likely to experience script lag or not.
If the data is telling you that you are likely to experience script lag, you have a handy sorted list showing you the most expensive objects, where they are, who owns them, and how many more visitors you could host if you removed them. For an example, you might see that a scripted object “My Texture Organizer” uses the equivalent of 2 typical visitor’s worth of processing time.
Strategy #2 Encourage your guests to be Low Impact
Since visitors often (always?) bring their own scripted HUDs and attachments with them, which consume your region’s resources, it makes sense that if you can reduce visitor’s usage, you’ll have more left over on the region for your own events.
The traditional difficulty with this strategy is that oftentimes it is not known or clearly explained what is “good” and what is “bad” script usage. Typical tools such as “get script info” can be cumbersome to use when you’re wearing a dozen scripted attachments. I frequently see arbitrary limits enforced at event venues such as “You must have less than 100 scripts” or “You must use less than 1MB of script memory” but these targets usually do not tie directly to script time actually consumed. They might have an impact, or they might not. This indirect relation to performance can lead to frustration, for example when a knowledgable user knows that their attachments are low-impact but a script counter insists they are over a limit, or when a visitor knows they are using too many resources but doesn’t know which attachment or HUD is best to remove.
To help provide a more accurate idea of “good” and “bad” I’ve created a few different tools that can determine whether a visitor is using more than “their share” of a region’s script resources. The visitor’s share is determined by a model based on their actual consumed script time, as well as how many other avatars in the region the visitor has to share resources with.
Not only can these tools provide a quick “good/bad” reading but they can also give you a sorted listing of an avatar’s attachments, showing how expensive each one is, along with HUDs as a whole.
One version of these tools can show a “top 5 most costly avatars” listing, along with the share of resources consumed by each one. For example, you might see that “Eve” is using “300%” of her share of script time. Another version of these tools can be quickly worn by avatars and gives simple “good/bad” feedback based on the region they are in along with the ability to optionally see more details, so they can determine for themselves which of their attachments are most expensive and efficient to remove.
Strategy #3 Extreme Measures
One strategy sometimes used to improve the pool of script time is disabling scripting features on a given parcel or given region. This will reduce the amount of resources consumed by visitors, but it can also be intrusive and lead to visitor frustration and confusion when their avatar does not behave as expected. Your guests may be so preoccupied trying to figure out what is wrong with their avatars that they distract attention from your event. For this reason it is not a recommended approach to take. However if you do decide to go this route there are a few things to know:
If you disable scripting on a parcel, the scripting restriction only comes into effect within 50m of the ground terrain. So if your event is in the sky, disabling scripts will have no effect. Also be aware that some attachments and HUDs that have keyboard-operated controls can continue running in no-script parcels.
If you disable scripting for everyone, make sure that scripting is enabled for your “land group”. Additionally, you should ensure that your land group cannot be joined without an invite or the no-script restriction can be easily bypassed.
There are new tools that make it easier than ever before to avoid script lag. You can use them to groom your region with efficient effort, and communicate with your visitors to encourage them to be responsible in an accurate, helpful manner. Use the strategies above to keep your large events running smoothly.