Almost done WIP: Script Lag Monitor

EDIT: So what happened? This got delayed due to a bad LOD on the mesh I’m using for the text. Other people have given me free replacements (thank you for that) – but now I have to rewrite these lines:

    while(++i)
    {
        charA = (96 + llSubStringIndex(charset,llGetSubString(s,(faces + i) * 2,(faces + i) * 2))) % 96; //unfound chars will use the last char(DEL) in the charset as a replacement, null strings with use the first char(space) in the charset
        charB = (96 + llSubStringIndex(charset,llGetSubString(s,((faces + i) * 2) + 1,((faces + i) * 2) + 1))) % 96;
        integer column = ((96 * charA) + charB) % 85; //85 = (1024 pixel texture width / (6 pixel char width * 2 chars per set)
        integer row = ((96 * charA) + charB) / 85;
        PARAMS = (PARAMS = []) + PARAMS + [PRIM_TEXTURE,faces + i,"5e947299-739e-1c42-fb30-64e04bc0510d",<1.0,1.0,0.0>
,<(float)column * (12.0 / 1024.0),(float)row * -(8.0 / 1024.0),0.0>
,0.0];
    }

To apply text to things with a different UV map than the mesh I had used. And that is proving more complex than I expected.

I’ve been working on a new scripting project for the past few days:

This thing will monitor a region defined as either your parcel, all parcels you own in the sim, or the whole sim – and report back the top 8 laggiest avatars as defined in order of the ‘script time’ they are using.

Script Time is defined as:

the average CPU time (in seconds) used by scripts in an object or agent. Like top scripts, the time reported is the average script time per frame for the last 30 minutes for all scripts on the object. If the object has been in the region for less than 30 minutes, the number reported will be the average time per frame since the object entered the region.

It is getting it’s values from llGetObjectDetails: http://wiki.secondlife.com/wiki/LlGetObjectDetails

There has long been debate about the value of all these metrics in relation to ‘lag’. A lot of that revolves around people who are too picky over the definition of lag. Insisting on a technical definition rather than a ‘common use’ definition.

The common use definition is easy:

‘This stuff is slowing me down. Things are slow.’

The technical definition wants different words for:

  • The server is slow
  • My connection is slow
  • My computer is slow
  • My own butt is too slow clicking them keys
  • 27,372 different other things that most people just define as “this crap is freaking slow”.

All I care about is “this crap is slow”.

– That is how I define lag… I know that according to a computer science manual this makes me the equivalent of an Amish from the year 3702 B.C. who doesn’t even know what a stone axe is (ps: Amish didn’t exist back then. I know). Fine… But that’s what most people mean when they say “SL is laggy”. The mean their experience is slow.

So…

In the world of “this crap is slow” all of these metrics matter to some degree. They each indicate something different – but it all adds up to “WTF is wrong with my SL?”

The most important one of them though – the one that actually says “Yo… you, yeah you… WTF is you doing? Cut it out already!” is Script Time.

– This one is saying that person’s scripts are using up a measurable amount of CPU time…

Now we can argue about “the sim will still get everything done because scripts come after other resources and so your stuff will be done…”

But I want my stuff done now… I don’t want to have to step into the Tardis and have the Doctor take me to the end of the Universe to finish my ‘sit in chair’ action…

Sure it will get done… the CPU just pushes it off…

Kinda like Congress…

Push it off to after the next election… and again… and again… because it doesn’t want to pay that ‘time’ yet…

Even the people who say ‘Script Time is meaningless’ say so in terms of “because someday, long after the sun has exploded and we’ve moved to Earth 9 and the Face of Boe has passed away… (and even CW has run out ways to bring him back for the next season of Arrow) that crap will be done… so it’s not actually lag, because it does happen eventually…”

… Well even in that we’re admitting that “this crap is freaking slow”.

So…

I sort this meter by Script Time because it’s a concrete measure.

I show total scripts – that’s more a human curiosity thing.

Let’s say I’m running one beastly script that eats up 90% of a sim’s resources and you’re running 103 tiny little scripts that don’t do much of anything… who’s the bigger problem in that? Me. So ‘Total Scripts’ is great for drama but doesn’t mean much by itself.

Still I probably couldn’t pass around a meter unless I had that value on it…

Memory…

Script memory does mean something. But it is allocation rather than use. Allocation is more important than people think though…

Let’s say you have a nice closet rack with 72 clothing hangers on it. I say “I reserve these 64 hangers for me, you get the rest”

I put up 3 dresses. You’re standing there with 20… You put up your first 8 and then reach for the 9th hanger and I slap your hand away saying “that hanger is mine.”

– I only used 3… but I allocated 64.

This is why allocation matters.

Because you now have to keep swapping 11 dresses in your hand with the 8 on the rack and juggling that mess… because I’ve been a jerk and reserved the other 64 for myself and walked away.

There are tools in SL’s coding language to ‘change your allocation based on what you used’… to look at the rack after I put up 3 dresses and say “oh hey… I only used 3, you can use the other 61 now”…
– But most SL script makers don’t use this code… it’s why almost everything in SL, when you look at the script usage:

Shows a 16 or a 64, or some multiple of those numbers… There’s a reason I picked 64 hangers… SL’s mono language only sells hangers in packs of 64… then lets you tell the closet how many you used and let other people use the rest. The older LSL pre-mono system sold them in packs of 16 and made you use them all, and if you had 17 dresses… tough.

So… Script Memory usage is useful… but also kinda tricky… and it’s subject to a massive amount of drama among the community because of the issue of it being allocation and not usage and questions on ‘what’s that mean’.

