Jump to content

Unphantom Script


Luna Bliss
 Share

You are about to reply to a thread that has been inactive for 2191 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I know I've heard scripts cause less lag in recent years but I am still a bit paranoid about it.

I have this Unphantom Script I put into some linked sets that rezz from my skybox rezzer, and after X amount of time it changes the phantom prims to non-phantom. By leaving this script inside the root of the linked set would it cause any lag whatsoever, or is it totally inactive once activated via the rezzing?

Link to comment
Share on other sites

All scripts have some impact and you can examine the script with script info, this tells you how much memory and ms of CPU time consumed. If it is below 0.001 ms and only uses minimal memory ( for example 64 Kb ) the impact is minimal IMHO.

Now if the phantom change is only once after the skybox is rezzed, you could remove the script with a call to llRemoveInventory(llGetScriptName());

More advanced is to change states of scripts within a multi-linked object, idea is to turn them off/on on request or remote load scripts needed, this thought would still leave one script handling the on/off request.

  • Thanks 1
Link to comment
Share on other sites

As far as I understand it, when a script is simply sitting there doing nothing and with no listeners open or anything, then any demands it does make on the simulator just by being there are so minimal that you're never going to notice it.   If things have reached a point where the presence of a few inactive scripts makes a significant difference to the region's performance, then you've got far bigger things to worry about than the scripts, to my mind.

As Rachel says, though, if all the script does is unphantom the object, then it makes sense to have it delete itself after it's done that.   

Alternatively, if there are any other scripts in the object (which it sounds as if there are) you should be able to add the unphantoming to one of them -- it's only a few lines of code, after all, and doesn't really need a separate script.

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

Thanks Innula & Rachel...
There are so many complexities with this skybox script, and I suspect it could be improved -- I may be hiring someone to revamp it to head into the 2020's.
The skybox contents are just not rezzing as easily as they did in the past. Whether that's due to more mesh being used, or the skyboxes using more prims in general, or due to a change in LL code overall I'm not sure.
I thought perhaps setting some linked sets to phantom might help, as when they rez they collide with an avatar sitting on a flower, but by adding the unphantom script with a timer perhaps I made the problem worse as all these timers are activated during rezzing!

Link to comment
Share on other sites

Is your script mod? You can set it to "Not running" then, it should contribute nothing to script simulator script time in that case. (always check with a copy first) but I still do not see why it starts as phantom... maybe some "planes should be able to leave the area before skybox materializes" idea or such ...

Edited by Fionalein
  • Thanks 1
Link to comment
Share on other sites

