llGround FAILS IN MEGA REGIONS!!!! DISASTER!!!

Creating scripts
Post Reply
User avatar
Kayaker Magic
Posts: 354
Joined: Sun Dec 01, 2013 8:40 am
Has thanked: 52 times
Been thanked: 393 times

llGround FAILS IN MEGA REGIONS!!!! DISASTER!!!

Post by Kayaker Magic »

If you call llGround (and llGroundNormal and llGroundSlope and llGroundContour) inside the SW 256z256m sub-region of a mega region, it returns the expected value.
But if you call if outside the first 256x256 it RETURNS THE WRONG VALUE. It appears to return the ground level from the NW corner of the SW sub-region, but I have a lot of flat water in my SW sub-region, so I can't be sure which wrong value it is returning.

Now I wish I had not used CAPITAL LETTERS to report llEdgeOfWorld not working, because that is an annoyance. But llGround not working in mega regions is A DISASTER FOR MY SCRIPTS!
I use llGround to tell when sailboats run aground, when kayaks leave the confines of a river, where to grow trees, where to place brush particles. I have to tell my Kitely customers, SORRY NOTHING WORKS IN MEGAS for now.

Here is a script to demonstrate the problem, although you have to test it on a mega that has different terrain in each sub-region. Put this script in a prim. Drag the prim around your SW sub-region, it reports the ground and slope correctly. Move it into any other sub-region, it stops working correctly. For example place the prim centered on the ground, the llGround values should be about the same as the position Z value, but it will not match (if your terrain is at all interesting).

Code: Select all

default     //demonstrate llGround failing in mega regions
{
    state_entry()
    {
        llSetTimerEvent(1);
    }
    timer()
    {
        vector pos=llGetPos();
        llSetText("pos="+(string)pos
                    +"\nground="+(string)llGround(ZERO_VECTOR)+
                    "\nnormal="+(string)llGroundNormal(ZERO_VECTOR)
        ,<0,1,0>,1.0);
    }
}
I tried working around the problem by putting large vectors in the offset argument to llGround, (calculated to reach the extended sub-regions) but this failed to help.
User avatar
Ilan Tochner
Posts: 6533
Joined: Sun Dec 23, 2012 8:44 am
Has thanked: 4996 times
Been thanked: 4473 times
Contact:

Re: llGround FAILS IN MEGA REGIONS!!!! DISASTER!!!

Post by Ilan Tochner »

Hi Kayaker,

We'll look into this after tomorrow's release.
These users thanked the author Ilan Tochner for the post:
Dundridge Dreadlow
User avatar
Dundridge Dreadlow
Posts: 616
Joined: Mon May 06, 2013 2:23 pm
Location: England
Has thanked: 590 times
Been thanked: 339 times

Re: llGround FAILS IN MEGA REGIONS!!!! DISASTER!!!

Post by Dundridge Dreadlow »

I know this doesn't help much, but it works if you switch off megaregions
ImageImageImageImageImageImage
PS. Kitely is awesome.
User avatar
Dundridge Dreadlow
Posts: 616
Joined: Mon May 06, 2013 2:23 pm
Location: England
Has thanked: 590 times
Been thanked: 339 times

Re: llGround FAILS IN MEGA REGIONS!!!! DISASTER!!!

Post by Dundridge Dreadlow »

You could always switch off megas, scan and record the region, switch them back on an slerp the data :)
ImageImageImageImageImageImage
PS. Kitely is awesome.
User avatar
Kayaker Magic
Posts: 354
Joined: Sun Dec 01, 2013 8:40 am
Has thanked: 52 times
Been thanked: 393 times

Re: llGround FAILS IN MEGA REGIONS!!!! DISASTER!!!

Post by Kayaker Magic »

Ilan Tochner wrote:We'll look into this after tomorrow's release.
Thanks! I know you guys are inheriting all these problems from the Open Sim code and it's not your fault.
Hanging out here in Kitely I have come to appreciate the value of mega regions, and if you can fix some of these little problems with them, that would be TERRIFFIC for the rest of the Open Sim community. I think you are doing good things here! Keep up the great work work!
These users thanked the author Kayaker Magic for the post (total 2):
Constance PeregrineGraham Mills
User avatar
Ilan Tochner
Posts: 6533
Joined: Sun Dec 23, 2012 8:44 am
Has thanked: 4996 times
Been thanked: 4473 times
Contact:

Re: llGround FAILS IN MEGA REGIONS!!!! DISASTER!!!

Post by Ilan Tochner »

Thank you Kayaker,

It is important to remember that our Advanced Megaregions already work a lot better than normal OpenSim megaregions (it's one of our differentiators) so while those problems will likely be resolved in Kitely in the near future, the same can't be said for people using them in other grids and standalones.

This should be taken into consideration in the scripts your write. It may be prudent for you to state that they only work in megaregion mode when you run them in Kitely.
These users thanked the author Ilan Tochner for the post:
Dundridge Dreadlow
User avatar
Kayaker Magic
Posts: 354
Joined: Sun Dec 01, 2013 8:40 am
Has thanked: 52 times
Been thanked: 393 times

Re: llGround FAILS IN MEGA REGIONS!!!! DISASTER!!!

Post by Kayaker Magic »

I did a search on the OpenSim Mantis and found that this is a known issue, and there are patches for it. (Jason doesn't like the approach used, and that may be why it has not become a permanent fix). Look at Mantis #6596 from last April(!!)
User avatar
Oren Hurvitz
Posts: 361
Joined: Sun Dec 23, 2012 8:42 am
Has thanked: 19 times
Been thanked: 499 times
Contact:

Re: llGround FAILS IN MEGA REGIONS!!!! DISASTER!!!

Post by Oren Hurvitz »

We've fixed many scripting functions to work in Advanced Megaregions. See http://www.kitely.com/virtual-world-new ... g-physics/.
These users thanked the author Oren Hurvitz for the post (total 3):
Constance PeregrineKeith SelmesJack Spade
Post Reply