So I report it… but I sort by Script Time instead.

Arc…

This is the old metric that was used before ‘Avatar Complexity’. There actually two versions of ARC in SL, and one was total junk, the second one was almost good, but not really good. I have no idea which one SL’s code reports – but neither is the current system.

However SL code has no way that I could find to get ‘Avatar Complexity’, and again a lot of meters report this value. While it is not accurate, it IS still useful to see in terms of sort order… the higher someone is on, the more laggy they “probably are” to those around them – in terms of more stuff to have to deal with when that person is around you… but it’s hard to say at what point is there an issue… and with modern graphics some people might be easier to ‘render’ (see) who have higher numbers than others… So Arc is only “sometimes useful”. We definitely do NOT want to sort the list based on, nor take action or warn people based on values in it.

If we had ‘Avatar Complexity’ that wold be different – it is possibly even more useful than Script Time for telling you if someone around you will cause you ‘lag’ (as in “slow your SL down” – you people who want technical definitions of the word lag can stuff it).

Finally we get to ‘Download Weight’ – I don’t think anyone else reports this, it was a curious metric I found in the LSL code:

http://wiki.secondlife.com/wiki/OBJECT_STREAMING_COST

http://wiki.secondlife.com/wiki/Mesh/Mesh_Streaming_Cost

I am calling it ‘Download Weight’ – what it is referred to in the second article, rather than ‘Streaming Cost’ because this isn’t your Netflix bill…

Here’s some techie mumbo-jumbo to make this more confusing:

“The streaming and rendering cost of a Mesh is directly related to the number of bytes in a Mesh asset LOD slot, and the likelihood that a given LOD will be downloaded and displayed can be computed based on the size of the object. Imagine a set of 3 concentric circles centered on an object where each circle represents the transition boundary between LODs. The streaming/rendering cost of that object can be determined by examining the size of those circles vs the number of bytes in the relevant LODs. Uploading a high LOD only will result in the load of the high lod being applied to the entire 256m, while uploading appropriate LODs will result in the lion’s share of 256m being applied to the lowest LOD. ”

Confused yet?

This one basically means… ‘ya’ll gots some stuff that is taking time to download and render’.

Um so… yeah… Is that important? How much is too much? If I am at 31 and you are at 753 does that matter?

This one looked interesting to mentally note and observe… but it is too vague to use for determining ‘who’s naughty and who’s nice’…

So the end of all that blathering is that this meter sorts on and warns on Script Time only.

It is basically the only metric we can have an objective opinion about that says “that person over there with a high script time is causing a problem for the sim”.

How much is high?

I dunno…

Yeah… that’s right. I don’t know. No one really does. So I made it a setting you can adjust in the config notecard.

– This is one of the major reasons critics of these meters don’t like them. “We don’t know how fast is too fast to drive on the freeway so there should be no speed limit and I’mma gonna go do 372 mph next to a school zone. da’freak with any kids I run over.”

I think it’s better to just say “you know… most people seem to be under this… so why don’t I double it, and set my gauge there…”

There’s actually a lot that I made configurable in this thing.

Here’s the config notecard:

# warn and then take action above this number, the value is in miliseconds.
scriptMemThreshold = 0.25

# Rerun the region scan every ‘scanHowOften’ seconds. Don’t slow your sim down scanning too often.
# The scan itself takes from 5-10 seconds to process all the data and send out warnings / take action, so
# any faster than 20 risks the script tripping over itself.
# This is protected against values below 20. Any values below that will be treated as 20.
scanHowOften = 30

# countToAction
# This number is how many warnings a person will get before action is taken against them.
# This is protected against being set below one. Values below that will be treated as 1.
countToAction = 3

# graceCount
# This is the number of scans to do before giving any warnings.
# When an avatar enters a sim, that sim has to load in everything about that avatar’s current status: the things you see, the scripts,
# and various assorted bits of data. All of this causes avatars to ‘spike’ on their lag reports for as much as a minute after appearing on sim.
# For this reason we don’t pester people who just popped in. If you find that people you know are low on lag and getting ‘warned’ by this monitor,
# up the value of this setting a little bit and have them test out teleporting in and out until you “find the sweet spot” for your sim.
# New avatars will still show on the monitor when they first join, just not get spammed, so you can watch the monitor to see how long it takes
# your sim to ‘load them in’ and bring their numbers down. And if it’s taking seriously long… see about asking somebody for a sim restart, or
# look into what’s going on with slowing your sim down… (some years ago I had to delete an entire line of furniture I had stuffed into a temp-rezzer
# because it will killing my sim – this was the day that convinced me to stop using temp-rezzers, and to update my brands of furniture…). I had
# thought it was laggy avatars, but as soon as I cleared that junk out, my sim was oiled-up and ready for action.
# For every step of this value, the monitor will wait ‘scanHowOften’ seconds before sending warnings.
# This value is protected against going below 1. Any value below 1 will be treated as 1.
# furthermore, for most sims, 1 is actually the right value to use.
graceCount = 1

# use ban, eject, teleport, or warn. All other entries are treated like eject.
# ban: puts the avatar on the parcel ban list – use this carefully.
# eject: throws the avatar off to the nearest land not owned by the owner of the ‘ScriptMonitorZapper’. Fails to work on a region with no bordering regions.
# teleport: teleports the avatar home.
# warn: takes no action except to keep messaging the offender every 30 seconds asking them to reduce their lag.
warningAction = eject