I suppose warning you about the possible drawbacks of using lots of timers would have overcomplicated things, but someone perhaps should have warned you about that. Using any function (even for what it's for) without knowing about all of the potential future drawbacks is just asking for trouble later. I can't tell you how many times I've had to fix code where the problem was lots of timers, and could probably have been avoided entirely by embracing better coding practices.

And before anyone even thinks I'm making that last part up, I had a script I got from our very own past masters of LSL scripting that actually had to be fixed because it was using workarounds to make the same effect as multiple timers. Not saying it would be the right thing to use in your case, but in my script, all the errors were fixed by adding a, get this, properly-timed llSleep().

I wish you luck sorting your issue with the timers. I know how bad it can be, because I've had to deal with it myself. My best advice is to read the wiki, and don't just do what people on the forum recommend as best, either. Learn it for yourself.

Edited by PheebyKatz
  • Thanks 1
Link to comment
Share on other sites

3 hours ago, Luna Bliss said:

by adding the unphantom script with a timer perhaps I made the problem worse as all these timers are activated during rezzing!

I can't see why it would cause a problem, and from what you say it's by no means clear that the rezzing problem has anything to do with scripts at all.   It sounds as if you've changed the contents of the skybox over time, and now they include complex mesh objects, which the simulator may find difficult to rez.   It could be so many things.

You don't, I think, need a separate timer (or llSleep) to handle this, though, assuming you can modify the code.    Just find the lines in the script that move the component part into position, and add llSetLinkPrimtiveParams(LINK_SET,[PRIM_PHANTOM, FALSE]); after the llSetRegionPos or whatever it is that gets the item to its intended destination.     Once it's there and stopped moving it doesn't need to be phantom any more.   No need to use a timer or anything else.

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

On ‎6‎/‎23‎/‎2018 at 1:15 PM, Innula Zenovka said:

 It sounds as if you've changed the contents of the skybox over time, and now they include complex mesh objects, which the simulator may find difficult to rez.   It could be so many things.

You're probably right Innula, it's some bad mesh (or maybe even complex optimized mesh), inefficient sculpts, or using more prims in general recently that's causing this as oppposed to some sort of scripting change. I started to think it might be a scripting issue when LL changed the way big prims rez into people (they won't rez unless one owns the prims, and people rezzing my skybox demos don't own the prims and so part of the skyboxes would not rez). Plus, scripts were not resetting when an objects position changed (this is always the case in Iworldz, and it started happening here for some people at some times).
I remember though, some years ago when suddenly certain sculpts would not rez correctly after an update, and all the garden stores looked pretty wacky with distorted plants that used sculpts. And so I wonder if LL has changed the way sculpts rez -- making certain ones more difficult to rez.

Link to comment
Share on other sites

On 23 June 2018 at 3:41 PM, Luna Bliss said:

but by adding the unphantom script with a timer perhaps I made the problem worse as all these timers are activated during rezzing!

Setting the objects phantom, then adding a script to un-phantom them after a time is utterly pointless. The biggest performance hit from scripts like that is DURING rezzing as the script starts up, so yeah adding a pointless script to correct a pointless decision will cause delays in things initially.

Why are you rezzing stuff then derezzing it and rerezzing it anyway, every time you rez a bunch of stuff, then derez it, and re rez it later, that slowly affects the sim, it's why builders often do sim resets after finishing a major build deploy.



 

  • Thanks 1
Link to comment
Share on other sites

57 minutes ago, Klytyna said:

Why are you rezzing stuff then derezzing it and rerezzing it anyway

My skybox demo system flies people to the sky while sitting on a flower, rezzes skyboxes that are entire full-sim builds, and then causes all the prims to poof when the customer rides the flower back down.
In the past I kept these full-sim skyboxes fairly simple without much height in the terrain (often around 800 or 1000 LI), but now I'm adding more terrain and some higher LI mesh plants so the LI count is like 2000 or 2500.
There is a limit as to how much we can put in a box (the box being my rezzer that emits from the transport flower and rezzes the entire sim), so I need to link the prims in sets that are a large as possible so that I have less linked sets -- running up against the limit now.
Due to griefing LL made a change so that large masses of prims that exceed 64m (not just big prims, to my surprise) won't rez if they intersect an avatar who does not own those prims -- that would be the avatar sitting on that flower in my skybox demo area trying to rez the skybox.
I got this mistaken notion (I think) that it's only the non-phantom big prims causing the problem, and that making prims phantom might also make them rez easier. So I thought making them rez phantom and then change to non-phantom after X amount of time might allow me to still use huge linked sets, and also make the rezzing easier as I've noticed things just don't rez as easy as they used to.
I need to get an alt and test griefing them with big prims I guess, and I think optimizing my mesh & sculpts could help.
But yeah it makes sense what you're saying about setting off a bunch of scripts as something rezzes....I could be making the problem worse -- rather than doing that it could be that I just need to stop making the sims so complex if I want them to rez easily.
(I do have a different sim recorder for full sims on the ground that sends out 5 prims that then rezzes everything from the 5 prims, and so I can put a lot of linked sets in this system, but it's not part of my skybox system scripts that do other complex things and that I need for demos. An not sure I want to pay for a huge overhaul to my skybox system scripts so they'd rez the 5 prims that then rez everything).

Link to comment
Share on other sites

If it's just to look at, rezzing as phantom can be an advantage. The data structures used by the physics engine don't have to be built. Building a whole sim worth of collision data all at once has to cause some delay. Do you need to make them tangible at all, or can they stay phantoms?

  • Thanks 1
Link to comment
Share on other sites

Don't forget that the RULES will be changing for land impact and that might have a big effect on your builds. So likely best to wait and see what the new land impact charges are going to be before making any major changes. 

Also I thought it was interesting than in the Meet the Lindens Patch said that they were thinking of increasing prims per land (mightily) as they felt the servers could handle it just fine.  The increase could possibly go along with the new land impact rules. He didn't say anything that hinted at that, just thought the two COULD be connected. So new rules but more "prims" kinda deal so that all the old stuff doesn't fly back to the Lost and Found as many did when the new mesh land impact rules came into being. 

 

  • Thanks 1
Link to comment
Share on other sites

32 minutes ago, Luna Bliss said:

Unfortunately the ground needs to be non-phantom so customers can walk around and check out the build.

The ground has to rez again when a new build is rezzed? Or maybe the "ground" here is a mesh shape, not just a plane on which the builds rez. Anyway, it may help to better understand what's meant by "things just don't rez as easy as they used to" and decide if physics or scripting or whatever else is the actual problem here.

In the meantime, if it were me, I'd make sure everything that possibly can be is set PRIM_PHYSICS_SHAPE_NONE even if it also rezzes as phantom. I'd probably start setting everything that way in the build tool and then come back and give a physics shape to only those parts that avatars really need to bump into. Even if it doesn't actually help with the current rezzing problem, it's just good practice to minimize the volumes of which Havok is aware.

In passing, it is true that sims can be stressed by the sheer number of scripts that are spawned simultaneously when rezzing a bunch of objects, but from the description here it seems unlikely there are all that many involved. Also, even scripts set not-running still affect the total memory the sim must reserve for scripts, but again I just don't see this being a problem here unless I'm misunderstanding the scope.

  • Thanks 1
Link to comment
Share on other sites

12 hours ago, animats said:

If it's just to look at, rezzing as phantom can be an advantage. The data structures used by the physics engine don't have to be built. Building a whole sim worth of collision data all at once has to cause some delay. Do you need to make them tangible at all, or can they stay phantoms?

The collision shapes are inseparable from the objects, so the "data structures" will be created regardless of whether the objects are phantom or actively using a physics shape or not. 

  • Thanks 1
Link to comment
Share on other sites

11 hours ago, Wulfie Reanimator said:

The collision shapes are inseparable from the objects, so the "data structures" will be created regardless of whether the objects are phantom or actively using a physics shape or not. 

But for phantoms, do the collision shapes get fed into Havok?

Adding a new object to a physics engine is a reasonably expensive operation. More expensive than moving it. Not sure how efficiently Havok handles inserts.

Link to comment
Share on other sites

23 hours ago, Qie Niangao said:

The ground has to rez again when a new build is rezzed? Or maybe the "ground" here is a mesh shape, not just a plane on which the builds rez. Anyway, it may help to better understand what's meant by "things just don't rez as easy as they used to" and decide if physics or scripting or whatever else is the actual problem here.

In the meantime, if it were me, I'd make sure everything that possibly can be is set PRIM_PHYSICS_SHAPE_NONE even if it also rezzes as phantom. I'd probably start setting everything that way in the build tool and then come back and give a physics shape to only those parts that avatars really need to bump into. Even if it doesn't actually help with the current rezzing problem, it's just good practice to minimize the volumes of which Havok is aware.

In passing, it is true that sims can be stressed by the sheer number of scripts that are spawned simultaneously when rezzing a bunch of objects, but from the description here it seems unlikely there are all that many involved. Also, even scripts set not-running still affect the total memory the sim must reserve for scripts, but again I just don't see this being a problem here unless I'm misunderstanding the scope.

Thanks for the info :)

