Reducing lag on prims talking to each other
|
|
Klaire Larnia
Learner, be gentle....
Join date: 2 Jun 2008
Posts: 41
|
05-27-2009 15:41
Hiya.
I am doing something where I need to have a central control script which will call out to (upto 6 other prims). I am setting all prims to use the same channel, it will just be the command that is said to them which will determine which prims do anything.
My question is, does it make any difference if I get the controler to say "PrimOne Blue" or "1B". The former is easier to understand when I look at the script, but is longer. The latter is quicker and simpler but makes no obvious sense.
Will it make any real difference what I get the controler to say and the other prims listen to? Also I know a normal chat command has a 20m radius to be heard in, if I where to shout a command (to give the 100m radius) does that create lag in any respect?
Just some strange thoughts that occured to me while I work on my script.
Thanks Klaire
_____________________
Klaire xXx =^.^= xXx
|
|
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
|
05-27-2009 15:49
For things like "PrimOne Blue" vs "1B", I don't think you'll really save much unless you're doing LOTS of these messages or unless they can get a lot bigger than that. Even then, I don't think it will be much savings.
For the distance, if you know they're all going to be within chat range, use llSay. If you think they're going to be outside that range, llRegionSay might be a better bet than llShout because that will just sent it to anybody on that channel instead of doing the range calculations.
edit: and "create lag" is sorta misleading. On an idle sim, you're really not going to notice any difference in any of this stuff. It's more a question of some things being more expensive than others; the more more-expensive things you do, the closer the sim will get to the point where it starts lagging..
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!! - Go here: https://jira.secondlife.com/browse/SVC-3895- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Klaire Larnia
Learner, be gentle....
Join date: 2 Jun 2008
Posts: 41
|
05-27-2009 16:07
From: Sindy Tsure For things like "PrimOne Blue" vs "1B", I don't think you'll really save much unless you're doing LOTS of these messages or unless they can get a lot bigger than that. Even then, I don't think it will be much savings.
For the distance, if you know they're all going to be within chat range, use llSay. If you think they're going to be outside that range, llRegionSay might be a better bet than llShout because that will just sent it to anybody on that channel instead of doing the range calculations.
edit: and "create lag" is sorta misleading. On an idle sim, you're really not going to notice any difference in any of this stuff. It's more a question of some things being more expensive than others; the more more-expensive things you do, the closer the sim will get to the point where it starts lagging.. Thanks for the advice. Okay prehaps I mis-wrote what I meant. The sim I live on is normally okay, rare does it go above 5% lag acording to the monitor in my house. But the script I am wariting I hope to try and sell, hence I want it to contribute as little as I can to general lag. The more efficent it is the better as it could endup on the mainland which (in my experience) can be a very laggy place to be. I did not know of the regionsay command, so that is helpfull. Solves more than one problem in that respect and causes another I will address (that being 2 or more copies of the same script being used on the same sim) but I already see a way to fix this so it is not a problem. Thanks again.
_____________________
Klaire xXx =^.^= xXx
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
05-27-2009 16:13
The subject llListen has been covered again and again over time in this forum, just make a simple search for it and you will see  Here are a few of the latest: /54/e7/241442/1.html/54/aa/238108/1.html/54/25/175640/1.html/54/97/193853/1.htmlYou can use llRegionSay It covers a whole region and course less lag than both llSay and llWhisper
_____________________
From Studio Dora
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
05-27-2009 16:27
Expanding on Sindy's comments some. Write the code so you can read it, nothing else matters. As long as the objects are in the same sim, make is a practice to always use llRegionSay for inter-object communications. (Looking back at this, it seems I condensed instead of expanded  )
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
05-27-2009 17:35
One expansion on the llRegionSay thing, it's only going to help efficiency if you choose an obscure channel (that is, unique or at least very unlikely to be used by other scripts in the sim).
If for some reason you need to use a common channel, it will be better to use distance-limited chat (whisper, say) so that other objects can filter it out before their listen handlers run.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-27-2009 17:46
Another note about llRegionSay() as opposed to a distance-filtered version: if you are just going to wind up filtering out most or all of the messages from distant objects in your code anyway, it's better to let the server filter it. Even if it is an "expensive" distance computation, it is going to be less costly than entering your LSL script code just to have the message discarded and then flow of control returned to the server.
So if the distance computation IS going to help, then by all means use it. If not, it is true that llRegionSay() is going to have less impact on the sim.
|
|
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
|
05-27-2009 19:51
Yep.. Actually, if you're on some random channel that nobody else is going to be listening on, I take back what I said about using llSay for nearby objects - just use llRegion say...
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!! - Go here: https://jira.secondlife.com/browse/SVC-3895- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
05-28-2009 06:58
one thing i do for choosing channels, especially if it's a single command (which already you can filter in the llListen) look at a phone keypad, spell the word out on it, and the number sequence you use to spell it, use that as the channel, but make it negative. if it's multiple commands, i might use the speakers or the listener's name to determine the channel
but if it's a script that could be sensitive to third party speakers, (like griefers trying to guess the channel and making the script(s) go crazy) i would continue generating a random channel
|
|
Basement Desade
Registered User
Join date: 14 Jul 2006
Posts: 91
|
06-01-2009 21:43
From: Ruthven Willenov one thing i do for choosing channels, especially if it's a single command (which already you can filter in the llListen) look at a phone keypad, spell the word out on it, and the number sequence you use to spell it, use that as the channel, but make it negative. I was reading about the various chat commands, like llSay and so on, and over at wiki.secondlife it said "If one object 'says' something to another object (e.g., a button that, when touched, turns on a lamp), it is a good idea to use a very negative channel..." Why is this? I mean, okay, I can see if you use "/1 on" and things like that, your items might be triggered by someone else, if they are not set to owner only. But, is there more to it than that? Are negative channels more efficient, or something? Or is it that there is far less traffic on them?
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
06-01-2009 22:53
From: Basement Desade I was reading about the various chat commands, like llSay and so on, and over at wiki.secondlife it said "If one object 'says' something to another object (e.g., a button that, when touched, turns on a lamp), it is a good idea to use a very negative channel..."
Why is this? I mean, okay, I can see if you use "/1 on" and things like that, your items might be triggered by someone else, if they are not set to owner only. But, is there more to it than that? Are negative channels more efficient, or something? Or is it that there is far less traffic on them? Zero is the open channel, and positive channels are used for IMs and such, the wiki states that using negative numbers is recommended to avoid interference with system usages.
_____________________
My tutes http://www.youtube.com/johanlaurasia
|
|
Basement Desade
Registered User
Join date: 14 Jul 2006
Posts: 91
|
06-01-2009 23:22
From: Johan Laurasia Zero is the open channel, and positive channels are used for IMs and such, the wiki states that using negative numbers is recommended to avoid interference with system usages. Yes, but what does that actually mean? Is channel -99,993 inherently better than channel 99,993, percentage of usage aside? I can see why I might not want to choose channel 1; there must be millions of copies of items out there that use it, at least if frequency of usage is an issue. How many of those channels are used for IM's and what are the odds that I will use one? If I do, will my item IM someone inadvertently? Is this a grid-wide thing, or is it only on a per-sim basis? Why is a "very negative" channel better than, say, channel -5? I understand that most problems I might encounter, such as using an IM channel can be avoided by using a negative channel. I'm just the kind of person, however, who needs to know why something is, not only that it is.
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
06-02-2009 00:14
Chat channels aren't for IM, that is a separate thing. Positive channel numbers can be generated from the viewer. Negative channels are reserved for scripts. That's why negative channels win, they don't get in the way of the humans. "Very negative" doesn't really mean anything specific, "unlikely to be used by anything else" is the real goal. The idea is that if people make up numbers they are likely to be short, so if you make up a longer one, your chances of avoiding a collision might be better. Some people use random numbers to spread the odds around, and perhaps to make it a little harder for others to listen in on their objects. (ETA: an avatar can be made to chat on a negative channel by using a dialog button or faking it by sending a ScriptDialogReply message, but it won't get in the way of normal interactive stuff.  )
|