# warningMessage
# This is the message sent to people to warn or notify them about being laggy.
# Split into parts 1 and 2, max 255 character each, in case you want an extra long message (like the example).
# This MUST include one use of both [*] twice in the message.
# The first use will report how much lag the offender is causing, the second will report the sim’s “scriptMemThreshold”.
warningMessageP1 = Your Script Time of [*]ms CPU time per frame exceeds [*]ms, which is slowing down the sim for everyone in it no matter who’s land they or you are on. Please detach some of that fine sweet lag you’re running
warningMessageP2 = around with so the rest of us can enjoy SL as much as you do.

# Avatars in parcels in this region owned by the owner of the parcel this is rezzed in.
# parcel: All avatars on this parcel.
# parcelowner: All avatars on parcels owned by the same owner/group as the land this monitor is on.
# region: All avatars in the region.
scanDistance = region

# Should the monitor report lag info privately or publicly?
# vocal: the monitor will say into local chat who is laggy – limited in distance to those near the monitor. – 20m range
# quiet: the monitor will only message laggy individuals, and not mention them publicly. mum’s the word.
# loud: the monitor will use shout to send a message about who is laggy. – 100m range
gossip = quiet

# The list of people you don’t want actions taken against. They will still get warnings when they’re laggy, but they won’t get zapped.
# Names must be full usernames, like: Pussycat Catnap or Reggae Resident. Just using Reggae would not protect that avatar.
# So again, avatars with ONLY a firstname username, like Reggae, need to have the ‘Resident’ part added in here.
avatarOnPrivelegedList = Pussycat Catnap, Reggae Resident

# The channel the monitor uses to talk to the ‘ScriptMonitorZapper’
# If you change this it will break the zapper unless you also make the value the same in the zapper’s script.
# You have to edit the zapper’s script – it does not have a notecard.
controlBoxChannel = -4902257

So right now… this meter is just on my land. I’m testing it out… I do plan to release it soon. When I do so… I am debating things like… what to charge for it… and what permissions to set.

I’ve been annoyed that none of the other meters I could find had readable scripts. I had to hack my way through LSL and the LSL wiki to figure out making this thing.

I was motivated to make it because every meter out there has half the features I want combined with a set of feature that annoy the heck out of me…

Like… spamming everyone sim wide the moment you teleport in reporting your lag…

– Well guess what? When avatars first land on a sim the sim spends a lot of resources loading them in, including all their active scripts, all the textures on them, all the mesh and prims, and an assortment of things… So when people first land on a sim they’re metrics spike up kinda high, then quickly go down to their actual usage…

  1. So that there was my first incentive… to make a meter that could track everyone on a sim, even outside of my own parcel, report people using excessive scripts to the meter, message them asking them to ‘turn down the music dude, it’s after 11pm and you’re blaring that Katey Perry like crazy all over the whole block’… and well… not do so until after they’ve been around long enough for the all the sim-loading-dogs to stop barking unless there is an actual reason to bark…
  2. The second thing that annoyed me about all of the competition was the extremely prim and texture heavy manner they used to display text… I used a full-perms solution I grabbed off of Marketplace:
    https://marketplace.secondlife.com/p/LLSLEDLCDSprite-Mesh-Text-Display-For-Developer-Use-Only/7245285- This means my entire monitor uses 3 textures:the backboard texture (512×512)
    A single texture for all of the text (1024×1024)
    The SL Library transparent textureand one more fourth texture, my logo, sits on the ‘ActionHandler’ box – the box that actually ejects, teleports, or bans people if you have configured for those options.If you display text on a board in Second Life, I highly recommend checking out this new display technology. It’s much better than the old methods…

I’m probably going to put this out soonish, and make it mod. It’s my hope that doing so will help improve it, and help other people learn SL scripting.

Advertisements

low-memory Bento animation script WITHOUT a HUD

EDIT: Much of what I do here can also be done using the gestures system. This is for people that want these things without that system. To make this really useful I would want to add a randomizer.

I’m seeing a whole lot of bento stuff now which is great. But I am also seeing a lot of bloated HUDs that you have to wear all the time or your bento parts ‘splay’ or fail to animate or just get downright funky…

I fixed this for myself in my Bento tail. I noticed that everytime I took it off and on again, it broke – which included moments of login, complete outfit changes, and sometimes teleports or ‘those weird lag moments in SL’, or when I sat on furniture that reset animations…

BentoTailScript
So I wrote this (and will explain it below).

Just copy-paste this into a text editor or a script in SL, it’s tiny here to “fit” wordpress’ formating, but will be readable once you put it into noetpad, sublime, textEdit, or an SL script.


// channel to listen on.
// 43 was just a random number that I saw as unused but could remember easy.
integer LISTEN_CHANNEL=43;

// Put the default you want on rezzing here. Or set to "" to have the script randomize it
string currentAnim = "SwingCenterMedium";

// Leave these blank.
string lastAnimState = "";
integer choice = 0;

// Cap the script to this memory usage. Dummy value replaced by test.
// 18888 just happens to be what the test returned the first time I ever wrote
// this function for another script, and has no importance.
integer memoryLimit = 18888;