Yes Chic mentioned this physics shapes to none earlier but most of my stuff needs to be walked or bumped into, but this reminded me I could at least set all the plants to this.

By "things not rezzing as they used to" I mean they're taking longer than in the past, and a couple times even just walking around it took awhile before a sculpty popped into view, and that wasn't happening before.  Could be it's my viewer or internet connection in the latter case, but I'm more and more thinking it's the increased mesh I'm using that causes the ground (high mountains, waterfalls, ponds, walkways) to take longer to rez in my skybox demo area.  Seems to be okay once a customer owns the sim (in terms of lag).

And yeah, I just took out all the unphantom scripts from a new sim I'm packaging up...like 50 or so...and that can't be good when they're all going off as the sim rezzes.

Link to comment
Share on other sites

On 6/25/2018 at 1:09 PM, Chic Aeon said:

Don't forget that the RULES will be changing for land impact and that might have a big effect on your builds. So likely best to wait and see what the new land impact charges are going to be before making any major changes. 

Also I thought it was interesting than in the Meet the Lindens Patch said that they were thinking of increasing prims per land (mightily) as they felt the servers could handle it just fine.  The increase could possibly go along with the new land impact rules. He didn't say anything that hinted at that, just thought the two COULD be connected. So new rules but more "prims" kinda deal so that all the old stuff doesn't fly back to the Lost and Found as many did when the new mesh land impact rules came into being. 

