|
Jeremiah Sansome
Registered User
Join date: 4 Apr 2006
Posts: 2
|
05-07-2006 10:53
Hi. I've got an object that has over two hundred primitives linked to it, each containing a script. The root primitive can be triggered to send a link message to all the children, causing each one to run the following code: llSetAlpha(0.0, ALL_SIDES); llSetScale(<.01, .01, .01>  ; llSetPos(<0, 0, 0>  ; llSetLocalRot(llEuler2Rot(<0, 0, 0>  ); llSetTimerEvent(0); Basically the child primitives all just collapse into the root primitive. Here's the problem: When I try this while the object is attached to my avatar, it works nicely. But when I try it while the object is out in the world, I cause severe lag. Why would this be the case, and is there a way to fix it? I'm guessing it has to do with physics, but my object is phantom and non-physical, so that does seem strange. But I don't know why else this code would run quickly in an attachment, and slowly otherwise.
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
05-08-2006 14:14
reguardless of it being attached or not, it will cause lag. But if it is attached to the HUD then it will cause less lag, as the sim only sends updates to the owner; but when it's on the ground it has to send updates to every user (in visual range).
You may be running into the script scheduler. Updating 200 prims all at the same time isn't good for the sim.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
|
Jeremiah Sansome
Registered User
Join date: 4 Apr 2006
Posts: 2
|
05-13-2006 10:48
"But if it is attached to the HUD then it will cause less lag, as the sim only sends updates to the owner; but when it's on the ground it has to send updates to every user (in visual range)."
That makes sense, but I'm not attaching it to the HUD--I'm attaching it to my avatar, and that definitely decreases the lag tremendously. I assume that other people can see what my primitives are doing when they're attached to my avatar, so their clients are presumably getting updates. My intuition still tells me that this has to do with physics, but I have no easy way of confirming that.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
05-13-2006 11:06
Well, I'm tempted to guess that SL is optimised to deal with attachments (which are all effectively nonphys phantoms) more than nonphys phantom objects, since there are generally more attachments around than nonphys phantoms. I really am guessing here though. On the subject of the script, though, I can't see why you would want to make everything invisible and then move it... who can tell? Also, have you tried using llSetLinkAlpha?
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
Overlaping Prims Cause Severe Lag?
05-13-2006 14:11
From: Jeremiah Sansome Hi. I've got an object that has over two hundred primitives linked to it, each containing a script. The root primitive can be triggered to send a link message to all the children, causing each one to run the following code: llSetAlpha(0.0, ALL_SIDES); llSetScale(<.01, .01, .01>  ; llSetPos(<0, 0, 0>  ; llSetLocalRot(llEuler2Rot(<0, 0, 0>  ); llSetTimerEvent(0); Basically the child primitives all just collapse into the root primitive. Here's the problem: When I try this while the object is attached to my avatar, it works nicely. But when I try it while the object is out in the world, I cause severe lag. Why would this be the case, and is there a way to fix it? I'm guessing it has to do with physics, but my object is phantom and non-physical, so that does seem strange. But I don't know why else this code would run quickly in an attachment, and slowly otherwise. I forget exactly where, one of the tech forums, but I recall reading that intersecting prims increase lag [especially physical, I think, but also including non-physical, like yours are], especially at [de-]rez time. Might this be part of your problem? If so, them moving overlaping prims might also hurt performance. I must admit, however, that the problem just vanishing when you do this while wearing it sounds weird. Torley? Can you send us an expert? Toodle-oo!
|