/*
 * clearAnims
 * This function is critical in memory management and to avoid 'animation conflicts / ghosts'. Without this, old anims
 * can sometimes 'pop back up' and start playing when the avatar transitions to a new state.
 * Sitting/standing, changing sim, etc. There will also be an eventual stack heap collision error if this is not run,
 * once you have 'too many' anims lingering. Note that this is written to specifically ONLY clear out anims that were
 * put onto the avatar by this script - anims residing in the same prim as this script. That is a security choice. We
 * don't want to go messing with other things a user might be trying to do. Besides I was unsure how to get a list of those anims
 * anyway, and didn't see a good reason to research it.
 *
 * I have encountered a few objects made by others in SL that do close all anims, even bento anims, though the objects
 * themselves were made before even mesh existed. Thus I couple this function with a timer that restarts our currentAnim if
 * the right conditions are met. See the timer() function below.
 */
clearAnims()
{
    integer i = 0;
    for(i=0;i<llGetInventoryNumber(INVENTORY_ANIMATION);i++)
    {
        llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION, i));
    }
    // Specific to my brand of tail, this is a deformer that fixes how short the tail I bought was.
    // Put any other needed 'deformer' here, or remove this line.
    llStartAnimation("*LENGTH M");
    testMemory(FALSE); // rerun to avoid stack heap errors.
}

/*
 * This is a function called manually by the chat listener, to 'surprise' us with a random animation choice.
 * I have considered a feature to put this on a timer, effectively making this a cycling AO.
 */
randomAnim()
{
    integer number = llGetInventoryNumber(INVENTORY_ANIMATION);
    float rand = llFrand(number);
    choice = (integer)rand;
}

/*
 * testMemory
 * There is too much memory bloat in scripts in SL.
 * The memory a script shows is allocation, not actual - but allocation is still removal of resources from a sim.
 * So we should always allocate no more than we need.
 * There is a risk that the value set for 'memoryLimit' will be too low. Test results and adjust if there is a stack heap error.
 */
testMemory(integer verbose)
{
    llScriptProfiler(PROFILE_SCRIPT_MEMORY);
    integer usedMemory = llGetUsedMemory();

    // a tiny buffer to please my sanity. Up this by a small amount if you get stack heap errors in testing.
    // Alternatively considering changing the formular to: (usedMemory * 1.2).
    memoryLimit = usedMemory + 2000;
    llSetMemoryLimit(memoryLimit);

    // The code for verbose can be removed on a release version to save memory.
    if (verbose) {
        llOwnerSay("Limited Memory " + (string)llGetMemoryLimit() +
                   "\nUsed Memory " + (string)usedMemory +
                   "\nFree Memory " + (string)llGetFreeMemory());
        llOwnerSay("AnimationController script used at most " + (string)llGetSPMaxMemory() + " bytes of memory during Test.");
    }
    llScriptProfiler(PROFILE_NONE);
}

default
{
    state_entry()
    {
        // The value here is pointless because we change it in testMemory below.
        // But not running this locks it to a maxed value.
        llSetMemoryLimit(memoryLimit);

        if (currentAnim == "")
        {
            randomAnim();
            currentAnim = llGetInventoryName(INVENTORY_ANIMATION, choice);
        }

        llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
        // We need awareness of our current 'pose': standing, sitting, flying, etc.
        // Later when the state changes is when we make sure our animation keeps running.
        lastAnimState = llGetAnimation( llGetOwner() );
        llListen(LISTEN_CHANNEL,"",llGetOwner(),"");
        testMemory(FALSE);
    }

    run_time_permissions(integer parm)
    {
        if(parm == PERMISSION_TRIGGER_ANIMATION)
        {
            clearAnims();
            llStartAnimation(currentAnim);

            // Occasional test to see if something stopped it.
            // 2 seconds was chosen so as to not tax sim resources, but be frequent enough to 'recover' before a typical
            // user is likely to become notably frustrated.
            llSetTimerEvent(2.048);
        }
    }
    timer() {
        string curAnimState = llGetAnimation( llGetOwner() );
        // It mostly likely freezes from a script in a state change shutting off all animations.
        // I have encountered a few objects in SL that do this intentionally even for animation outside of their
        // scope of control. The timer will let the user recover from this IF the user does an animState change.
        if ( currentAnim != "" && curAnimState != lastAnimState ) {
            clearAnims();
            llStartAnimation(currentAnim);
        }
        lastAnimState = curAnimState;
    }
    on_rez(integer st)
    {
        currentAnim = "";
        lastAnimState = "";
        choice = 0;
        llResetScript();
    }

    attach(key id)
    {
        clearAnims();
    }

    /*
     * listen
     * channel - the chat channel used to control the script
     * name - unused
     * id - who has sent a message on the channel
     * msg - the message sent
     *
     * I do not like HUDs that obscure my view of SL. That was the original reason for writing this script.
     * The script's purpose grew when I realized bento animations often shut off on state changes or on login,
     * but it was originally intended to just let me play with my tail without having to click my mouse
     * somewhere where I could not see what was going on because of somebody's giant art project
     * they called a 'HUD'. 🙂
     * All of this functionality can be removed if chat based control is not desired.
     * At that point, the script's value is in the timer and clearAnims functions.
     *
     * Alternatively, chat based control can be left in as an option for people like me who dislike HUDs. Please...
     */
    listen(integer channel, string name, key id, string msg)
    {
        if (msg == "list")
        {
            string response = "\n\nYou have these tail animations:\n+-----------------------------------------+\n";
            integer i = 0;
            for(i=0;i<llGetInventoryNumber(INVENTORY_ANIMATION);i++)
                response += (string)i + ": " + llGetInventoryName(INVENTORY_ANIMATION, i) + "\n";
            llOwnerSay(response + "-----------------------------------------+\n");
        }
        else if (msg == "current")
        {
            list anims = llGetAnimationList(llGetOwner());
            string response = "\n\nYou have these current animations:\n+-----------------------------------------+\n";
            integer i = 0;
            for (i=0;i<llGetListLength(anims);i++)
            {
                response += llList2String(anims, i) + "\n";
            }
            llOwnerSay(response + "-----------------------------------------+\n(This is all sources: your AO, furniture, any HUDs or attachments, etc.)\n");
        }
        else if (msg == "stop")
        {
            clearAnims();
            currentAnim = "";
        }
        // This routine is for accessing verbose memory testing - as in telling the user how much memory the script is using.
        // If for some reason you desire to conceal that information from the user, know that they can still guess it from looking at avatar script
        // info in About Land...
        else if (msg == "memory" || msg == "test")
        {
            testMemory(TRUE);
        }
        else
        {
            // Manually request a random animation. I have not placed this into a timer based AO setup in order to save memory and because I have not yet needed such.
            // However for something like hand poses of facial expressions that might make a lot more sense. Or... if I put together a more fluid set of tail animations
            // than the jumbled mess I have at present. I'm a scripter, not an animator... so my animation choices didn't give me a good AO result...
            if (msg == "random" || msg == "rnd" || msg == "rng" || msg == "r")
            {
                randomAnim();
            }
            else
            {
                choice = (integer)msg;
                integer number = llGetInventoryNumber(INVENTORY_ANIMATION) -1;
                if (choice > number)
                {
                    llOwnerSay("Choice invalid. Please use between 0 and " + (string)number);
                    return;
                }
            }
            clearAnims();
            currentAnim = llGetInventoryName(INVENTORY_ANIMATION, choice);
            llOwnerSay("Choice: " + (string)choice + " Anim: " + currentAnim);
            llStartAnimation(currentAnim);
        }
    }
}