I am shuddering to think about what this could do to all my assembled gardens/full-sim builds.

Do you think it might cause mesh and sculpts with a higher triangle count to increase in LI? Or would it change hi res sculpts? Fortunately it looks like I don't have too many bad sculpts in previous builds -- I'm just being very careful in 2 new sims I'm packaging up now that have more mesh than I've traditionally used.

Link to comment
Share on other sites

25 minutes ago, Luna Bliss said:

Do you think it might cause mesh and sculpts with a higher triangle count to increase in LI? Or would it change hi res sculpts? Fortunately it looks like I don't have too many bad sculpts in previous builds -- I'm just being very careful in 2 new sims I'm packaging up now that have more mesh than I've traditionally used.

I have no idea what the outcome will be but the idea as I understand it is to make the land impact number closer to the REAL number it should be if we look at the work the server has to do. Those of us already making efficient mesh are hoping that the HUGE hit that items take for the lowest LOD setting will be more reasonable. Actually Inworldz made their uploader something like that. There were very few one land impact objects. (So the same item uploaded in SL and IW would be 1 and 2 land impact for example if it was a small item. Large builds like houses were a better deal in IW than in SL. 

So hopefully the "laggy mesh and sculpts" on the grid will finally get penalized and hopefully folks will replace them. 

That's pretty much all I know. 

It would probably be a good idea for you to acquaint yourself with the new Firestorm settings in the build menu so that you can tell (most of the time) which mesh has been made well and which is not. Sure you have seen those threads here. 

Link to comment
Share on other sites

54 minutes ago, animats said:

But for phantoms, do the collision shapes get fed into Havok?

Adding a new object to a physics engine is a reasonably expensive operation. More expensive than moving it. Not sure how efficiently Havok handles inserts.

I don't know about the intricacies of Havok, we'd have to ask a Linden about that.

Link to comment
Share on other sites

14 hours ago, animats said:

But for phantoms, do the collision shapes get fed into Havok?

I think we know the answer is yes, because I'm pretty sure we've been told that Havok is used to detect parcel encroachment (which includes phantom objects) and for raycasting (which can optionally detect phantom objects).

  • Like 1
Link to comment
Share on other sites

16 hours ago, Chic Aeon said:

It would probably be a good idea for you to acquaint yourself with the new Firestorm settings in the build menu so that you can tell (most of the time) which mesh has been made well and which is not. Sure you have seen those threads here. 

Thanks, yes I love the new Firestorm settings. Thanks Whirly!

However, if I come across some mesh that is sooo beautiful but poorly made, and I don't have the time or talent to make it , I will just HAVE to use it on the project.

Beauty before FPS!!!

Link to comment
Share on other sites

3 hours ago, Luna Bliss said:

Thanks, yes I love the new Firestorm settings. Thanks Whirly!

However, if I come across some mesh that is sooo beautiful but poorly made, and I don't have the time or talent to make it , I will just HAVE to use it on the project.

Beauty before FPS!!!

I can live with the heavy textures in moderation but poor LODs pretty much get tossed or are put away for close up photo shoots. There are plenty of folks that are happily living in their LOD4 world and don't care what their visitors see.  So if YOU are running at LOD4 I suggest (as a seller) that you at least test at LOD2 or below so you can see what a large number of folks see. 

Switching that one thing pretty much changed my world.

Link to comment
Share on other sites

3 hours ago, Chic Aeon said:

I can live with the heavy textures in moderation but poor LODs pretty much get tossed or are put away for close up photo shoots. There are plenty of folks that are happily living in their LOD4 world and don't care what their visitors see.  So if YOU are running at LOD4 I suggest (as a seller) that you at least test at LOD2 or below so you can see what a large number of folks see. 

Switching that one thing pretty much changed my world

Yeah...I run at LOD2 since most do. In the past I suggested going up to LOD4 to fix the problem until I discovered that can be laggy. Some of my old sales boxes still recommend that, but not sure when/if I'll get around to updating.

I bought a lovely Medieval house to use for a full-sim job, placed it up on a hill hoping it would be a great distance view...old home up on the side of a mountain surrounded by pines. But the thing pops out of view when far away! :(    Next time I'll cam out before purchase.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2191 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...