Precise effects of llModifyLand?
|
|
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
|
05-17-2006 18:21
Has anyone done much reverse engineering of exactly how llModifyLand behaves? So far, I've found this: starting from flat land, using the small brush, a call to raise or lower land will raise or lower the nearest land vertex to the object's centre by 0.2m. Every vertex next to that (in all 8 directions) will raise or lower by the same amount, and every vertex two steps out (again in all directions from all the others, so a total of 16 vertices) will be raised or lowered by 0.1m. Calls to level land do the same: they move the land towards the object's centre, or 0.2m towards it if it's more than 0.2m away. The adjacent vertices and those that are one away are affected the same as before - if less that 0.2m is moved, then the vertices two steps away are moved by half as much as the target vertex moved. Now, I was all set to write a nice terraformer based on this when I found that.. just to be really, really annoying.. these don't apply if the land isn't flat. In fact, it appears that the actual behavior can be affected by vertices even further away than two steps. (For the small brush which is only supposed to be three vertices wide that's quite an area!) Does anyone have more precise details on how it's affected? Are there any Linden types who might like to post an algorithmic secret or two? 
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
05-18-2006 07:43
Hi Yumi At /15/a1/100131/1.html I posted the code for my Land Manipulator which sits in a script that flies across land in a zig zag pattern while carrying out land manipulation functions, with the function, brush size and step size all being adjustable via a hud. It also has a single step function. Also, an "average" function is available with a target ground height and will issue lower and raise commands appropriately so that you finish up with level land after having half a dozen of these manipulators flying around for about 30 mins. I posted that hoping that people like you might share if they discovered clues about land behaviour such as you have just posted, but noone has made any comments so far. I have also available for beta testing a "Mapper" which will print with llOwnerSay a matrix of 16 by 16 land heights, each with two decimal digits after the decimal point. I figured that might come in useful when you are in the air manipulating your land and want immediate feedback on how your land reacted. I have it available for sale at $100 at my land at Euttum (58, 67, 115) but if you im me in world I will give you a copy for free. Bear in mind my time zone as i live in Melbourne, Australia. It is now just after midnight for me. I am developing a more complicated land manipulator which will be controllable by notecards so you can reliably run repeatable patterns. One note card should be able to call other notecards etc. I am also interested in what happens if the brush does not line up with a 4 x 4 square piece of land. I am also interested in why i can develop unwanted deep ridges in one direction and not the other. I am generally nonplussed by land move behaviour. Maybe we can share this info. Ed
|
|
Eddy Stryker
libsecondlife Developer
Join date: 6 Jun 2004
Posts: 353
|
05-30-2006 21:03
Not sure how much this helps, but for reference the structure of the actual ModifyLand packet is this: LOW 00156 - ModifyLand - Untrusted - Zerocoded 0260 ModifyBlock (Single / 0) 0099 BrushSize (U8 / 0) 0206 Seconds (F32 / 0) 0212 AgentID (LLUUID / 0) 0854 Height (F32 / 0) 0926 Action (U8 / 0) 0595 ParcelData (Variable / 1) 0280 LocalID (S32 / 0) 0540 East (F32 / 0) 0557 West (F32 / 0) 1262 North (F32 / 0) 1271 South (F32 / 0)
The first block is fairly straightforward, the second block appears to be an ID for the parcel (in context of the local sim, parcels also have UUIDs), and possibly a bounding box described by distances inward from the edge of the sim?
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
05-31-2006 00:24
Hi Eddy and Yumi,
I guess that these are the packets that leave the client when a terraform command is issued. Not sure what the "seconds" are there for. I would not have thought that there is a time component in the terraform requiest. Also find it strange to see both east and west, as well as both north and south coords. One of each should have been sufficient. (Edit: Perhaps one is the land selection and the other the brush position)
I wonder what would happen if the brush size was non standard, ie not one of 2, 4, or 8 M square?
When the adjacent land is owned by me as well as the land I am over, that adjacent land is also affected. However, land owned by my neighbours is never affected, leading to some very steep slopes on the boundary.
Possibly we should pay attention to the normal angles subtended by rocky ground as perhaps they more directly affect the extend of the terraform action.
Yumi, is the brush width the vertex you mention? And is it possible that the non-level land is hitting or close to hitting the 4 M deviation from the revert levels and that might distort the effect of the terraforming operations?
Is it possible to do an operation on a known position on a piece of land and see an example pair of packets?
The mystery deepens . . . .
Ed
|
|
Eddy Stryker
libsecondlife Developer
Join date: 6 Jun 2004
Posts: 353
|
06-05-2006 04:33
From: ed44 Gupte Is it possible to do an operation on a known position on a piece of land and see an example pair of packets? Yes, Snowcrash can definitely do that. The north/south/east/west thing is a bounding box, they are all over the protocol map in Second Life. Given a distance from each edge (of the sim I believe) it creates a bounding box that is your brush. Although the official client only has square brushes I'm assuming you could create a rectangular brush with custom packets. The seconds thing is a bit curious to me as well, my current guess is the terrain modification is rendered on the client side first, and when you let go or move the brush the packet is sent to the server. Either that or it sends packets out on a fixed interval while you are modifying the land, but if you have the button held down for longer than the interval it would show up in the Seconds field. All just speculation, you'd need some actual Snowcrash dumps to see what is really going on. But all of this is just useful information on how the client works, it doesn't change the scripting aspect of things which is what this topic is about.
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
06-05-2006 05:54
Hi Eddy
That makes a lot of sense.
When you manually terraform the selection brush seems to be a rectangle with the sides being multiples of 2 or 4 M. That might have something to do with the way the terrain map is calculated. There is a separate drop down box for the brush size. Not sure what U8 means but maybe an unsigned byte to hold values for small (2 x 2M), medium (4 x 4M) and large (8 x 8M), similar to the llModifyLand brush. But llModifyLand does not seem to have any equivalent to the selected bounds area.
I guess that since the llModifyLand script operates from the server, we'll only ever see its effects after it has done its thing so there is really no point in further examining the packets from the "edit land" box. We should instead be trying to deduce the maths involved between various llModifyLand actions and the effects they have on the land.
After the end of jUne I'll have more time to investigate that and eventually put my mapper to good use.
Ed
|
|
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
|
06-05-2006 07:56
Eddy - Is it possible to try sending an artificed ModifyLand packet with a 1x1 bounding box? If so, and it works, then we have a heightmap uploader for non-Island owners. 
|