How this works is that it finds all the animations in the same prim as itself, runs one of them by default, and using “/43” I get access to some chat commands to change them.

Most importantly though, it polls me everytime I change ‘animation state’ and makes sure my tail animation is running. Second most important… it clears out animations it has control of that might be running still…

See:
clearAnims();
repeated in the code. That’s a function that goes through that same list of animations, and stops them all. Right after I run that, I play my current animation.

Another key thing this does that all your fancy HUDs are not doing for you… is keep it’s memory under control. See:
llSetMemoryLimit(memoryLimit);
This sets the ‘memory allocation’ (what you see when you use something that checks your scripts) to be honest. The script runs a test when it starts to determine how much it should allocate, and then uses a tiny bit over that amount. This does not actually change how much it uses… It is just getting it to report honestly – that will make you look better on script checkers, and it will also let you actually know what you are using. Without this test, SL defaults to divisions of 64… As coded above… it is reporting using about 12kbs.

To get all my bento tail animations… I bought a couple of different tails (I was having a lot of trouble finding one I liked)… and when I didn’t like one, I would copy out its animations to my inventory:
BentoHandScriptsInInventory.png
And then I just edited the tail I did want, dumped them all in there, along with this script. I then picked my favorite and made it the defaul with this line:
string currentAnim = "Cheeky"; // Put the default you want on rezzing here. Or set to "" to have the script randomize it
That is the only part of this script you will have to change. If you make it blank:
string currentAnim = “”;
It will just use the first animation it finds (it looks in alphabetical order) as the default (good if you want to include a no-mod copy of this script in a product).

So to change this script for hands, all I did was change the chat channel and default animation. Then I made one copy for each hand. I put one in a right bento hand, the other in a left bento hand (SelinA mesh body, which is copy/mod perms)

Left hand:
integer LISTEN_CHANNEL=47; // channel to listen on
string currentAnim = "gunl"; // Put the default you want on rezzing here. Or set to "" to have the script randomize it
string lastAnimState = "";

Right hand:
integer LISTEN_CHANNEL=46; // channel to listen on
string currentAnim = "relaxr"; // Put the default you want on rezzing here. Or set to "" to have the script randomize it

And here you can see I just put that and the proper animations into the hand in question:

SelinAHands.png

SelinA Bento Hands – This is SelinA Tina, which is very large in the bosom. There are SelinA bodies all the way from flat chested to this size. And normal or curvy figure. All Copy/Mod.

And now I have the animations I want, without a bloated HUD that has other features I don’t always need:

PussycatDancing - 720p and wide

OK that video’s a little unrelated. But you can see my tail moving about back there. 🙂

Firestorm – Use Quick Prefs to set up Lag-Blocking of graphics heavy avatars

Lag Blocking of graphics heavy avatars is coming as a default feature in Second Life. I’ve covered this several times in the past, and it has been covered by other bloggers as well.

Once enabled, this feature will render laggy people as solid colors. The term ‘jelly’ has for some reason become popular in referring to this. The end result will be to protect you from crashes or slowdowns caused by people who are just wearing way too complex of items.

There is even a test viewer out there for seeing how this feature will eventually look and work.

All of the functionality for this is actually already in the current viewers, it just isn’t yet in your graphics preferences and Linden Lab is still trying to sort out things like ‘what to name the buttons’, ‘what messages to send to people when a lot of other people can no longer see them’ and ‘what should the default be set at’.

So in other words, a feature that will dramatically reduce lag and crashing in Second Life is being help up over what messages to put on your screen when you would be causing people around you to crash, so they have auto-hidden you from view… As for the default value… for the last several releases the number has not moved off of 80,000 – so the only important part of this actually seems resolved now…

On most viewers you can go into debug settings everytime you want to adjust this and tweak one of these values:

RenderAutoMuteFunctions
set this to “7” to enable all of this functionality. Any other value is treated as ‘off’.

RenderAutoMuteRenderWeightLimit – the value at which people vanish (invisible).
RenderAvatarComplexityLimit – the value at which people turn to a solid color. This numbers on this are not correct… So setting this to “54712” is the number to get ‘Jelly’ at Complexity 80,000.

QuickPrefsIconIn firestorm you can add these to Quick Prefs so that you can easily pull it up and turn it on or off, and tweak the values, if you don’t like what is happening. I often turn it off for a moment to see what I might be missing, and then turn it back it on so I don’t have lag issues. At other times, I play with numbers just to see where I can safely set it. The more crowded a place is, the lower I’ll set it (hiding more people), on a theory of using this to reduce my lag.

QuickPref_Starting
Click the wrench icon at the bottom right of Quick Prefs to add a new one or remove an exiting one. You can see here that my list is very different from the default setup of Firestorm. This is meant as a space for you to put the things you mess with a lot, and now you know the things I mess with a lot. And oops, my Draw Distance is super high there – kind of laggy to be above 96 – I just got back from sailing on Blake Sea where you have wide empty sims… and I forgot to lower it back down before making these.

Once you’re in the edit window, you can pull up a selector with all of the various debug settings. If you start to type in the name of the one you want, it will go to close to where your typing, so you don’t have to scroll through the entire long list of them:

QuickPref_Selector

Set each of them as I have in the screenshots below. Note that I set the the RenderAutoMuteFunctions to ‘integer’ and a value between 0 and 7. That’s important, because it only uses 0 and 7, and any other value used will be treated as garbage (it will work more or less like 0, but I’ve heard it can sometimes randomly hide things if not on 0 or 7).

QuickPref_RenderAutoMute

I guess at one point they had plans for 1-6… but no more.

QuickPref_RenderAvatarComplexityLimit

This is the value at which people go invisible. In Firestorm it matches to their Avatar Render Weight. In the coming changes this value is NOT included on graphics preferences, but is still in the debug settings.

QuickPref_RenderAutoMuteRenderWeightLimit

This is the value at which people turn to solid colors (Jelly). In the official viewer this matches their Avatar Complexity. In Firestorm it is a little higher than their Avatar Render Weight – but not a consistent amount higher. So you will have to ‘wiggle the values’ a bit until you find the right number to use. Setting this to “54712” is the number to get ‘Jelly’ at Complexity 80,000.

And that is basically it. Once you have these values set like this, you can pull up Quick Prefs at any time and turn this feature on or off – to save lag or prevent yourself from crashing, or turn it on to see that laggy friend you’re trying to not say something too because they really like that one thing that they’re wearing that is melting your graphics card… /sigh…

Pretty “soon” (sometime between now and the fall of the Klingon Empire) this stuff will be added to the official viewer, and then rolled out to Firestorm and other viewers, all nice and packaged into the graphics preferences. Even once it is, it might be handy to still have quick access to it like this. I find I am tweaking these numbers all the time…

So…

Why did I do all these shots off my belleza mesh body, mesh nipplesm mesh hair, mesh ears, mesh tail, prim eyes, and even sculpty teeth the way that I did?

Because as I’ve stated several times now… a lot of the mesh out there is actually pretty low on lag. With all this on, and even with clothes as well, I am quite often the lowest ‘Avatar Complexity’ person in a place I visit. You just have to start getting smart about what you put on – demo items for their avatar complexity before buying them.

Is this your desktop? Simple tricks to cut OSX lag

Hey Mac folks, this desktop look familiar? Does it belong to you, did you leave it on my computer?

LaggyDesktop

Seeing that this morning inspired me to dig up some old useful advice I’ve know for a while but never thought to share before.

Some simple advice on cutting lag on Mac OSX… Not Second Life lag, but system lag that specifically affects graphics performance… ie: Lag you will feel in SL that has absolutely nothing to do with SL…

This article’s advice generally comes from around the web. Much of it is something I found burried very deep in the pages of a forum thread on an MMO fan website through a random search some time back. The sort of place that could easily vanish someday.

It is the kind of advice useful for any Mac user, but specifically Mac users that use a lot of intense graphics. Like Second Life users.


Tip 1:

Have a blank desktop:

NotLaggyDesktop

You can have background pictures, I only removed mine from the first screenshot to make what I was referring to obvious. 🙂

This is an issue where OSX does a preview render of everything on your desktop. This includes things like text files. All of that is using up system resources… resources you could be using on SL.


Tip 2:

Don’t have 3,274 apps running at once. Don’t even have 3,273. Best to just have one. But if not that, just the ones you need right now.

To close an app you MUST do “Command-Q”. Hitting this button:
UselessButton

Doesn’t do anything but close that window. The application is still running and using up all its active resources.

OSX is NOT Windows… Hitting that red ‘X’ in Windows will close an application. In OSX it is the same thing as putting your head in the sand to ignore the lion gnawing on your left leg…


Tip 3:
I read advice that says avoid Firevault:
Firevault.png

Yes you will go faster if you avoid it, but consider that the first confirmed encryption ransom malware has now occurred in OSX. I think this one might be better to call for safety over speed.


Tip 4:

Keep your system up to date. This one applies equally to OSX and Windows users. And don’t think you can escape it by hiding on some other OS either… whatever you use, keep it up to date. Updates will keep your graphics card working with enhancements, and keep away known security flaws. Most hacked systems are systems people were not updating.

SystemUpdate.png

(You don’t need Xcode unless you’re developing applications for OSX and iOS – which is part of what I do.)

Now we get into the ‘wait what?’ weird stuff…


Tip 5:

Repair your disk permissions. Because they routinely get out of step with what they should be, and if you’ve ever run an analytics report side by side with looking at console logs of what is going on in your application… you know this is a big pain… everytime a “minor oh it doesn’t REALLY matter we can fix that next release, we got bigger bugs right now” permission warning pops up… that uses resources for your applications to decide they can keep working despite that flaw…

This one is on you though, not the developers who made all your shiny programs. This one is because you used stuff, and then other stuff, and then stuff got confused, or stuff crashed before stuffing its stuff back into the stuff box before stuff could happen…

So just run this stuff and get your stuff in order…

Applications -> Utilities -> Disk Utility

OSXFirstAid

Click the First Aid button

 


Tip 6:

Apple Icon -> System Preferences -> Accessibility
Reduce system UI Transparency. Those nice semi-transparent window borders in OSX… they use up a lot of graphics resources. Transparency in Second Life drives up the ‘Render Cost’ of something by a factor of 4 in their Draw Weight equation… This is done because it eats a lot of graphics resources. The same is true if you’re letting your computer’s operating system do it to all the bars on the edges of things that you’re probably not even looking at anyway. And being solid gives them more contrast to find your stuff, so its better to turn this off from a design perspective as well:
ReduceTransparency


Tip 7:

Turns off everything from Spotlight you don’t absolutely need:
Apple Icon -> System Preferences -> Spotlight
DeathToSpotLight.png
Spotlight is just going to be constantly scanning your system for things to pre-fill into all of this, and that’s slowing you down. Keep it to the minimum of what you need.

If you really want to fully kill spotlight, type this into a terminal window:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

And this will turn it back on:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist


Tip 8:

Keep a lot of unused space around in your hard drive. If you have a LOT of files of data you like to have stored for ‘stuff’… get an external drive or cloud backup and keep all of those screenshots of your avatar in the free-xxx club… off of your hard disk.

Its useful to have your data on an external not-always connected disk anyway, in case your system ever gets hacked… you just laugh at the hackers as you reformat your operating system, and then plug your data drive back in and continue (OK that is still a major hassle, but at least it is a recovery plan).

Guys: There is no need to download all of those porn videos. The stuff is free and all over the internet anyway. Don’t fill up your disk with copies of porn… Obama isn’t taking your guns, and he isn’t coming to take your porn stash away either, because its all over the web anyway… Yeah I know, you can clear up about 70% of your hard drive if you delete those files…
And it will be a lot less embarrassing in church next Sunday when Obama finally does send the FBI in to take your guns and ship you to a FEMA camp and they see what’s on your computer… 😛

Free space on the drive means more space to used for caching, and for applications to be installed without fragmentation.

Do NOT go out and get some third party “clean up your disk” application. Even if other blogs about keeping a clean system suddenly shift into marketing mode halfway through and tell you to get their app.

Guess where malware comes from?


Tip 9:

Get the application gfxcardstatus. Oh yeah… I just told you not to go out and get crazy third party apps. Now I’m telling you to go out and get some crazy third part app.

SOME OF YOU THAT IS.

This only applies to Mac users that have a Mac with a graphics card. Welcome to the reason the VR companies have said they aren’t even bothering with us Mac people… Most Macs don’t have graphics cards… but use an integrated board solution. A high end Mac is often graphically no better than a $300 PC…

It hurts to say that, as a Mac user… but it is true. For most Macs.

If you have a higher end Mac, and if you do you know about it already because you paid another $500-1000 for it and you weren’t stupid enough to pay all that without finding out why…

Well, if you do have one, you want the ability to actually tell it to use your graphics card when you load up something intense like Second Life.

Not only does OSX not tell you when it turns on your pricey GPU, it often only makse the decision to do so when its good for Apple’s marketing… So the shiny Apple apps that will run better with it will use it, many other apps won’t, and if you go into bootcamp and run Windows they will turn it on all the time so as to heat up your system and overtax things so that Windows seems to not perform as well…

I don’t have the solution for keeping it off when not needing it bootcamp side. I need to read up on that still.

But OSX side, you want “gfxcardstatus” so you can turn have it get turned on by default anytime you flip on an application that has 3D graphics, and flipped off otherwise:

https://gfx.io

You really want this one. Google it and read about it to be sure on the security issues.


Tip 10:

Disable uneeded notifications.
Apple Icon -> System Preferences -> Notifications
Notifications
If you don’t NEED it, disable it. This is just slowing you down for spam most of the time.


Tip 11:

Apple Icon -> System Preferences -> Dock
Change the dock from Genie to Scale.
ScaleEffect.png
That Genie effect may look cool, but that coolness is at a cost of advanced rendering to warp a window and slide it around.


Tip 12:

Cut out startup applications:

Apple Icon -> System Preferences -> Users & Groups -> Login Items
LoginItems.png
If you don’t need it or recognize it, uncheck it or remove it.

Also check your Library:

LibraryLaunchAgents.png

You need to look at both LaunchAgents and LaunchDaemons.

Where I put “/Library” up there, also look in these two:

“~/Library”
“/System/Library”

“~/” is a shorthand for: “/Users/[your computer account name]”

In the LaunchAgents and LaunchDaemons you want to delete anything that is not from apple or a source your recognize. Malware commonly gets into Macs by placing itself here.

If you find something on the list that looks like it might be important but you’re not sure – google it and look for a link that is on a support.apple.com website for info. Be wary of links about malware found elsewhere – I’ve had co-workers get malware by searching on how to clean out malware…

PS: If you are unlucky enough to get malware on your system, NEVER download an app to ‘easily clean out that malware’. Always follow the absurdly long overly complex manual instructions to clean it out by hand. They may be annoying and worded badly… but if you have to sit there and type in manual commands and find files the hard way, you can at least do so making sure you’re not adding in more malware…


Tip 13:

This one is highly technical.

PRAM / NVRAM Reset :
https://support.apple.com/en-us/HT204063
Shutdown your Mac:
Apple Icon -> Shutdown
NOT Restart or Sleep, but Shutdown.

Start your computer again & hold Alt+Cmd+P+R before the bootup noise.
This will reset your PRAM.
PRAM used to need regular resetting. These days it shouldn’t ever need it, but if your system has gotten a bit corrupted it will help.

SMC Reset:
https://support.apple.com/en-us/HT201295
Shutdown your Mac again:
Apple Icon -> Shutdown
NOT Restart or Sleep, but Shutdown.

From here it depends on how your battery is connected, if you have one.

Desktop or MacBook With Removable Battery
Shut down the computer.
Unplug the power adapter.
Remove the battery (if there is one – a desktop typically just needs to be unplugged).
Press and hold the power button for five seconds.
Replace the battery.
Plug in the power adapter.
Turn on the computer.

MacBook Without A Removable Battery
Shut down the computer.
Plug in the power adapter.
On the built-in keyboard, press the Shift, Control, and Option keys on the left side and the power button, all at the same time.
Release all three keys at the same time.
Turn on the computer.

A little side note for people in bad weather: Your computer can’t get friend in a power surge if its unplugged. If the power goes out, unplug all the expensive stuff in the house…

 

New Graphics Preferences Now Help Auto-hide Laggy People

Hiding those laggy people by default will soon be common in Second Life, thanks to the new Second Life QuickGraphics Viewer version 4.0.2.310127 release that came today:

This is one of the beta test viewers, not the default. But this feature will hit the default soon.

Look for “Maximum Complexity”.
NewGraphicsSettings
This is a stand in for Avatar Draw Weight – which was the replacement to ARC. Draw Weight uses math based on how taxing to render and how taxing on SL something is.

My iMac wants this to be set to 60,000. In your average SL club, the other people range from 150000 to 450000…

My top end 2013 Macbook Pro with an advanced graphics card also wants to use 60,000. So it looks like a lot of people in Second Life are going to start vanishing from people’s screens pretty soon, if 60,000 is always the default. By contrast I’ve heard the usual recommendation to be 120,000 to 150,000 for a person with ‘normal graphics’ on a mid-range recent computer.

Every time you change something worn, a little popup will let you know your new Avatar Rendering Complexity:

VisualComplexity
Clicking that will bring up a page explaining what Avatar Rendering Complexity is all about (you must be logged in to Second Life in your web browser or that link comes back with an Authentication Failure). Note that I am getting only 22,193 there, that is with booN mesh dreadlocks, the Belleza Freya Mesh body, and a few items as well. You can get these numbers to be low lag if you are militant about managing your own lag.

If you want to be sure you don’t end up being one of the folks that everybody else cannot see, read my post on How to NOT buy bad stuff in SL.

In the debug settings, this slider is found under renderavatarmaxComplexity if you want to enter a manual figure (the slider is really wild, and its hard to get a round number – which will drive semi-OCD people nuts… so that debug setting is how you make it an ‘even’ number.

This ties in with RenderAvatarMaxNonImpostors which is the number of avatars you will render regardless of how complex they are. Default on this seems to be from 8 to 12.

There is also a new display over you head when you flip on:

Advanced -> Performance Tools -> Show avatar complexity Information

(That is how they case it… S and I in cap… I don’t know why…)

AvatarComplexityHUD
The wiki page says:

This displays four values as floating text above each avatar:

  • Complexity – The numerical complexity score of the avatar.
  • Rank –  How close the avatar is to your camera. The closest is “1”, next closest is “2”, etc…
  • Attachment surface area, in square meters – This value can, uncommonly, cause an avatar to be shown as a solid-color impostor.
  • Attachment size, in kilobytes – This value can also cause an avatar to be shown as a solid-color impostor, if it is high enough.

Please remember again that to view this webpage from outside of Second Life you need to log into Second Life’s website.

Here is what happens in a crowd of people when some of them are too laggy:

AvatarComplexityHUD_CrowdZapping

And another InfoHub:

AvatarComplexityHUD_CrowdZapping2.png

Yes that dude to the right is over 158,000,000 complexity. Even hidden like this I crashed a half dozen times trying to get this image…

The advice from that experience is: Keep people who have become blobs at range. Don’t stand too close… or your system won’t be able to handle it…

While I was on the other side of the infoHub I was just fine. My crashes happened when I tried to get close to the skirt there… her avatar was also insanely complex…
– I managed to render her a few times when coming back from crashes. Which also tells me that it takes SL a moment to flip this stuff on…

Oh and she’s listed as rank 8… higher rank means further away from camera, not from YOU. Which is funny because I should have been rank 9 in this if she was rank 8… so I guess it needs some tweaking still.

Side note on proportions: If you have a kinky avatar and your arms are too short to even touch yourself… how can you not see the problem in this? 🙂

 

%d bloggers like this: