From 080e27a38c508b2370cfe7f0152183f99a17131a Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sat, 20 Feb 2016 12:31:37 +1000 Subject: Rearrange the docs. --- AUTHORS | 15 +- docs/BVJ.html | 175 -- docs/BlackListAssetServersTracker.html | 37 - docs/ClientHamr.html | 11 - docs/ClientHamr/BVJ.html | 175 ++ docs/ClientHamr/ClientHamr.html | 11 + docs/ClientHamr/InworldAnimationEditor.html | 111 + docs/ClientHamr/README.mumble | 5 - docs/Grid-data-flow.html | 246 --- docs/Grid_data_flow.png | Bin 207031 -> 0 bytes docs/InworldAnimationEditor.html | 111 - docs/LSL-functions-implemented.html | 2671 ------------------------ docs/LuaSL-New-scripting-engine.html | 917 -------- docs/NGIW.Commands.html | 46 - docs/NGIW.html | 50 - docs/Nails.html | 2519 ---------------------- docs/OMG-WTF-BBQ.html | 25 - docs/SledjHamr.html | 2 +- docs/SledjHamr/Grid-data-flow.html | 246 +++ docs/SledjHamr/Grid_data_flow.png | Bin 0 -> 207031 bytes docs/SledjHamr/LSL-functions-implemented.html | 2671 ++++++++++++++++++++++++ docs/SledjHamr/LuaSL-New-scripting-engine.html | 917 ++++++++ docs/SledjHamr/README.Bookie | 33 - docs/SledjHamr/README.libraries | 34 - docs/SledjHamr/The_Naminator.txt | 14 - docs/SledjHamr/no_accounts.txt | 29 - docs/SledjHamr/portals.txt | 106 - docs/SledjHamr/privacy.txt | 5 - docs/common/BlackListAssetServersTracker.html | 37 + docs/common/NGIW.Commands.html | 46 + docs/common/NGIW.html | 50 + docs/common/Nails.html | 2519 ++++++++++++++++++++++ docs/common/OMG-WTF-BBQ.html | 25 + docs/common/README.Bookie | 33 + docs/common/README.libraries | 34 + docs/common/README.mumble | 5 + docs/common/The_Naminator.txt | 14 + docs/common/no_accounts.txt | 29 + docs/common/portals.txt | 106 + docs/common/privacy.txt | 5 + docs/index.html | 36 +- 41 files changed, 7061 insertions(+), 7060 deletions(-) delete mode 100644 docs/BVJ.html delete mode 100644 docs/BlackListAssetServersTracker.html delete mode 100644 docs/ClientHamr.html create mode 100644 docs/ClientHamr/BVJ.html create mode 100644 docs/ClientHamr/ClientHamr.html create mode 100644 docs/ClientHamr/InworldAnimationEditor.html delete mode 100644 docs/ClientHamr/README.mumble delete mode 100644 docs/Grid-data-flow.html delete mode 100644 docs/Grid_data_flow.png delete mode 100644 docs/InworldAnimationEditor.html delete mode 100644 docs/LSL-functions-implemented.html delete mode 100644 docs/LuaSL-New-scripting-engine.html delete mode 100644 docs/NGIW.Commands.html delete mode 100644 docs/NGIW.html delete mode 100644 docs/Nails.html delete mode 100644 docs/OMG-WTF-BBQ.html create mode 100644 docs/SledjHamr/Grid-data-flow.html create mode 100644 docs/SledjHamr/Grid_data_flow.png create mode 100644 docs/SledjHamr/LSL-functions-implemented.html create mode 100644 docs/SledjHamr/LuaSL-New-scripting-engine.html delete mode 100644 docs/SledjHamr/README.Bookie delete mode 100644 docs/SledjHamr/README.libraries delete mode 100644 docs/SledjHamr/The_Naminator.txt delete mode 100644 docs/SledjHamr/no_accounts.txt delete mode 100644 docs/SledjHamr/portals.txt delete mode 100644 docs/SledjHamr/privacy.txt create mode 100644 docs/common/BlackListAssetServersTracker.html create mode 100644 docs/common/NGIW.Commands.html create mode 100644 docs/common/NGIW.html create mode 100644 docs/common/Nails.html create mode 100644 docs/common/OMG-WTF-BBQ.html create mode 100644 docs/common/README.Bookie create mode 100644 docs/common/README.libraries create mode 100644 docs/common/README.mumble create mode 100644 docs/common/The_Naminator.txt create mode 100644 docs/common/no_accounts.txt create mode 100644 docs/common/portals.txt create mode 100644 docs/common/privacy.txt diff --git a/AUTHORS b/AUTHORS index 4ccf4a7..529b309 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,11 +1,12 @@ David "onefang" Seikel wrote most of this, with the following exceptions in the docs directory - -The avatar known as "Nathan Adored" wrote the first half of OMG-WTF-BBQ. +The avatar known as "Nathan Adored" wrote the first part of OMG-WTF-BBQ, +with onefang supplying the COW stuff. -The avatar known as "Alice Crush" wrote the second half of OMG-WTF-BBQ -in conversation with onefang. Alice also wrote BVJ, ClientHamr, -InworldAnimationEditor, NGIW, and NGIW.Commands. Alice is likely -responsible for some little bits here and there. Alice kinda wrote -BlackListAssetServersTracker, but that's currently the second half of -OMG-WTF-BBQ, and I need to move that. +The avatar known as "Alice Crush" wrote BlackListAssetServersTracker in +conversation with onefang, with onefang untangrling it at the end. +Alice also wrote BVJ, the first half of ClientHamr, +InworldAnimationEditor, NGIW, and NGIW.Commands (onefang wrote the first +paragraph). Alice is likely responsible for some little bits here and +there. diff --git a/docs/BVJ.html b/docs/BVJ.html deleted file mode 100644 index a539705..0000000 --- a/docs/BVJ.html +++ /dev/null @@ -1,175 +0,0 @@ - -BVJ - - - -

BVJ is extensions to the BVH animation format used by SL technology. -It's in the ClientHamr section coz on the server side, they are just -dealt with as blobs to be sent to the viewers. This may change if we -implement animating link sets, and interaction with the sim physics.

-

Syntax

-

This example BVH is 20 lines 505 characters, and defines a pointless animation on a trivial skeleton.

-
   HIERARCHY
-   ROOT Hips
-   {
-       OFFSET  0.00  0.00  0.00
-       CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation
-       JOINT RightUpLeg
-       {
-               OFFSET -3.91  0.00  0.00
-               CHANNELS 3 Zrotation Xrotation Yrotation
-               End Site 
-               {
-                 OFFSET  0.00 -3.46  0.00
-               }
-       }
-   }
-   MOTION
-   Frames:    2
-   Frame Time: 0.033333
-    8.03  35.01  88.36 -3.41  14.78 -164.35  13.09  40.30 -24.60
-    7.81  35.10  86.47 -3.78  12.94 -166.97  12.64  42.57 -22.34
-
-

 

-

JSON

-

First the syntax is changed to be JSON. The sample above is transformed to 19 lines 715 characters:

-
   {
-       "HIERARCHY":{
-           "NAME":"Hips",
-           "OFFSET":[0.00,0.00,0.00],
-           "CHANNELS":["Xposition","Yposition","Zposition","Zrotation","Xrotation","Yrotation"],
-           "JOINTS":[
-               {
-                   "NAME": "RightUpLeg",
-                   "OFFSET": [-3.91, 0.00, 0.00],
-                   "CHANNELS": ["Zrotation", "Xrotation", "Yrotation"],
-                   "JOINTS": [
-                       {
-                           "END": true,
-                           "OFFSET": [0.00, -3.46, 0.00]}]}]},
-       "MOTION":{
-           "Frame Time":0.033333,
-           "Frames":[
-               [8.03,35.01,88.36,-3.41,14.78,-164.35,13.09,40.30,-24.60],
-               [7.81,35.10,86.47,-3.78,12.94,-166.97,12.64,42.57,-22.34]]}}
-   
-
-

or equivalently to 5 lines 469 characters:

-
   {"HIERARCHY":{"NAME":"Hips","OFFSET":[0.00,0.00,0.00],"CHANNELS":["Xposition","Yposition","Zposition","Zrotation","Xrotation","Yrotation"],
-    "JOINTS":[{"NAME":"RightUpLeg","OFFSET":[-3.91,0.00,0.00],"CHANNELS":["Zrotation","Xrotation","Yrotation"],
-    "JOINTS":[{"END":true,"OFFSET":[0.00,-3.46,0.00]}]}]},
-    "MOTION":{"Frame Time":0.033333,"Frames":[[8.03,35.01,88.36,-3.41,14.78,-164.35,13.09,40.30,-24.60],
-    [7.81,35.10,86.47,-3.78,12.94,-166.97,12.64,42.57,-22.34]]}}
-
-

or equivalently 1 line of 461 characters, which I won't include in this document. I have worked though larger examples and this is a very typical compression ratio. A BVJ file (using sampling) is about the same size as a BVH file.

-

 

-

Semantics

-

The semantics are that the "Hips" and the "RightUpLeg" of something are animated. The mapping from the BVJ file's "NAME" fields to the avatar skeleton is straightforward, the names in the BVJ are matched against the names of the skeleton components. Then the appropriate rotations and translations are applied frame by frame.

-

The point of the hierarchy is so that when a joint moves or rotates, it's children get carried along for the ride. When you turn the hips left in the sample BVJ, the whole body turns left.

-

Note that the "offset" value isn't actually used when animating avatars. The position of the hips and the angles are all used, but no attempt is made to match the skeleton bone lengths to the BVH segment lengths. So I propose that we can eliminate them or make them optional to reducing lag and file size. The offsets are useful in other tools because they define a skeleton that can be visualised.

-

 

-

Attachment points

-

The hierarchy portion of a BVJ is a fine place to express attachment points.

-

 

-

Syntax

-
   ...
-   {
-       "NAME": "RightUpLeg",
-       "ATTACH": [12],
-       "OFFSET": [-3.91, 0.00, 0.00],
-   ...
-
-

 

-

Semantics

-

The semantics are that an attachment point can be created for each item in the hierarchy at the midpoint between its parent's position, and the end of it's offset.

-

When a client rezzes in, they could parse and read their current skeleton's BVJ, and use that to tell other clients what attachment point 103 means. No more prims stuck in your crotch floating in space as you walk away.

-

Q: How to define the zero rotation at the attachment point? Need to match what is done now.

-

 

-

Multi-attach

-

If I want to attach two things to my pelvis, say a skirt and a tail, I should be allowed to. There are two ways the client could communicate this to a server, depending on the servers rules. A nice server says "Sure, attach your whole inventory to your head, what do I care?". A mean one says "That attachment point is in use." For mean servers the client can just make a new attachment point at the same place. It would update it's skeleton BVJ to include:

-
   ...
-   {
-       "NAME": "RightUpLeg",
-       "ATTACH": [12,99]
-       "OFFSET": [-3.91, 0.00, 0.00],
-   ...
-
-

 

-

Still More Attachments

-

I would like to further enhance the client to add attachments *at* the joints themselves with the semantics that they average (in some sense of the word) the directions of the two segments from the joint to the beginning of the parent segment and from the joint to end of child segment. The motivation is to have kneecaps/kneepads that move reasonably without special attention from an animator.

-

 

-

Animating Prims

-

BVH was defined with skeletons in mind. But, at first glance it seems that if there were some two (or more) prim object with a root prim named "Hips" and another prim named "RightUpLeg" we should be able to animate that link set using this same BVH/BVJ file.

-

The one issue is that segments in the BVH model are like vectors, they have a near end, a far end, a length, and they rotate about their near end. In particular bones have no width or depth, only length.

-

So I propose adding "PIVOT":[x,y,z] to define about what part of a prim the prim rotates when being animated. When omitted the centre of the prim is used, and is equivalent to "PIVOT":[0,0,0]. The pivot ranges from -1 to 1 on each axis with -1 meaning the small end and 1 the large end. For example consider a cylinder, "PIVOT":[0,0,0.5] would rotate about the point midway between the centre of the cylinder and the +Z face of the cylinder, i.e. half way up to the top. "PIVOT":[0,0,1] would make the cylinder act like a normal bone making up a skeleton.

-

 

-

Animating Attached Prims

-

Things are interesting when I want to define an animation of my avy and an attachment to my avy. Suppose when applying an animation from a BVH or BVJ that I get to a joint named "tail" with a defined attachment point 103. If my avatar is wearing something at point 103, then search that object for a prim named "tail". If I find a prim named "tail" in the attachment then this joint's animation applies to that prim. And all the children of the "tail" joint in the animation are sought in the link set of the attachment.

-

 

-

Yet More Attachment Points

-

Why yes, that *does* mean attachments can have attachments, glad you asked. Suppose my tail has three bones, and the attachment point defined for the last bone is 104. I could attach the tail to point 103, and a pretty bow to point 104. The data model would be avy attachment point 103 has "thin neko tail with pink tip" attached, and avy attachment point 104 has "pretty bow" attached. But because point 104 is defined on a child joint of the joint with attachment point 103, the object "Pretty Bow" would move with a part of the tail, not with some random part of the avy.

-

 

-

Sampling and Keyframing

-

The BVH file format was originally created for motion capture. So it defines animations by means of sampling. The same way a motion picture film samples the world 24 times a second making still photographs, the BVH captures the values on all the channels at regular points in time. But not all animations are created by motion capture, perhaps most are made with a keyframing animation system.

-

Keyframing is cool because it uses the computer to compute all the between states. We tell the computer at time T0 arm is at 13 degrees rotation, and at time T10 it is at 23 degrees rotation, and the computer figures out where the arm needs to be rotated at all points in time between T0 and T10. This can result in smaller animation files and lower CPU usage.

-

 

-

Keyframe Syntax and Semantics

-

I propose adding keyframe syntax as an alternative to the existing "MOTION" section of BVH files.

-
   {
-       "HIERARCHY":{...},
-       "KEYFRAMES":[
-           {
-               "AT":0.00,
-               "Hips":[8.03,35.01,88.36,-3.41,14.78,-164.35],
-               "RightUpLeg":[13.09,40.30,-24.60]},
-           {
-               "AT":0.033333,
-               "Hips":[7.81,35.10,86.47,-3.78,12.94,-166.97],
-               "RightUpLeg":[12.64,42.57,-22.34]}]}
-
-

The semantics are that the value of any channel is the linear interpolation of it between the two closest keyframes in time. Though maybe should support other interpolation schemes such as quadratic, and cubic. I think it's obvious that this will often result in much smaller animation files. My example above is fairly pointless since it is just changing every sample in the BVH into a keyframe. As a result it is bigger, but a possible benefit is that it slightly better supports playback at frame rates other than that specified in the BVH.

-

 

-

Animations, Not BVH Files

-

Another enhancement I want to add is to capture all the elements of an in-world animation in the format. In world animations have things like priority, looped or one shot, loop start/end points, ease-in and ease-out etc.. There is no place for them in a BVH, but not much creativity is needed to put them in a BVJ file. Then we can edit those parameters, set them in the file before import, and save them in a file on export.

-

I favor this placement

-
   {
-       "priority":3.5,
-       "looped":false,
-       "HIERARCHY":{ ... } ...}
-
-

But can see arguments for this instead

-
   {
-       "HIERARCHY":{ ... }
-       "MOTION": {
-           "priority":3.5,
-           "looped":false,
-           ...} ...}
-
-

 

-

 

-

At This Time

-

The last enhancement I want to make is to add absolute time references. Consider using the BVJ file to define the animations of the hands on a analogue clock. I would like to be able to express "At noon, all hands are pointing up." What this means is when invoking an animation we need to map from the Unix time to the animation's time. This is a linear mapping so two numbers are required, one expresses how many animation seconds elapse for each Unix second, the second specifies at what Unix time at which the animation time 0 occurs. There is a third number implied by looping animations. How long the animation is. Note a looping animation often begins to loop at some point after animation time 0 and ends before the largest animation time in the file. This is due to the types of interpolation used when keyframing. Linear interpolation requires two keyframes before a position can be known, quadratic 3, and cubic 4.

-

 

-

Tools to Make BVJ Files

-

Currently there are none, but see InworldAnimationEditor for my ideas. It should be obvious how to transform a BVH into a BVJ file that uses sampling. By looking at the rates of change of channels it is possible to discover inflection points and use them to synthesise a keyframe representation that is a close match to a set of samples.

-

And, of course, I want to make this file format editable in-world using nice GUI and 3D editing tools. Basically a clone of QAvimator in the client.

-

 

-

Client to Client

-

There are use cases where it makes good sense to communicate an animation between clients with almost no server interaction. Why pay 10 Bogus-Bucks to adjust the position of my hand as we sit next to each other. I'll just edit my avatar to move my hand and the client will make a BVJ file ship it to your client which will show it to you.

-

 

-

Changing Poses

-

Fang Said: See the very last paragraph of SledjHamr, the "random notes from my old Web 3.0 document " section at the bottom, to see one suggested method of moving your hand.

-

Alice Replied: Looks cool, but requires Inverse Kinematics (if you mean the touch commands), or some puppeteer protocol that I know nothing about.

-

What I imagine right now is InworldAnimationEditor

-

links

-

Some useful links for actually writing animation code -

-Portal:Computer_graphics -3D_computer_graphics -Skeletal_animation -Morph_target_animation -Inverse_kinematics -

 

-bvhacker.com -bvh_file_specification - - diff --git a/docs/BlackListAssetServersTracker.html b/docs/BlackListAssetServersTracker.html deleted file mode 100644 index d080e87..0000000 --- a/docs/BlackListAssetServersTracker.html +++ /dev/null @@ -1,37 +0,0 @@ - -BlackListAssetServersTracker - - - -

Late night realization about multiple asset servers and Censorship and such.

-

(04:33:43 AM) alice_crush: Oh!

-

(04:36:29 AM) alice_crush: What if we let folks run more than one inventory asset server, and make some asset servers private/subscription. Which just means if a person takes no action they'll never see an asset from a private server. *Then* say folks in Japan can have a sim full of nasty lolicon, and folks from countries that make it illegal to see such pictures won't ever be accidentally exposed. *And* the grid will stay 'pure' never serving "bad" images. "Hey idiot, if you choose to download illegal content, don't complain to us!"

-

(04:38:17 AM) alice_crush: so you could walk around in a t-shirt with a grossly illegal image on it, and unless someone is subscribed to the right asset server they just see gray.

-

(04:39:07 AM) alice_crush: have to get to like phase 2 or whatever, not the stop gap quick fix proxying feature

-

(04:40:26 AM) onefang: That goes to the whole "Hey it's just a web server, you can implement whatever access policy you want" thing.

-

(04:40:53 AM) onefang: "You are not authorized to see this t-shirt.".

-

(04:41:04 AM) alice_crush: though would need some special client side controls/subscriptions something like that.

-

(04:41:26 AM) onefang: "Knomes stole this skirt, quick get hippos."

-

(04:41:34 AM) alice_crush: "This texture above your security grade" lol

-

(04:43:07 AM) onefang: "These are not the clothes you are searching for."

-

(04:43:10 AM) alice_crush: minor issue of when uploading a texture specifying which asset server it goes to...

-

(04:44:03 AM) alice_crush: you could give me your illegal images (drawing of the profit, peace be on him) I could put them out in my sim, and never see the blasphemy myself

-

(04:44:33 AM) onefang: Well, no, that's the whole point of allowing multiple inventory stores. You get to manage them, decide what goes where. Sometimes using ordinary web CMS software, or a file browser for local ones..

-

(04:45:37 AM) alice_crush: Hmmm maybe folks could sell say a pg skin and a X version, and folks could choose to avoid the X asset servers... and not see grey people.

-

(04:46:20 AM) alice_crush: Lol, theres always a clever policy choice that makes the thought police un necessary.

-

(04:46:47 AM) alice_crush: LL will hate it (Breaks the shared experience rule)

-

(04:47:00 AM) alice_crush: OS will probably hate it too

-

(04:48:08 AM) onefang: I'm not particularly worried about pissing off those two groups.

-

(04:48:37 AM) alice_crush: I would rather make thought police optional, then market forces will eliminate them.

-

(04:48:02 AM) alice_crush: some day could have certificates for asset servers, collect them in classes "PG servers", "IP Clean servers" lol

-

 

-

More linear description of above

-

Imagine that texture assets can come from multiple sources. When a sim tells your client about a texture it only tells you an ID, your client has to find out which server has the resource for you.

-

Imagine your client has a list of servers to try, it can simply go through the list of servers stopping as soon as a server gives a response.

-

Imagine that some of the servers in the list come from standard places such as the sim. Imagine that other of the servers come from a manually selected list of private subscription servers.

-

Say I am in simulator 101, I get told about a resource named "409" from the simulator. I check all the asset servers I know. If I don't find it, I show a blank/gray texture.

-

You might be in the same simulator, and you get told about the same resource named "409" by the simulator. In addition to the simulator though, you have a private server you can check, and there you find resource "409" so you client can draw it for you.

-

In this way you and I looking at a third person might see something different. You see the third person wearing a shirt with the logo of a sports team. I see a very plain gray 'slider' shirt, not even with textures cuffs and hems.

-


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

- - diff --git a/docs/ClientHamr.html b/docs/ClientHamr.html deleted file mode 100644 index 30228a3..0000000 --- a/docs/ClientHamr.html +++ /dev/null @@ -1,11 +0,0 @@ - -ClientHamr - - - -

Consider your inventory. A mess huh. Well, what is it really, especially in a world like NGIW / OMG describes? It's just yet another hierarchy of folders and thingies. We are probably wasting our time writing any code for it. Why not leverage the users favourite hierarchy browser/editor. Maybe it's called FileDamager made by MicroCruft in Redstone Wishangton. Maybe it's called Netscape, or Nautilus. Many of the modern file browser tools will talk a protocol named WebDAV. If the asset server spoke WebDAV, then we could perhaps rip the inventory code clean out of the client.

-

This little fantasy points in a really blue sky direction. Use existing protocols and tools to remove stuff from the client. Make it easy for tools that already exist to interact with the 3d world.

-

That's the Client Hammer. ClientHamr is the concept that we can apply the unix philosophy to the viewer. Use individual tools that are good at their job to split off bits of the big bad blob that is the viewer. Using standard protocols and tools where we can.

-

Note - The simian grid has a WebDav front end to inventory. http://code.google.com/p/openmetaverse/

- - diff --git a/docs/ClientHamr/BVJ.html b/docs/ClientHamr/BVJ.html new file mode 100644 index 0000000..d01f234 --- /dev/null +++ b/docs/ClientHamr/BVJ.html @@ -0,0 +1,175 @@ + +BVJ + + + +

BVJ is extensions to the BVH animation format used by SL technology. +It's in the ClientHamr section coz on the server side, they are just +dealt with as blobs to be sent to the viewers. This may change if we +implement animating link sets, and interaction with the sim physics.

+

Syntax

+

This example BVH is 20 lines 505 characters, and defines a pointless animation on a trivial skeleton.

+
   HIERARCHY
+   ROOT Hips
+   {
+       OFFSET  0.00  0.00  0.00
+       CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation
+       JOINT RightUpLeg
+       {
+               OFFSET -3.91  0.00  0.00
+               CHANNELS 3 Zrotation Xrotation Yrotation
+               End Site 
+               {
+                 OFFSET  0.00 -3.46  0.00
+               }
+       }
+   }
+   MOTION
+   Frames:    2
+   Frame Time: 0.033333
+    8.03  35.01  88.36 -3.41  14.78 -164.35  13.09  40.30 -24.60
+    7.81  35.10  86.47 -3.78  12.94 -166.97  12.64  42.57 -22.34
+
+

 

+

JSON

+

First the syntax is changed to be JSON. The sample above is transformed to 19 lines 715 characters:

+
   {
+       "HIERARCHY":{
+           "NAME":"Hips",
+           "OFFSET":[0.00,0.00,0.00],
+           "CHANNELS":["Xposition","Yposition","Zposition","Zrotation","Xrotation","Yrotation"],
+           "JOINTS":[
+               {
+                   "NAME": "RightUpLeg",
+                   "OFFSET": [-3.91, 0.00, 0.00],
+                   "CHANNELS": ["Zrotation", "Xrotation", "Yrotation"],
+                   "JOINTS": [
+                       {
+                           "END": true,
+                           "OFFSET": [0.00, -3.46, 0.00]}]}]},
+       "MOTION":{
+           "Frame Time":0.033333,
+           "Frames":[
+               [8.03,35.01,88.36,-3.41,14.78,-164.35,13.09,40.30,-24.60],
+               [7.81,35.10,86.47,-3.78,12.94,-166.97,12.64,42.57,-22.34]]}}
+   
+
+

or equivalently to 5 lines 469 characters:

+
   {"HIERARCHY":{"NAME":"Hips","OFFSET":[0.00,0.00,0.00],"CHANNELS":["Xposition","Yposition","Zposition","Zrotation","Xrotation","Yrotation"],
+    "JOINTS":[{"NAME":"RightUpLeg","OFFSET":[-3.91,0.00,0.00],"CHANNELS":["Zrotation","Xrotation","Yrotation"],
+    "JOINTS":[{"END":true,"OFFSET":[0.00,-3.46,0.00]}]}]},
+    "MOTION":{"Frame Time":0.033333,"Frames":[[8.03,35.01,88.36,-3.41,14.78,-164.35,13.09,40.30,-24.60],
+    [7.81,35.10,86.47,-3.78,12.94,-166.97,12.64,42.57,-22.34]]}}
+
+

or equivalently 1 line of 461 characters, which I won't include in this document. I have worked though larger examples and this is a very typical compression ratio. A BVJ file (using sampling) is about the same size as a BVH file.

+

 

+

Semantics

+

The semantics are that the "Hips" and the "RightUpLeg" of something are animated. The mapping from the BVJ file's "NAME" fields to the avatar skeleton is straightforward, the names in the BVJ are matched against the names of the skeleton components. Then the appropriate rotations and translations are applied frame by frame.

+

The point of the hierarchy is so that when a joint moves or rotates, it's children get carried along for the ride. When you turn the hips left in the sample BVJ, the whole body turns left.

+

Note that the "offset" value isn't actually used when animating avatars. The position of the hips and the angles are all used, but no attempt is made to match the skeleton bone lengths to the BVH segment lengths. So I propose that we can eliminate them or make them optional to reducing lag and file size. The offsets are useful in other tools because they define a skeleton that can be visualised.

+

 

+

Attachment points

+

The hierarchy portion of a BVJ is a fine place to express attachment points.

+

 

+

Syntax

+
   ...
+   {
+       "NAME": "RightUpLeg",
+       "ATTACH": [12],
+       "OFFSET": [-3.91, 0.00, 0.00],
+   ...
+
+

 

+

Semantics

+

The semantics are that an attachment point can be created for each item in the hierarchy at the midpoint between its parent's position, and the end of it's offset.

+

When a client rezzes in, they could parse and read their current skeleton's BVJ, and use that to tell other clients what attachment point 103 means. No more prims stuck in your crotch floating in space as you walk away.

+

Q: How to define the zero rotation at the attachment point? Need to match what is done now.

+

 

+

Multi-attach

+

If I want to attach two things to my pelvis, say a skirt and a tail, I should be allowed to. There are two ways the client could communicate this to a server, depending on the servers rules. A nice server says "Sure, attach your whole inventory to your head, what do I care?". A mean one says "That attachment point is in use." For mean servers the client can just make a new attachment point at the same place. It would update it's skeleton BVJ to include:

+
   ...
+   {
+       "NAME": "RightUpLeg",
+       "ATTACH": [12,99]
+       "OFFSET": [-3.91, 0.00, 0.00],
+   ...
+
+

 

+

Still More Attachments

+

I would like to further enhance the client to add attachments *at* the joints themselves with the semantics that they average (in some sense of the word) the directions of the two segments from the joint to the beginning of the parent segment and from the joint to end of child segment. The motivation is to have kneecaps/kneepads that move reasonably without special attention from an animator.

+

 

+

Animating Prims

+

BVH was defined with skeletons in mind. But, at first glance it seems that if there were some two (or more) prim object with a root prim named "Hips" and another prim named "RightUpLeg" we should be able to animate that link set using this same BVH/BVJ file.

+

The one issue is that segments in the BVH model are like vectors, they have a near end, a far end, a length, and they rotate about their near end. In particular bones have no width or depth, only length.

+

So I propose adding "PIVOT":[x,y,z] to define about what part of a prim the prim rotates when being animated. When omitted the centre of the prim is used, and is equivalent to "PIVOT":[0,0,0]. The pivot ranges from -1 to 1 on each axis with -1 meaning the small end and 1 the large end. For example consider a cylinder, "PIVOT":[0,0,0.5] would rotate about the point midway between the centre of the cylinder and the +Z face of the cylinder, i.e. half way up to the top. "PIVOT":[0,0,1] would make the cylinder act like a normal bone making up a skeleton.

+

 

+

Animating Attached Prims

+

Things are interesting when I want to define an animation of my avy and an attachment to my avy. Suppose when applying an animation from a BVH or BVJ that I get to a joint named "tail" with a defined attachment point 103. If my avatar is wearing something at point 103, then search that object for a prim named "tail". If I find a prim named "tail" in the attachment then this joint's animation applies to that prim. And all the children of the "tail" joint in the animation are sought in the link set of the attachment.

+

 

+

Yet More Attachment Points

+

Why yes, that *does* mean attachments can have attachments, glad you asked. Suppose my tail has three bones, and the attachment point defined for the last bone is 104. I could attach the tail to point 103, and a pretty bow to point 104. The data model would be avy attachment point 103 has "thin neko tail with pink tip" attached, and avy attachment point 104 has "pretty bow" attached. But because point 104 is defined on a child joint of the joint with attachment point 103, the object "Pretty Bow" would move with a part of the tail, not with some random part of the avy.

+

 

+

Sampling and Keyframing

+

The BVH file format was originally created for motion capture. So it defines animations by means of sampling. The same way a motion picture film samples the world 24 times a second making still photographs, the BVH captures the values on all the channels at regular points in time. But not all animations are created by motion capture, perhaps most are made with a keyframing animation system.

+

Keyframing is cool because it uses the computer to compute all the between states. We tell the computer at time T0 arm is at 13 degrees rotation, and at time T10 it is at 23 degrees rotation, and the computer figures out where the arm needs to be rotated at all points in time between T0 and T10. This can result in smaller animation files and lower CPU usage.

+

 

+

Keyframe Syntax and Semantics

+

I propose adding keyframe syntax as an alternative to the existing "MOTION" section of BVH files.

+
   {
+       "HIERARCHY":{...},
+       "KEYFRAMES":[
+           {
+               "AT":0.00,
+               "Hips":[8.03,35.01,88.36,-3.41,14.78,-164.35],
+               "RightUpLeg":[13.09,40.30,-24.60]},
+           {
+               "AT":0.033333,
+               "Hips":[7.81,35.10,86.47,-3.78,12.94,-166.97],
+               "RightUpLeg":[12.64,42.57,-22.34]}]}
+
+

The semantics are that the value of any channel is the linear interpolation of it between the two closest keyframes in time. Though maybe should support other interpolation schemes such as quadratic, and cubic. I think it's obvious that this will often result in much smaller animation files. My example above is fairly pointless since it is just changing every sample in the BVH into a keyframe. As a result it is bigger, but a possible benefit is that it slightly better supports playback at frame rates other than that specified in the BVH.

+

 

+

Animations, Not BVH Files

+

Another enhancement I want to add is to capture all the elements of an in-world animation in the format. In world animations have things like priority, looped or one shot, loop start/end points, ease-in and ease-out etc.. There is no place for them in a BVH, but not much creativity is needed to put them in a BVJ file. Then we can edit those parameters, set them in the file before import, and save them in a file on export.

+

I favor this placement

+
   {
+       "priority":3.5,
+       "looped":false,
+       "HIERARCHY":{ ... } ...}
+
+

But can see arguments for this instead

+
   {
+       "HIERARCHY":{ ... }
+       "MOTION": {
+           "priority":3.5,
+           "looped":false,
+           ...} ...}
+
+

 

+

 

+

At This Time

+

The last enhancement I want to make is to add absolute time references. Consider using the BVJ file to define the animations of the hands on a analogue clock. I would like to be able to express "At noon, all hands are pointing up." What this means is when invoking an animation we need to map from the Unix time to the animation's time. This is a linear mapping so two numbers are required, one expresses how many animation seconds elapse for each Unix second, the second specifies at what Unix time at which the animation time 0 occurs. There is a third number implied by looping animations. How long the animation is. Note a looping animation often begins to loop at some point after animation time 0 and ends before the largest animation time in the file. This is due to the types of interpolation used when keyframing. Linear interpolation requires two keyframes before a position can be known, quadratic 3, and cubic 4.

+

 

+

Tools to Make BVJ Files

+

Currently there are none, but see InworldAnimationEditor for my ideas. It should be obvious how to transform a BVH into a BVJ file that uses sampling. By looking at the rates of change of channels it is possible to discover inflection points and use them to synthesise a keyframe representation that is a close match to a set of samples.

+

And, of course, I want to make this file format editable in-world using nice GUI and 3D editing tools. Basically a clone of QAvimator in the client.

+

 

+

Client to Client

+

There are use cases where it makes good sense to communicate an animation between clients with almost no server interaction. Why pay 10 Bogus-Bucks to adjust the position of my hand as we sit next to each other. I'll just edit my avatar to move my hand and the client will make a BVJ file ship it to your client which will show it to you.

+

 

+

Changing Poses

+

Fang Said: See the very last paragraph of SledjHamr, the "random notes from my old Web 3.0 document " section at the bottom, to see one suggested method of moving your hand.

+

Alice Replied: Looks cool, but requires Inverse Kinematics (if you mean the touch commands), or some puppeteer protocol that I know nothing about.

+

What I imagine right now is InworldAnimationEditor

+

links

+

Some useful links for actually writing animation code -

+Portal:Computer_graphics +3D_computer_graphics +Skeletal_animation +Morph_target_animation +Inverse_kinematics +

 

+bvhacker.com +bvh_file_specification + + diff --git a/docs/ClientHamr/ClientHamr.html b/docs/ClientHamr/ClientHamr.html new file mode 100644 index 0000000..f77279c --- /dev/null +++ b/docs/ClientHamr/ClientHamr.html @@ -0,0 +1,11 @@ + +ClientHamr + + + +

Consider your inventory. A mess huh. Well, what is it really, especially in a world like NGIW / OMG describes? It's just yet another hierarchy of folders and thingies. We are probably wasting our time writing any code for it. Why not leverage the users favourite hierarchy browser/editor. Maybe it's called FileDamager made by MicroCruft in Redstone Wishangton. Maybe it's called Netscape, or Nautilus. Many of the modern file browser tools will talk a protocol named WebDAV. If the asset server spoke WebDAV, then we could perhaps rip the inventory code clean out of the client.

+

This little fantasy points in a really blue sky direction. Use existing protocols and tools to remove stuff from the client. Make it easy for tools that already exist to interact with the 3d world.

+

That's the Client Hammer. ClientHamr is the concept that we can apply the unix philosophy to the viewer. Use individual tools that are good at their job to split off bits of the big bad blob that is the viewer. Using standard protocols and tools where we can.

+

Note - The simian grid has a WebDav front end to inventory. http://code.google.com/p/openmetaverse/

+ + diff --git a/docs/ClientHamr/InworldAnimationEditor.html b/docs/ClientHamr/InworldAnimationEditor.html new file mode 100644 index 0000000..82da594 --- /dev/null +++ b/docs/ClientHamr/InworldAnimationEditor.html @@ -0,0 +1,111 @@ + +InworldAnimationEditor + + + +IAE is an idea to put an animation editor in world, much like the link set editor. +

Normal Editing

+

Step 1: right click avy > edit pose > a list of currently playing animations displays and you can choose one. Or right click avy > new pose

+

Step 2a: big edit style arrows sprout from the current joint (last edited, or hips by default). You can interact with it in all the standard ways users already know about with the build window. Move? Drag an arrow. Rotate? Drag a ring or the grey ball.

+

Step 2b: The edit window opens to the animation tab, or perhaps a whole new GUI. As a first approximation, imagine grabbing all the stuff from qavimator, squishing it into one or two 'floaters' windows inside the client.

+ + + + + + + +

 

+

Inverse Kinematics

+

The GUI I imagine for IK, perhaps a tab on the animation editor?

+ +

 

+

Edit Multiple Animations

+

To take advantage of the 'absolute time' feature, you need to edit multiple animations at one time to make them interact well. Each animation could sprout a new line in the time line window. Would need some indicator which is the current animation and way to switch so the numbers boxes and meta info displays make sense. Time between the many animations is synchronised, so stepping a frame forward, steps all animations forward.

+

Most importantly, if you are granted permission, you should be able to right click on another avy, and choose edit pose.

+

 

+

Animate other stuff

+

Now, I described all this as if BVJ's only applied to avatars. They don't. But the commands and behaviours are the same when editing animations for a door, an avatar, or an attachment (to an attachment to...) to an avatar.

+

 

+

Possibilities

+

If you edit your pose, and the animations of 3 small balls, you could make a juggle animation with balls and hands synchronised. You can make "play catch" animations for two people and a ball. Be a multi-legged creature: add bones, attach prims, animate, enjoy.

+ + diff --git a/docs/ClientHamr/README.mumble b/docs/ClientHamr/README.mumble deleted file mode 100644 index 1010f18..0000000 --- a/docs/ClientHamr/README.mumble +++ /dev/null @@ -1,5 +0,0 @@ -Viewer integration with mumble and whisper, and using it for as many -audio services as it can. - -Mumble is a voice system designed for networked 3D game usage. Sounds -perfect, just what we need. B-) diff --git a/docs/Grid-data-flow.html b/docs/Grid-data-flow.html deleted file mode 100644 index 1f3ff93..0000000 --- a/docs/Grid-data-flow.html +++ /dev/null @@ -1,246 +0,0 @@ - -Grid data flow - - - -

Existing, and possibly incorrect, wisdom

-

In this section I will mention the stuff that I think I know, and why it might be wrong. There have been major changes in how these things have been dealt with, particularly with the introduction of ROBUST. Personally I have experience with the closed source OpenSim fork that was in use at M7, and the open source OpenSim fork that is used at IG.

-

There are two types of assets - things that have been rezzed in a sim, and users inventory. While poking around in the M7 system I figured out that both are somewhat similar.

-

There is database stuff that has meta data at least, and there is file based stuff that seems to include the actual asset data, things like script source, script binaries, texture, sounds, animations. I was not able to completely understand it all before M7 closed.

-

Received wisdom is that sim assets are stored on the sims server, and that inventory assets are stored on the central database. Recent experience has suggested that this is not correct. While I was testing the IGnoble scripts, I loaded an OAR of my home sim into the sim I was running on my local computer. Surprisingly, my sim server spent the next three hours uploading .. something .. to the grid server (my upload speed is not spectacular, and there was a decent amount of data). Only after it had completed that, did it rez the sim in world, which happened quickly for me, but I was sitting on the same computer as the sim server. A quick inspection showed that I had the expected file based assets on my server, though they where in the cache directory.

-

My theory is that the sim assets are also stored on the central server, but cached on the sim server. The big upload was probably the entire contents of the OAR file.

-

Now, lets figure out what's really going on.

-

 

-

ROBUST

-

ROBUST seems to be the centre of the OS data flow universe. "ROBUST is a flexible server shell ..." the OS web site says, not sure exactly what that means. We shall find out. It basically seems to be a way to connect to arbitrary processing and storage modules, and the storage modules part is where our interest lies on this page.

-

Sim servers point to one or more ROBUST servers for their services, These pointers are a HTTP URLs that is usually the grid server, and a port number. You can have different ROBUST services on different port numbers, or on different servers. The ROBUST servers can handle one or more of the services. ROBUST servers can point to others, acting as a proxy. ROBUST hosted services can have others as dependencies, they can point to other instances of ROBUST on other URL/ports.

-

Robust has the concept of IN and OUT connectors. The IN's seem to be the ports used by sim servers and others to connect to the services, they load the proper OUT or code modules. The OUTS seem to be the connectors to the database, or perhaps the code performing the service. Or maybe the OUTs are for sending data back, and the modules are for doing the work?

-

Apparently ROBUST is designed to allow code reuse.

-

Note that this will allow us to easily integrate OMG, as we can do that in any language, implement the relevant parts of the ROBUST wire protocol, listen on a given HTTP port, then just tell the ROBUST clients to use that port. Nails:command pump in fact includes provisions to have wrappers for other protocols, which is a perfect match here. So glad we don't have to deal with direct interfacing to C# code. B-)

-

The ROBUST wire protocol looks like it's HTTP POSTs to the URL and port number. The POST includes the service name, and a verbose (XML, ewww) text command to that service.

-

 

-

sim server view

-

Sim servers have these, which include connection strings to the local database server -

- -

These only include a URL to the grid server -

- -

There are three possible asset caches, only one should be on, but none of them can be on -

- -

 

-

grid server view

-

A quick look shows the sims on the grid server seem to be setup the same way.

-

ROBUST has this to say -

- -

 

-

the big data holders

-

On sims -

-

Asset and Inventory services include connection strings to the local database, and URLs to the ROBUST grid server. There is also the cache. Only flotsam cache will be looked at for now.

-

On the grid server -

-

Asset service includes a local file part, but may include a database part. Inventory service, dunno. Library service is file based, but not important right now.

-

Soooo, what is stored where? Which are the real assets? Where's the data, database or file? Where's the cheese? B-)

-

The source code is here -

-

 

-

InventoryService

- -

Question - What does the sim use it's InventoryService database connection string for? Perhaps that's only needed for when the sim is not using ROBUST?

- -

Hmmm, according to OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs -> CacheInventoryServiceURL() there may already be a mechanism in place to use other inventory servers PER USER. For HG I think. Makes sense. B-)

-

 

-

AssetService

- - - - - -

 

-

Users of these services

-

The above is what tracing things from the configuration files gets you. But this is C#, an object oriented programming language. Like most such languages, it's carefully designed to hide implementation details from the programmer. Which is fine, unless it's the details that you really want to know. Then it sucks, and you sometimes have to understand the deep magic, and do a lot of searching and head scratching to figure things out.

-

So, that's the provided frame work, let's see if we can sort out how that frame work is used, and if anything steps outside of that frame work.

-

There is still a large piece of the puzzle missing. The above services only seem to deal with the metadata for assets, not with the actual data.

-

 

-

database

-

prims is the prims in the sim. primshapes is their shapes. primitems is the content of the sim prims.

-

prims.RegionID prims.UUID == primshapes.UUID But what about primitems? That has (takes a deep breath) itemID, primID, assetID, and parentfolderID. primID seems to be exactly the same as parentfolderID. And indeed prims.UUID == primitems.primID. itemID and primID are keys, itemID is the primary. primitems.assetID=assets.id

- -

Primitems is only metadata, where is the actual data? Is this what itemID and/or assetID are all about? Primshapes has a Texture blob, but is it all the face textures that go into a prim?

-

inventoryitems has - inventoryID and assetID (also avatarID and groupID). Oddly enough it has a groupOwned flag to. I thought inventory would only be owned by the person who's inventory it is in, but I have seen things in my own inventory owned by others. Once more, it's only metadata. InventoryID is the primary key.

-

It appears all roads lead to Rome .. er the assets database. One ginormous amorphous blob of all our stuffs. It has some metadata, an id, and a data blob, the contents of the data blobs on the ones I have seen look to be about the correct size for being the actual data for the asset. id is the primary key. There still might be a file system as well? As a cache only? The assets table on sim servers seems to just be the default assets. The grid server assets table is almost 2 million records, or perhaps only half a million, the system gave two very different counts. Could be where all the damn asset data is stored. B-(

-

The grid prims table only has assets for the grid sims, plus a few others that are old sims, which got deleted from the regions table automatically I think.

-

Prims table is all the prims in the grid sims. Prim shapes is data about those prims. Primitems is the contents of those prims. Assets stores stuff for primitems.

-

Umm, things that used to be in the sim get into the OAR? The new sims I created to test OS 0.7.2 now have stuff in their prim* tables from people that have not logged on. I copied them from Sandbox using OARs. It seems to be true, but why only one or three objects? I don't think OARs populated prim* tables on 0.7.1.

-

NOTE - it takes a loooong time to search the assets database for a name.

-

 

-

 

-

Sim assets

-

Sim server opensim.prims.RegionUUID and UUID

-

Sim server opensim.prims.UUID -> Sim server opensim.primshapes.UUID (one to one) The actual prim shape.

-

Sim server opensim.prims.UUID -> Sim server opensim.primitems.primID (one to many) The meta data for the prims contents.

-

Sim server opensim.primitems.assetID -> Grid server opensim.assets.id (one to one) The actual data for the prims contents.

-

prims.SceneGroupID seems to be what ties a linkset together.

-

Primshapes has two binary blobs, one called Texture, the other called ExtraParams.

-

primshapes.ExtraParams includes flexi (various flexi parameters), light (local light parameters), sculpt (type, sculptMapTextureUUID), and projection (projectionTextureUUID, FOV, focus, amb).

-

primshapes.Texture is an OpenMetaverse library binary object that includes data for the textures and colours on each prims side. primshapes.Texture includes texture UUIDs, directly stored as 16 bytes, plus the other texture information, stared as binary, some of it stored as bit fields. For prims with more than one texture, more copies of this data is stored. OpenMetaverse library is included in OpenSim as a binary, no source, but I found the source, just not sure which version.

-

I'm assuming for the moment that actual texture data is all in the grids assets table, probably cached on the sim server using flotsam. In theory textures have to go into inventory first before they are applied to prims. In practice, OARs can bypass that.

-

 

-

Inventory assets

-

All on the grid server.

-

opensim.inventoryitems.inventoryID, avatarID, and parentFolderID

-

opensim.inventoryitems.assetID -> assets.id (one to one) The actual data for the inventory.

-

opensim.inventoryfolders.folderID, agentID, and ParentFolderID

-

This seems pretty straight forward.

-

 

- -Grid data flow - -

 

-

Experiments

-

 

-

Using a new assetService on an existing sim server.

-

I tried configuring my home sim server to have it's own ROBUST server, and the sim running there to use it only for AssetService. The immediate result was horribly correct. It can't have been that easy. In the end, it was not that easy. It had the meta data about assets, but the assets data was still on the grid server. The sim shows up on the map as white. I was unable to rez things from inventory, but could create new stuff, and even move objects to the next sim running on someone else's server. Everything else seemed to be working fine, though one person (running on a very underpowered computer) had troubles rezzing herself, and switching back to the grid AssetService seemed to fix that. On the other hand, another person rezzed fine. Both these people where connecting to my home sim server from some other place on the planet than my home. The tests where not exhaustive, but the inability to rez from inventory was a show stopper. Something needs to be fixed for that to work. The fact that it still stored the assets data on the grid server means it was a failed experiment, as that's the primary goal.

-

Refinements of that experiment would be to see what happens when a new sim is built up within that configuration from newly created prims. What happens during an OAR load? Will the new assets be stored locally, or sent to the grid server, or will it just not work?

-

 

-

Using a different InventoryService for an existing / new user

-

This is more likely to succeed, as it's a similar mechanism to that used by HG, a pointer to an external InventoryService is stored with the HG users record on the grid they HGed to.

-

UserAccounts.ServiceURLs has "HomeURI= GatekeeperURI= InventoryServerURI= AssetServerURI=", or blank, or NULL. It either has to be empty, or properly filled out. They are normal service URLs as used by ROBUST. I think they are only involved in HG. Only one person in the IG database has those filled out, I think that was a test Rizzy was doing. Not sure what HomeURI is, but the others look like the usual ROBUST services. Though GateKeeper is for incoming users? Wonder what HGers get if they are stored in this database table?

-

HomeURI is the URI to the UserAgent service on their home grid. It's used to authenticate them with their home grid, and to form the URL part that is added to their name in world.

-

Hmmm, does not look like GatekeeperURI is actually used. shrugs

-

 

-

Trying to make a new sim using an old sims UUID on a different server

-

In theory this should not work, since the prim metadata is on the old sim server, and not accessible from the new server.

-

 

-

Load an OAR that includes a texture that is NOT in anyone's inventory, to see where it ends up.

-

I'll have to create a fake texture first, then see if I can fake an OAR with that texture.

-

Should create a sim with just a test prim in it, with the default texture. Save the OAR. Then see if I can insert a faked texture onto that prim in the OAR.

-

The terrain texture might be a good choice to experiment with to, they are easily changed in the OAR, and stored in the OAR. Their UUIDs are stored in the regionsettings table.

-

 

-

notes

-

Just hijacking my own page here for a moment - The console uses the ? key to show help, no matter where you type it. So ? can't be use as part of a name or other arbitrary text. The offending lines are in OpenSim/Framework/Console/LocalConsole.cs starting at line 398.

-

I just woke up and had an idea, it might turn out to be crap once I have actually thought about it. lol

-

One of the biggest problems is that sim asset data is spread between the sim server and the grid server, this makes things hard. We can abuse the cache mechanism. Write a cache module that stores sim asset data on the sim server, in a format that matches the rest of OMG. It's not really a cache though, it's the new sim asset database. Have the sim server tell the grid server that it's OK to delete stuff from the asset server, it has it now. On the grid server side, have a "last accessed" time stamp on the assets database. Archive stuff that's not been used for awhile. Actually delete stuff if there's no inventory pointers to it, AND sims using it have said it's OK to delete. Adding some reference counting to that database might help this process to.

-


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

- - diff --git a/docs/Grid_data_flow.png b/docs/Grid_data_flow.png deleted file mode 100644 index 8324280..0000000 Binary files a/docs/Grid_data_flow.png and /dev/null differ diff --git a/docs/InworldAnimationEditor.html b/docs/InworldAnimationEditor.html deleted file mode 100644 index 82da594..0000000 --- a/docs/InworldAnimationEditor.html +++ /dev/null @@ -1,111 +0,0 @@ - -InworldAnimationEditor - - - -IAE is an idea to put an animation editor in world, much like the link set editor. -

Normal Editing

-

Step 1: right click avy > edit pose > a list of currently playing animations displays and you can choose one. Or right click avy > new pose

-

Step 2a: big edit style arrows sprout from the current joint (last edited, or hips by default). You can interact with it in all the standard ways users already know about with the build window. Move? Drag an arrow. Rotate? Drag a ring or the grey ball.

-

Step 2b: The edit window opens to the animation tab, or perhaps a whole new GUI. As a first approximation, imagine grabbing all the stuff from qavimator, squishing it into one or two 'floaters' windows inside the client.

- - - - - - - -

 

-

Inverse Kinematics

-

The GUI I imagine for IK, perhaps a tab on the animation editor?

- -

 

-

Edit Multiple Animations

-

To take advantage of the 'absolute time' feature, you need to edit multiple animations at one time to make them interact well. Each animation could sprout a new line in the time line window. Would need some indicator which is the current animation and way to switch so the numbers boxes and meta info displays make sense. Time between the many animations is synchronised, so stepping a frame forward, steps all animations forward.

-

Most importantly, if you are granted permission, you should be able to right click on another avy, and choose edit pose.

-

 

-

Animate other stuff

-

Now, I described all this as if BVJ's only applied to avatars. They don't. But the commands and behaviours are the same when editing animations for a door, an avatar, or an attachment (to an attachment to...) to an avatar.

-

 

-

Possibilities

-

If you edit your pose, and the animations of 3 small balls, you could make a juggle animation with balls and hands synchronised. You can make "play catch" animations for two people and a ball. Be a multi-legged creature: add bones, attach prims, animate, enjoy.

- - diff --git a/docs/LSL-functions-implemented.html b/docs/LSL-functions-implemented.html deleted file mode 100644 index 7126a49..0000000 --- a/docs/LSL-functions-implemented.html +++ /dev/null @@ -1,2671 +0,0 @@ - -LSL functions implemented - - - -

This is where we can track what LSL functions are implemented in LuaSL, and what the differences are from SL and OpenSim. Note that the goal is to be SL compatible. OpenSim compatibility comes second.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
ColourStatus
WhiteNothing done.
RedJust a stub.
OrangeStub prints debug stuff.
MagentaStub that passes details to the server and waits for the response if one is needed.
GrayStub that fakes enough for the current tests.
YellowFleshed out a bit.
GreenFully implemented, maybe.
PurpleTested and works at least.
CyanCompletely compatible with SL.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
CodeMeaning
LFunction can be done locally, without dealing with the sim or grid.
RFunction can be done through ROBUST.
DFunction can be done through the local sims database.
OFunction needs to deal with the world server.
DO?Can do it through the local sims database, but may need to let the world server know so it notices the change?
gGod mode function.
dObsolete function that has been deprecated.
bFunction is marked as broken by LL, and may not work even in SL.
-

 

-

animation override

- - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llGetAnimationOverride   
llResetAnimationOverride   
llSetAnimationOverride   
-

 

-

avatar

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llAttachToAvatar  O
llAvatarOnLinkSitTarget  O
llAvatarOnSitTarget  O
llClearCameraParams  O
llDetachFromAvatar  O
llForceMouselook  O
llGetAgentInfo  R?
llGetAgentLanguage   
llGetAgentSize  R?
llGetAnimation  O
llGetAnimationList  O
llGetAttached  O
llGetCameraPos  O
llGetCameraRot  O
llGetDisplayName   
llGetPermissions  O
llGetPermissionsKey  O
llGetUsername  R
llGiveMoney  O
llKey2Name  R
llPointAt  d
llReleaseCamera  dO
llReleaseControls  O
llRequestAgentData  R?
llRequestDisplayName   
llRequestPermissions  O
llRequestUsername  R
llSameGroup  DR
llSetCameraParams  O
llSitTarget  DO?
llStartAnimation  O
llStopAnimation  O
llStopPointAt  dO
llTakeCamera  dO
llTakeControls  O
llTeleportAgentHome  O
llTransferLindenDollars  O
llUnSit  O
-

 

-

collision / detect / sensor

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llCastRay   
llCollisionFilter   
llCollisionSound   
llCollisionSprite  b
llDetectedGrab  O
llDetectedGroup  O
llDetectedKey  O
llDetectedLinkNumber  O
llDetectedName  O
llDetectedOwner  O
llDetectedPos  O
llDetectedRot  O
llDetectedTouchBinormal  O
llDetectedTouchFace  O
llDetectedTouchPos  O
llDetectedTouchST  O
llDetectedTouchUV  O
llDetectedType  O
llDetectedVel  O
llPassCollisions   
llPassTouches   
llSensor   
llSensorRemove   
llSensorRepeat   
llVolumeDetect   
-

 

-

communications

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llDialog  O
llEmail   
llGetNextEmail   
llInstantMessage  O
llListen  O
llListenControl  O
llListenRemove  O
llMessageLinked  L
llOwnerSay  O
llRegionSay  O
llRegionSayTo  O
llSay  O
llShout  O
llTextBox  O
llWhisper  O
-

 

-

inventory

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llAllowInventoryDrop  DO?
llGetInventoryCreator  D
llGetInventoryKey  D
llGetInventoryName  D
llGetInventoryNumber  D
llGetInventoryPermMask  D
llGetInventoryType  D
llGetNotecardLine  DR
llGetNumberOfNotecardLines  DR
llGiveInventory  O
llGiveInventoryList  O
llGodLikeRezObject  Og
llRemoveInventory  DO?
llRequestInventoryData  D?
llRezAtRoot  O
llRezObject  O
llSetInventoryPermMask  gDO?
-

 

-

JSON

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llJson2List   
llJsonGetValue   
llJsonSetValue   
llJsonValueType   
llList2Json   
-

 

-

land

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llAddToLandBanList    
llAddToLandPassList   
llEjectFromLand   
llGetLandOwnerAt   
llGetParcelDetails   
llGetParcelFlags   
llGetParcelMaxPrims   
llGetParcelMusicURL   
llGetParcelPrimCount   
llGetParcelPrimOwners   
llGetSimStats   
llGround   
llGroundContour   
llGroundNormal   
llGroundSlope   
llManageEstateAccess   
llModifyLand   
llOverMyLand   
llParcelMediaCommandList   
llParcelMediaQuery   
llRemoveFromLandBanList   
llRemoveFromLandPassList   
llResetLandBanList   
llResetLandPassList   
llReturnObjectsByID   
llReturnObjectsByOwner   
llSetParcelMusicURL   
-

 

-

list

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llCSV2List  L
llDeleteSubList  L
llDumpList2String  L
llGetListEntryType  L
llGetListLength  L
llList2CSV  L
llList2Float  L
llList2Integer  L
llList2Key  L
llList2List  L
llList2ListStrided  L
llList2Rot  L
llList2String  L
llList2Vector  L
llListFindList  L
llListInsertList  L
llListReplaceList  L
llListRandomize  L
llListSort  L
llListStatistics  L
llParseString2List  L
llParseStringKeepNulls   L
-

 

-

math

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llAbs  L
llAcos  L
llAngleBetween  L
llAsin  L
llAtan2  L
llAxes2Rot  L
llAxisAngle2Rot  L
llCeil  L
llCos  L
llEuler2Rot  L
llFabs  L
llFloor  L
llFrand  L
llLog  L
llLog10  L
llModPow  L
llPow  L
llRot2Angle  L
llRot2Axis  L
llRot2Euler  L
llRot2Fwd  L
llRot2Left  L
llRot2Up  L
llRotBetween  L
llRound  L
llSin  L
llSqrt  L
llTan  L
llVecDist  L
llVecMag  L
llVecNorm  L
-

 

-

media

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llAdjustSoundVolume   
llClearPrimMedia   
llClearLinkMedia   
llGetLinkMedia   
llGetParcelMusicURL   
llGetPrimMediaParams   
llLoopSound   
llLoopSoundMaster   
llLoopSoundSlave   
llPlaySound   
llPlaySoundSlave   
llPreloadSound   
llRefreshPrimURL  d
llSetLinkMedia   
llSetPrimMediaParams   
llSetPrimURL  d
llSetSoundQueueing   
llSetSoundRadius   
llStopSound   
llSound  d
llSoundPreload  d
llTriggerSound   
llTriggerSoundLimited   
-

 

-

path finding

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llCreateCharacter   
llDeleteCharacter   
llEvade   
llExecCharacterCmd   
llFleeFrom   
llGetClosestNavPoint   
llGetStaticPath   
llNavigateTo   
llPatrolPoints   
llPursue   
llUpdateCharacter   
llWanderWithin   
-

-

 

-

physics

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llApplyImpulse  DO?
llApplyRotationalImpulse  DO?
llGetAccel  D
llGetEnergy  DO?
llGetForce  D
llGetMass  D
llGetMassMKS  D
llGetObjectMass  D
llGetOmega  D
llGetTorque  D
llGetVel  D
llMoveToTarget  DO?
llPushObject  DO?
llSetAngularVelocity  DO?
llSetBuoyancy  DO?
llSetForce  DO?
llSetForceAndTorque  DO?
llSetHoverHeight  DO?
llSetTorque  DO?
llSetVelocity  DO?
llTargetOmega  DO?
-

 

-

object / prim / link

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llBreakAllLinks  DO?
llBreakLink  DO?
llCreateLink  DO?
llDie  DO?
llGetBoundingBox  D
llGetGeometricCenter  D
llGetKey  D
llGetLinkKey  D
llGetLinkPrimitiveParams  D
llGetLinkName  D
llGetLinkNumber  D
llGetLinkNumberOfSides  D
llGetMaxScaleFactor   
llGetMinScaleFactor   
llGetNumberOfPrims  D
llGetObjectDesc  D
llGetObjectDetails  D
llGetObjectName  D
llGetObjectPermMask  D
llGetObjectPrimCount  D
llGetOwner  D
llGetOwnerKey  D
llGetPhysicsMaterial   
llGetPrimitiveParams  D
llGetStatus  D
llLinkParticleSystem  DO?
llLinkSitTarget  DO?
llMakeExplosion  dDO?
llMakeFire  dDO?
llMakeFountain  dDO?
llMakeSmoke  dDO?
llParticleSystem  DO?
llScaleByFactor   
llSetCameraAtOffset  DO?
llSetCameraEyeOffset  DO?
llSetClickAction  DO?
llSetDamage  DO?
llSetKeyframedMotion   
llSetLinkCamera  DO?
llSetLinkPrimitiveParams  DO?
llSetLinkPrimitiveParamsFast  DO?
llSetObjectDesc  DO?
llSetObjectName  DO?
llSetObjectPermMask  gDO?
llSetPayPrice  DO?
llSetPhysicsMaterial   
llSetPrimitiveParams  DO?
llSetSitText  DO?
llSetStatus  DO?
llSetText  DO?
llSetTouchText  DO?
llSitTarget  DO?
-

 

-

rotation / scaling / translation

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llGetLocalPos  D
llGetLocalRot  D
llGetPos  D
llGetRootPosition  D
llGetRootRotation  D
llGetRot  D
llGetScale  D
llLookAt  DO?
llRotLookAt  DO?
llRotTarget  DO?
llRotTargetRemove  DO?
llSetLocalRot  DO?
llSetPos  DO?
llSetRegionPos  DO?
llSetRot  DO?
llSetScale  DO?
llStopLookAt  DO?
-

 

-

script

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llGetFreeMemory  L
llGetMemoryLimit  L
llGetScriptName  L
llGetScriptState  L
llGetSPMaxMemory  L
llGetStartParameter  L
llGetUsedMemory  L
llRemoteLoadScript  d
llRemoteLoadScriptPin   
llResetOtherScript  L
llResetScript  L
llScriptDanger   
llScriptProfiler  L
llSetMemoryLimit  L
llSetRemoteScriptAccessPin  L, but might have to tell the sim server.
llSetScriptState  L, but might have to tell the sim server.
-

 

-

simulator

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llCloud   
llEdgeOfWorld  R
llGetEnv  R?
llGetRegionAgentCount  O
llGetRegionCorner  R
llGetRegionFlags  RD?
llGetRegionFPS  O
llGetRegionName  R
llGetRegionTimeDilation  O
llGetSimulatorHostname  R
llGetSunDirection  R
llMapDestination  O
llRequestSimulatorData  R?
llWater   
llWind   
-

 

-

string

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llBase64ToString  L
llDeleteSubString  L
llGetSubString  L
llInsertString  L
llMD5String  L
llSHA1String  L
llStringLength  L
llStringToBase64  L
llStringTrim  L
llSubStringIndex  L
llToLower  L
llToUpper  L
llXorBase64   
llXorBase64StringsCorrect  L
llXorBase64Strings  Ld
-

 

-

texture

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llGetAlpha  D
llGetColor  D
llGetNumberOfSides  D
llGetTexture  D
llGetTextureOffset  D
llGetTextureRot  D
llGetTextureScale  D
llOffsetTexture  DO?
llRotateTexture  DO?
llScaleTexture  DO?
llSetAlpha  DO?
llSetColor  DO?
llSetLinkAlpha  DO?
llSetLinkColor  DO?
llSetLinkTexture  DO?
llSetLinkTextureAnim  DO?
llSetTexture  DO?
llSetTextureAnim  DO?
-

 

-

time

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llGetAndResetTime  L
llGetDate  L
lGetGMTclock  L
llGetTime  L
llGetTimeOfDay  L
llGetTimestamp  L
llGetUnixTime  L
llGetWallclock  L
llMinEventDelay   
llResetTime  L
llSetTimerEvent  L
llSleep  L
-

 

-

vehicle

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llRemoveVehicleFlags   
llSetVehicleFlags   
llSetVehicleFloatParam   
llSetVehicleType   
llSetVehicleRotationParam   
llSetVehicleVectorParam   
-

 

-

XML-RPC and HTTP

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL functionSL notesOpenSim notesCodes
llCloseRemoteDataChannel   
llEscapeURL   
llGetFreeURLs   
llGetHTTPHeader   
llHTTPRequest   
llHTTPResponse   
llLoadURL   
llOpenRemoteDataChannel   
llReleaseURL   
llRemoteDataReply   
llRemoteDataSetRegion  d
llRequestSecureURL   
llRequestURL   
llSendRemoteData   
llSetContentType   
llUnescapeURLs   
-


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

- - diff --git a/docs/LuaSL-New-scripting-engine.html b/docs/LuaSL-New-scripting-engine.html deleted file mode 100644 index cae5300..0000000 --- a/docs/LuaSL-New-scripting-engine.html +++ /dev/null @@ -1,917 +0,0 @@ - -LuaSL New scripting engine - - - -

LuaSL is a Lua based LSL scripting engine that will aim for LSL -compatibility first, then adding Lua extensions. It aims to replace the -woeful XEngine from OpenSim, and at a later stage, be the basis for a -client side scripting engine.

-

To compile this, you will need Enlightenment Foundation Libraries (EFL) -installed in either /opt/e17 or /usr. These are typical places it get's -installed in. You will also need flex. The rest of the dependencies -are in the ../libraries directory.

-

write our own

-

I had considered in the SledjHamr document writing a new script engine from scratch in Lua. This is what I wrote -

-

"I'd love to write a Lua implementation of LSL, I'm sure Alice would want to write a Scheme one."

-

"I've been thinking of trying out Lua as a backend for LSL, and trying some micro threading style experiments."

-

That's about the sum total of my plans and thoughts though. lol

-

Here are some more random thoughts.

-

Writing an entire scripting engine in a new language is a big job.

-

Lua is meant to be embedded into other things as an internal scripting language. It has great features that let it be a meta language, you can make it look like other languages, or add other language concepts. Plus it's tiny. Being used by online games like WoW means it's probably got what it takes. These are reasons I chose it for both server side and client side scripting.

-

My own personal plan was to cut my teeth on Lua by using EFL for a RL contract I'm working on, then add Lua scripting to the meta-impy viewer. It turns out that the EFL Lua support was not complete, but I managed to use it in that project anyway. My next Lua plans are to implement in EFL those things that project needed. I did not plan on working on a Lua based server side scripting engine until after I had implemented some of the OMG plans. In particular, I want to do that stuff in C, and C is the natural partner for Lua. Adding Lua to .NET / mono is a whole can of worms I personally don't want to get stuck in.

-

I have successfully completed my plans to implement EFL Lua things that my RL contract needed. That's in the current release of the EFL libraries, so I can move onto my next plans now.

-

On the other hand, perhaps it's worthwhile starting on our own scripting engine now? It's a big job, so lets break it down.

-

 

-

Lua to .NET bindings.

-

OpenSim is written in C#, a language I don't know much about. C# is one of the languages that Microsoft's .NET (and the unix port mono) can support. There seems to be a few projects that have done this for us. Some of these might be duplicated, I've not actually read them, just a quick search.

-

Some details about Lua.NET, also mentions some others, but with broken links.

-

LuaInterface

-

Details how to integrate the two from Visual Studio, so really only useful for Windows.

-

Lua.NET

-

Another roll your own example.

-

 

-

Interfacing to the virtual world

-

Some parts of a scripting engine need to interface with the virtual world. Changing prims, detecting touches, playing sounds, starting animations, etc. The existing script engine has C# functions that map LSL script functions to what's needed to do these things in OpenSim. Lua, being an embedded scripting language, has methods of making Lua functions that can call the under laying systems functions. So it should not be that hard to just map pre existing C# functions to Lua functions in the same way that they are now mapped to LSL functions.

-

 

-

Compiler

-

LSL, C#, and Lua are all compiled. I think LSL is compiled to .NET bytecode, C# certainly is. Lua is compiled to it's own bytecode, but perhaps one of the bindings I mentioned before would compile it to .NET bytecode? Compilation is now done server side. It used to be done viewer side, but that changed when LL moved to a mono backend for LSL. OpenSim being .NET / mono in the first place, could just take advantage of that and work in the same way. OpenSim does not support the old LSL script engine. I don't think we need to either.

-

 

-

Language

-

OpenSim allows people to write in world scripts in C# as well as LSL. Personally, I've NEVER seen any actual in world examples being used, only some theoretical examples on web pages. I suspect that people want their scripts to be more or less compatible with SL, so they stick to LSL. Certainly there is a great amount of scripts that came from SL, so they are LSL anyway.

-

It's possible we would want people to be able to write scripts in Lua as well as LSL. That might actually get more traction than C#, as we might attract scripters from WoW and other popular online games that use Lua for scripting. I think it has advantages also for when Lua scripting makes it into the client. Server and client side scripting should be compatible. I don't think LSL is a good language for client side scripting, as it's just not made with that in mind.

-

 

-

Design

-

There are a number of ways we can go about this. Do we write the entire scripting engine in Lua, and only interface with C# for those things we really need to in order to get OpenSim to do in world stuff? Do we write a LSL to Lua translation layer that then compiles the Lua? The OpenSim engine I understand does that, translates LSL to C# then compiles that to .NET. Could we start with a higher level of Lua that interfaces with the existing LSL support functions in OpenSim? Can we even rely on those LSL support functions being a stable API? Should we start by experimenting with Lua's meta language features, see how close we can get it to look like LSL syntax? Perhaps concentrate on those parts of the job that don't require interfacing to OpenSim, and hope that SledjHamr can meet it half way to avoid the entire .NET thing?

-

I choose to do those last two things - see how far I can get Lua to look like LSL, and concentrate on the parts that don't require interfacing to OpenSim, hoping that I can avoid the entire .NET thing.

- -

The basic design will be made up as I go along, but so far I have this -

- -

A parser parses an LSL script, validating it and reporting errors.

- -

A translator takes the result of the parse, and converts it into Lua -source. Each LSL script becomes a Lua state. LSL states are handled as -Lua tables, with each LSL state function being a table function in a -common metatable. LL and OS functions are likely to be C or Lua -functions. Careful testing should be done with LuaJIT FFI, sandboxing, -and performance testing.

- -

The Lua source is compiled by the Lua compiler.

- -

LuaJIT is used as the Lua compiler, library, and runtime.

- -

Luaproc is used to start up operating system threads and hand Lua states -between them. Luaproc messaging is also being used, but might need to -change to edje messaging. Note - luaproc has been extensively rewritten -for this project, mostly converting it to use EFL. That rewrite -substantially shrunk the source code. Then it was all rewritten again -to use EFL threads, and cooperative multitasking.

- -

THIS IS WHERE WE ARE RIGHT NOW.

- -

Should implement embedded Lua somehow. Probably the best thing to do is -to have comments like -

- -

//Lua: local t = {1, 3, 42, x='something', 'something else}

-/*Lua: print(t.x) */

- -

The LSL parser picks these up and stores them in the AST as Lua -snippets, then the compiler output functions just inserts them in the -Lua code it is generating. Obviously these Lua snippets can access the -rest of the generated Lua code. They should also be able to access -skang and thus do proper GUI stuff on viewers that support skang.

- -

Nails will be used to pump commands in and out of the LuaSL system. -Incoming commands invoke LSL events via the LuaSL state metatable. LL -and OS functions that impact the world will be converted to nails -commands sent to the command pump.

- -

Initially, since this is the first thing being written, a nails command -pump client needs to be installed into OpenSim's C# stuff. Though it -might be possible to talk directly to ROBUST instead. Think I'll try -the ROBUST route, see how far I can get. That's the general principle -applying in all of this - try to avoid C# and see how for we can get. -lol

- -

On the other hand, might be better to leverage the existing C# -implementations of LSL functions, just to get things up and running -quickly. To that end, a protocol involving exchanging snippets of Lua -over a network socket has been developed, and the next step is to write -the C# side. sigh

- -

A watchdog thread should be used to make sure no LuaSL script spends -forever processing any event.

- -

Some form of serialisation will need to be created for saving script -state during shutdowns, passing script state to other threads / -processes / computers. Apparently Lua is good at this.

- -

There will have to be a MySQL (and maybe SQLite) client in the system, -so we can talk directly to the local sim database. Esskyuehl may be -suitable, though it's still in the prototype stage.

- -

Email, HTTP, and XML-RPC might need to be dealt with by us. A ROBUST -client will be needed to. Azy might be suitable, but it's also in -prototype.

- -

An object is a file system directory, full of LSL scripts as text files, -notecards as text files, animations as BVH (or later BVJ) files, etc. -There will be some sort of metadata in place. This could be created by -our own OpenSim compatible cache module.

- - -

Test harness.

--------------

- -

I'll build a test harness. It will be based on EFL Edje Lua, with -buttons for triggering LSL events, SL style dialogues, and other goodies.

- -

The initial goal will be to run standard MLP scripts. They have minimal -interface to the world, and exercise quite a bit of the rest of LSL. -They are also quite common, and sometimes responsible for a lot of the -script running load.

- -

Later I should add stock standard OpenCollar scripts from SL. They are -a bitch to get working under OpenSim, so would be good compatibility -tests.

- -

Various eina logging domains might be used to handle whisper, say, shout, -etc.

- -

Performance testing will have to be done on 5000 scripts, to see how -that compares against XEngine.

- -

The test harness became the love world server.

- - -

TODO

-

----

- -

Useful for limiting the amount of time scripts use - -

https://groups.google.com/forum/#!topic/lua-alchemy-dev/3bDPk2aQ8FE

-

http://stackoverflow.com/questions/862256/how-can-i-end-a-lua-thread-cleanly

- - - -

 

-

onefangs implementation ideas

-

I'm gonna write an LSL script engine in Lua and C. At least initially, I'll pretend I can use SledjHamr instead of OpenSim, and see how far I get. The source is at https://github.com/onefang/SledjHamr on the experimental branch.

-

 

-

You're in a maze of twisty little quirks, all different.

-

LSL is known for being more quirks than features. Some of the quirks are just limitations that we can get rid of. Some we will have to replicate just to be compatible. OpenSim adds it's own quirks on top of those, but one of the points of doing this is to avoid that particular set of quirks. I'll create two variations, using the first line comment hack OpenSim invented to choose between them. The default is to use the quirky one, where an effort is made to replicate the full quirkiness of LSL. The other choice has no quirks at all, and even lets Lua features be mixed in. This Lua flavoured LSL will be the first one to work on, as it will be a lot easier.

-

 

-

Making Lua look like LSL

-

There are syntactic differences between LSL and Lua. Although Lua is good as a metalanguage, those syntax differences wont go away by themselves. I think some sort of preprocessor would be needed to massage LSL into Lua as a first step in compiling.

-

The preprocessor would have to start by parsing the LSL code into some sort of useful structure. Since the whole point of this exercise as that the OpenSim Xengine sucks, and it's written in C# anyway, don't want to use that. The Aurora script engine likely sucks less, but is still C#. The standard viewer source code includes an LSL parser written using flex and bison. It looks like C code, with C++ wrappers to wedge it nicely into the rest of the viewer code, but it generates C++ code full of LL classes.

-

A test harness could be constructed using EFL Edje Lua to provide some push buttons that can trigger LSL events, provide dialogues, and display various state info. I think a good start is to put the MLP scripts and their notecards / animations into a directory, call that directory an Object, perhaps even implement some of the rest of SledjHamr with some object meta data (MLP will need access to the objects description). MLP is a good test subject, it tends to soak up a lot of sim resources, it's interface to the world is minimal, and it would exercise a lot of the non world interfacing stuff.

-

For reference, here is Lua reference manual, Lua PIL (for Lua 5.0), LuaJIT, LSL Wiki, and SL LSL portal.

-

 

-

comments and line endings

-

Well, comments get stripped out as part of the compile, so probably should not worry about that. Though the preprocessor will need to understand LSL style comments. LSL uses C++ // style comments, every thing from the // to the end of the line is ignored, as well as C style comments, everything between /* and */ is ignored.

-

In LSL, statements need to end in a semicolon. In Lua, they are optional. So we can just leave them in. Just needed to say that somewhere.

-

 

-

types

-

LSL has fixed type per variable. Lua is dynamically typed, and variables can have any type at any given time.

-

The basic LSL types are -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSL typeLSL detailsLua typeNotes
integerA signed 32 bit integer, can use hex (integer hex = 0xff;).numberLua numbers are C double-precision floating-point IEEE 754 numbers, though other types can be used when compiling Lua. This will be a problem, they wont be stored faithfully.
floatAn IEEE-754 32-bit floating point value.numberPerfect match, if Lua is compiled as default.
vectorThree floats in the form < x , y , z >. Usually a position, colour, or Euler rotation. Use a table and metatable, or a userdata.
rotationA quaternion rotation, made up of 4 floats, < x , y , z , s >. Use a table and metatable, or a usedata.
keyA UUID, specialised string in the same format as UUIDs everywhere. Can use a string, though perhaps a metatable or userdata would help? While it is true that it's just a string representation of a 32 bit integer, Lua has no way of faithfully representing 32 bit integers.
stringA sequence of UTF-8 characters. They support a few backslash escapes at compile time.stringLua string represents an immutable sequences of bytes. Lua is 8-bit clean: strings can contain any 8-bit value, including embedded zeros ('\0').
listA heterogeneous list of the other data types. Use a table with number keys.
-

 

-

bit operations

-

LSL relies on bit operations, especially for some of it's functions. Lua only grew bit operations in 5.2, which I have not looked at yet. A complication is that Lua numbers are floats by default, so these might not be efficient. LuaJIT on the other hand, has the bit operations built in.

-

 

-

scope

-

This is one of the reasons why we are writing our own script engine. The OpenSim XEngine's scope system is very broken. So we gotta do better than that at the very least. Wont be hard. B-)

-

 

-

Brackets, parenthesis, and braces; oh my.

-

LSL uses -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSLMeaningLuaNotes
 
()Expression re-ordering.()Exact match.
 
{}Code block.do statements endSee the flow control section for other uses.
 
[]List creation.someList = { "a", varB, 3, functionF(foo) } 
 
<>Vector and rotation creation. Well, since we are doing these as a table, we can use table creating functions.
-

 

-

flow control

-

LSL uses C style flow control, Lua does not. "LSL conditions are evaluated left to right, instead of right to left as in most programming languages." They are also not short circuited. There is no break or continue in LSL.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
LSLLuaNotes
 
-
do
- {
-   statements;
- } while (condition);
-
-
-
repeat
-  statements
-until condition
-
-
-
 
 
-
for (initialisation; condition; update)
-{
-  statements;
-}
-
-
-
for variable = e1, e2, e3 do
-  statements
-end
-
-
for variableList in explist do
-  statements
-end
-
-
-
In the first Lua form, variable starts from e1, gets e3 added through each loop, and stops at e2. -

The second form is complicated, see the lua reference manual. It can be rewritten as -

-
do
-  local f, s, var = explist
-  while true do
-    local var_1, ···, var_n = f(s, var)
-    if var_1 == nil then break end
-    var = var_1
-    statements
-  end
-end
-
-
-

Neither is a good match against LSL. To make things worse, the for variables in Lua are all local to the for loop, and it's not safe to change them in the loop. So we can't use Lua for loops to implement LSL for loops.

-

A LSL for loop could be rewritten as -

-
initialisation
-while (condition)
-{
-	statements;
-	update;
-}
-
-

Which can be implemented by a Lua while statement.

-
 
-
if (condition)
-{
-  statements;
-}
-else if (condition)
-{
-  statements;
-}
-else
-{
-  statements;
-}
-
-
-
if condition then
-  statements
-elseif condition then
-  statements
-else
-  statements
-end
-
-
-
 
 
-
jump Label;
-statements;
-@Label;
-
-
-
goto Label
-statements
-::Label::
-
-
-
-

Think this is only in Lua 5.2, and there might be good reasons to not use Lua 5.2, especially since we are using LuaJIT. http://lua-users.org/lists/lua-l/2009-11/msg00061.html might help to explain why.

-
 
-
while (condition) 
-{
-  statements;
-}
-
-
-
while condition do
- statements
-end
-
-
-
 
-

 

-

count from 0 / 1

-

LSL counts list entries from 0. Negative numbers can also be used to count backwards in a list. Therefore, the last element has index -1. The first element would also have an index of (-llGetListLength(myList))

-

LSL string indices start at 0. Using negative numbers for start and/or end causes the index to count backwards from the length of the string, so 0, -1 would be the entire string. If start is larger than end the substring is the exclusion of the entries, so 6, 4 would be the entire string except for the 5th character. If you wish to include the last character in a string, use -1, -1 , the last two, use -2, -1 , etc. Except for llInsertString().

-

Lua counts tables with a sequence of consecutive integer keys from 1 to the length of the sequence as a special table type with syntax sugar and functions to deal with them.

-

Lua string indices also start at 1. Indices are allowed to be negative and are interpreted as indexing backwards, from the end of the string. Thus, the last character is at position -1, and so on.

-

For strings (and utf8 while we are at it) just create a count from 0 strg library that otherwise duplicates the string library. For tables, do the same with a tbl library, make 0 a first class table index like everything else, then I think we are only left with table constructors like x = ["a", "b", "c"].

-

 

-

functions

-

LSL functions have an optional type (in which case it must return that type), and optional typed parameters. Lua is all dynamically typed, so we can just leave out the types, but check them at compile time.

-

LSL passes function parameters by value. Lua passes by value as well, I think. Tables may be passed by reference.

-

 

-

states

-

LSL states can be dealt with as tables of functions, one per state, with all the usual LSL events stubbed out. So a single metatable will help. A currentState table will point to the current LSL state.

-

 

-

Efficiently running thousands of scripts

-

(As a data point, Anarchadia has 3315 scripts running.)

-

LSL scripts seem to be a good match for Lua states. Each script/state is independent, with no global data shared between them except for what is explicitly sent via communications calls, or calls to the system it's embedded in (the world interfacing). Lua scripts can be run in separate OS threads, which lets us make use of multi core CPUs. It's theoretically not too hard to serialise Lua, so running Lua states can be stopped, sent to some other computer, then restarted (good for attachment scripts when TPing).

-

"luaproc is a concurrent programming library for Lua. It implements an approach, geared towards massive concurrency support, which uses multiple independent lua_States as lightweight user threads ("Lua processes") and kernel threads as workers." Sounds like a good match, except it seems to be more an experiment for an academic paper than something useful. It is on github, with recent changes, well, recently added. https://github.com/askyrme/luaproc

-

Lua has cooperative multitasking, but not pre-emptive. LSL is event driven, and no event processing should take forever. However, we would still need to deal with badly written scripts with infinite loops in them.

- -

I just had a thought. It might be worthwhile doing some typical compiler optimisations. Should see if doing that to the LSL helps. The Lua compiler might do that for us anyway, but certainly worth investigating. On the other hand, LuaJIT probably does most of that for us anyway. Might not be worthwhile.

-

 

-

hacking up Lua source

-

I was hoping to avoid it, but I think we may have to hack up Lua source and not use any system supplied Lua library. The main reason is integers. LSL scripters expect integers to behave like 32 bit signed integers, not like 32 bit floats. So that's gonna cause no end of problems unless we have a a native 32 bit signed integer type in Lua. We can't just compile Lua to use 32 bit signed integers for it's number type, as then LSL floats get broken.

-

Things we should hack up Lua source for -

- -


Things we could hack up the Lua source for if we are gonna do it anyway -

- -

Looks like LuaJIT gets us part of the way there, and it's supposed to be the fastest scripting language around, not much slower than C. Some of the above hacking wont be needed. It's a drop in replacement for Lua 5.1, but it has extras as well, some from 5.2, some already mentioned above in the hacks we night need to do. It has FFI, which also speeds up linking to C code, but that's very dangerous low level code. Should see if we can use it, THEN sandbox it away. See this link about sandboxing - http://osdir.com/ml/general/2011-02/msg23395.html

-

 

-

Hooking it up to OpenSim

-

OpenSim has a mechanism for each script to choose the script engine it will run under, and even the language used. The first line of the script is interpreted by OpenSim if it's a comment. If it's not proper, OpenSim bitches about not being able to load a non existent script engine. Some examples of existing supported first lines -

- -

If no language is added after the colon, LSL is assumed. We will use that, and add -

- -

As before, if that line is not there, then the default OpenSim script engine and language is used, which these days is XEngine and LSL. The default language for LuaSL will be LuaSL, which is a hybrid of LSL and what ever Lua syntax that can't be mistaken for LSL syntax. In other words, it's LSL, but any Lua code that the LSL parser does not barf on simply gets passed through to the Lua compiler. //LuaSL:Lua means the script is purely Lua code. Though perhaps that should be --LuaSL:Lua, to be compatible with Lua? //LuaSL:lsl means that the script is purely LSL code, no Lua will be tolerated.

-

//LuaSL:LuaSL is what I'm writing to start off with, as it's the simplest thing to do. Well, OK, Pure Lua would be simpler, coz I could leave out the LSL parser stage, but that bit is half done anyway. Either way, the big part of the job is writing all those LSL functions, especially those that deal with the world.

-

Ewww, will have to write C# stubs for OpenSim interfacing. Using a nails command pump as the intermediary sounds like a sane approach, as we will have to end up with one of those anyway. LuaSL will be a separate process, running scripts in threads, with a base control thread. The base control thread will handle our end of the nails command pump.

-

 

-

non world interfacing functions

-

Some LSL functions don't need to actually interface with the world, we can do them in the script engine without needing to bother OpenSim. Things like list handling functions, strings, maths, etc.

-

 

-

stepping outside the world

-

LSL has functions for dealing with email, HTTP, and XML-RPC. Now we could implement those systems ourselves, but to start with might be easier to just use the OpenSim implementation. Doing it ourselves may screw with internal state of OpenSim if it's doing those things for non LuaSL using scripts. Or they might fight over open ports and such.

-

 

-

getting world events

-

What ever 'orrible method OpenSim uses to get in world events to scripts, we will have to capture and send to our shiny new script engine.

-

 

-

changing the world

-

When our scripts want to change the world, we will have to convince OpenSim to do that for us. If we are really lucky, we can talk directly to the asset server. Might be able to just talk to the sims local database, but that gets tricky if the script engine is NOT running on the sim server, which is a possibility we want to keep open.

-

For the functions that get and set prim properties, we should use wrappers around llSetPrimitiveParams() and friends. The Nails protocol is partly based on those functions, so this will work out well for the future, when we move to a Nails command pump.

-

 

-

Lifestyles of the rich and infamous... er I mean life cycle of a script, and communications with the engine.

-

Scripts start life currently in OpenSim, will get sent to the script engine to be compiled, than started or stopped, eventually might get deleted. While they are running, the script engine requests in world services, and responds to events. Each of these things needs OpenSim and the script engine to refer to specific scripts, can use script UUIDs for that. My basic idea is to run the script engine as a separate process, communicating over a socket to the OpenSim processes. Initially, just for ease of implementation, I'm thinking of sending function calls and parameters as Lua function calls, and getting the results back as Lua values. We can use Lua table syntax to provide the script UUID, which will be called "SID" in the following discussion.

-

It's really quite arbitrary whether OpenSim or LuaSL will be the server end. On the one hand, when we are using nails, the central nails command pump is currently being talked about as if it's a server, with every thing else, including the script engine, being clients. On the other hand, the script engine might be better off as a ROBUST service. which implies it's a server, though a server hiding behind the ROBUST proxy. I guess you could look at it as OpenSim is using the script engine as a server that runs scripts, and the script engine using OpenSim as a server to run certain functions is only a temporary measure. Have to make a decision one way or another - Deciding to have LuaSL run as the server end, OpenSim as the client end. Later I'll add the ability to read the OpenSim config files to LuaSL, but for now the default hard coded port will be 8211.

-

Note that the final goal is to move as much of the OpenSim script functionality to the script Engine as possible. Later we will be replacing other bits of OpenSim as well, this is just the first part. So some of these communications might be inefficient, and might stay that way, but still could speed things up if that's not too hard. This is just a preliminary suggested protocol to get things up and running quickly. From my experiments, looks like it might be best to restrict this temporary protocol to function calls and returned values.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
Life stageOpenSimLuaSL script engine
 
save script -
SID.save([=[
-default 
-{ 
-  state_entry() 
-  {
-    llSay(0, "Saluton Mondon.");
-  }
-}
-]=])
-
-

The [=[ ... ]=] syntax is Lua code for a multi line string. Actually, this is too delicate. What if the script happens to have the end string delimiter in it? Have OpenSim just write the file itself, it already has the script text in memory anyway. Much more robust. Also, later, our special asset "cache" will write them for us anyway.

-
 
 
compile script -
SID.compile(/path/to/script/source)
-
-

The filename can be a URL, or a FILE:// URL, or just a file name.

-
 
 
  Compiles the script. -
SID.compilerError(42,10,"Something icky here!")
-SID.compilerWarning(123,38,"Eww, you did not mean that, surely?")
-SID.compiled(false)
-
-
-

That's line number, column number, and error message in the first two. true or false in the last one to show if it finish OK, or gave up.

-
 
start script -
SID.start()
-
-
 
 
  Starts / resumes the script.
 
script calls in world ll*() function  -
SID.llSay(0,"Hello World")
-
-
 
 Sends the text to channel 0. 
 
   -
SID.llUnsit("66864f3c-e095-d9c8-058d-d6575e6ed1b8")
-
-
 
 Avatar stands up. 
 
   -
SID.llGetAgentSize("66864f3c-e095-d9c8-058d-d6575e6ed1b8")
-
-
 
  -
SID.return {x=0.45, y=0.6, z=1.8}
-
-

OpenSim sends back a vector.

-
 
 
in world event -
SID.events.detectedNames(
-{
-  "kelly rocket",
-  "onefang rejected",
-}) 
-SID.events.detectedKeys(
-{
-  "01234567-89ab-cdef-0123-456789abcdef",
-  "66864f3c-e095-d9c8-058d-d6575e6ed1b8",
-})
-SID.events.touch_start(2)
-
-
-

Sent as three separate lines, one per function call.

-
 
 
  Calls that event handler in the current state, making sure that calls to llDetected*() return the proper results.
 
stop script -
SID.stop()
-
-
 
 
  Pauses (yields) the script
 
delete script -
SID.delete()
-
-
 
 
  Deletes it's local copy of the script, and it's compiled version.
-

 

-

XMRE?

-

A lot of us came from Meta 7, and some of us liked the Meta 7 extensions to LSL that where part of XMRE. I don't think it's a good idea to just clone XMRE, for a few reasons. Would be much better to just provide similar functionality. Some of it comes for free from Lua anyway, just with a different syntax.

-

This script engine is only gonna be source code compatible, as we are not using Mono like every one else, so no such thing as binary compatibility can be provided. Source code is how scripts travel between grids anyway.

-

There are many scripts from the millions of SL users, going back almost a decade of SL life. This means there are lots of scripts that originated from SL floating around the OpenSim community. Some are open source, some people brought scripts with them from SL that they wrote themselves, some are being used outside of SL with the permission of the scripts authors. It's theoretically impossible to steal script source code from SL, but it can probably be done through social engineering or some such. So I expect there are some illegal copies of SL scripts out there to. The point is, there's LOTS of scripts from SL. This is why SL compatibility is important. There is a huge pool of available scripts from SL.

-

OpenSim added some extensions to LSL, and they are available on all the OpenSim grids, though some might be disabled. There is a smaller pool of scripts available from OpenSim. Scripters in OpenSim expect the those extensions to exist. Being compatible with those extensions would be important, and would help other OpenSim grids adopt this script engine if it turns out to be any good.

-

Meta 7 was much smaller, not around for so long, and most scripts there either came from the SL pool of available scripts, the OpenSim pool of available scripts, or where written in Meta 7 by LSL scripters. I don't think the Meta 7 specific pool of scripts is anything other than small, the pool of scripts that need XMRE extensions is probably minuscule. OpenSim scripters don't expect those extensions to be available. So I don't think that being strictly compatible with XMRE is needed. Those small number of scripts written to use XMRE extensions can probably be converted to what I'm about to propose.

-

I was lucky that kelly managed to save the reference pages from Meta 7 that covered their extensions in detail. I was able to go over them and figure out what to do. The summary is this - we should be able to provide similar functionality as XMRE, but not an exact clone. Lua already has powerful table stuff that is better than the XMRE array stuff, with a similar syntax for those parts that they share. No need to reinvent that wheel. Switch, continue, and exception handling could be treated as just adding things from other C like languages to the LSL C like language. On the other hand, it's gonna be simpler to just let people use Lua style stuff for these things. Writing an LSL scripting engine is already a huge job, the functionality is there in Lua, we could skip implementing the exact C like syntax and get more important things done. We can add in the C style syntax later if there is much call for it. The event stuff I would already be one third of the way there based on my current design. The other two thirds we could get just by designing the rest of that subsystem to suit. After all, not much difference if we store those structures in C or Lua, since it all has to go to Lua anyway. Might as well do it in Lua, and give the scripters access.

-

This XMRE type stuff would be using the //LuaSL:LuaSL engine. Pure //LuaSL:LSL would not have it, and pure //LuaSL:Lua would not need it. So by writing the LuaSL variation first, we get some parts of XMRE like extensions for free, mostly the Lua table stuff that is similar to XMRE arrays, only better.

-

 

-

flow control - break, case, constant, continue, default, switch

-

Lua has no switch (so no case or default either), but since you can store functions in tables, you can fake it easily enough. We can add the "case" part as a set of anonymous functions stored in a switch table; index the switch table with the value of the switch statement to find the correct function to call; use a metatable to detect when a switch value is missing to call the default anonymous function of the switch; have a switch.fallthrough(x) function that just calls the X case function in the switch table. There, done. Though this does not cater for XMRE case ranges. Case ranges are not normally a part of C like syntax. On the other hand, Lua tables can be indexed by any Lua type, so perhaps case ranges can be dealt with in some way. I'm not sure it's important enough to worry about for now, so leaving it off until someone wants it. Hopefully people will be to distracted by the fact they can use ANY type in case statements, and even mixed types, to miss case ranges. Actually, we could use the same mechanism we use for default, it just checks any case ranges that where registered in the switch table before calling default. That's just my quick and dirty idea, there are more here - http://lua-users.org/wiki/SwitchStatement

-

Constant is not really needed, as it's only there to support a limitation of the XMRE case statement. The above implementation has no such limitation, so we can leave it off.

-

There is break in Lua, but no continue. Continue can be done by a jump to a label anyway, though that's a Lua 5.2 addition, and there might be good reasons to not use Lua 5.2, especially since we are using LuaJIT. http://lua-users.org/lists/lua-l/2009-11/msg00061.html might help to explain why.

-

http://lua-users.org/wiki/ContinueProposa would be of interest.

-

 

-

arrays

-

Lua tables have similar functionality to XMRE arrays, but I think are more powerful. So might as well just use them.

-

LSL is statically typed, while Lua is dynamically typed. Which means we don't need to deal with the XMRE array type detection and conversion stuff. Everything is a first class value, and can be stored as table elements, or used as indexes, except the special value nil, which is similar to the XMRE value undef. XMRE arrays use lists for multi dimensional arrays, but Lua does not really have that concept. It's easy enough to store tables in tables though, so sparse matrices can be done. Lua has proper arrays, so long as you don't mind counting from 1, though I think I'll fix that. So for example, you might have a list, and since I'm converting that to a Lua table, you could use Lua table syntax with it -

-
myList[42] = "Life, the universe, and everything";
-llOwnerSay(myList[42]);
-myList[foo + bar] = 42;
-myOtherList["foo"] = myList;
-myOtherList[myList] = 42.0; // Using a Lua table as an index.
-
-
-

That last one is different from what it means in XMRE. XMRE uses lists as array indexes to support multi dimension arrays, Lua just uses it to index the single dimension table element that happens to have a table as the index.

-

Since they are Lua tables, we can do this sort of thing to -

-
myOtherList["myFunc"] = someFunction; // Yes, this is storing the function, not the return value of the function.
-myOtherList["myFunc"](x, y); // Calling the function we just stored.
-myOtherList.myFunc(x, y);  // Same as the last one.
-
-
-

That last one uses a Lua syntactic sugar short cut. It works for table indexes that are strings with no spaces in them. This sort of thing essentially comes for free, since my script engine converts to Lua before compiling that. People that know Lua already know all those fun things you can do with Lua tables, they are quite powerful.

-

Lua table initialisation is a little different, but the LSL parser can handle that -

-
a = {[f(1)] = g; "x", "y"; x = 1, f(x), [30] = 23; 45}
-
-
-

I'll leave it as an exercise for the reader to look up the Lua manual (which that example is taken from) to see what that line does. lol

-

OK, commas and semi colons in that line are interchangeable, they just separate array elements. [30] = 23 means that the table element with the index of 30 is assigned the value 23. x = 1 is shorthand for ["x"] = 1, the table element with the string index of "x" is assigned the value 1. [f(1)] = g means that what ever value that the function call f(1) returns is used as an index, it's value is assigned the value of the variable g (no matter what type it is). The rest don't include any index, so are assigned to sequentially numbered indexes starting from 1. Apart from being more powerful, the only real difference with LSL is the use of {} instead of [] to contain the list initialisers.

-

 

-

exception handling

-

The XMRE exception handling I could not do a clone of anyway, the system exceptions are not specified, except for the divide by zero, and even then I'm not so sure.

-

Lua has it's own sorta exception system, it can probably be bent into this sort of shape, but why bother? The alternative is to add stuff to the LSL parser to turn something like normal C++ / Java style exception handling into the Lua system. Not sure it's worth it, so not coming up with a proposal right now. Could be added later if people want it. http://lua-users.org/wiki/ErrorHandling might be of some interest.

-

 

-

event handling

-

Event stuff is basically - wait for an event in the middle of some function, save and restore the llDetect*() information for event nesting, call an event handler directly, and put an event you got from the first thing back on the event queue. Note, all LSL functions are called from event handlers, or are the event handlers themselves. Lists are used to store the llDetect*() info, and the events returned / put on the queue, as well as invoking the handler direct. I'm sure it's possible to fake these Lists.

-

The method I'll be using to represent LSL states in Lua (as tables with the event handlers stored as functions) already allows direct calling of event handlers anyway. The others are just direct access to the event queue, and to the source of the llDetect*() information so that we may molest them. Sticking the event queue in a table sounds feasible. It would be a good idea to have the llDetect*() stuff in a table with a metatable, where the various llDetect*() functions are functions provided by that metatable. Then they can just stash this table away safely while calling other event handlers direct, passing on a faked up table, or a copy of the original.

-
float timeout = 4.2;
-myEvents = events.wait(timeout, link_message, listen, touch_start);  // Functions are first class citizens, so just pass them to the wait function, which has variable arguments.
-myDetects = events.copyDetects();
-default.link_message(LINK_ROOT, 42, "So long, and thanks for all the fish.", llGetOwner());
-events.detects(myDetects);
-events.queue(myEvents);
-
-
-

Or something like that might be feasible.

-

XMRE can both wait for events, or have them called in the background, then continue waiting for the events it's waiting for. The above events.wait does not do that. We could pass two tables like this -

-
list waitEvents = [link_message, listen];
-list backgroundEvents = [touch_start, touch_end];
-myEvents = events.wait(timeout, waitEvents, backgroundEvents);
-
-
-

 

-

an example

-

This is the current result of compiling the MLP ~pos script (white space adjusted for better readability) -

-
--// Generated code goes here.
-
-local _bit = require("bit")
-local _LSL = require("LSL")
-
---[[integer]] MAX_BALLS = 6;
---[[integer]] ch = 0;
---[[integer]] swap = 0;
---[[integer]] BallCount = 0;
---[[string]] pr1 = "";
---[[string]] pr2 = "";
---[[integer]] Zoffset = 0;
---[[vector]] RefPos = _LSL.ZERO_VECTOR;
---[[rotation]] RefRot = _LSL.ZERO_ROTATION;
-.
-  
-function getRefPos()
-  RefPos=_LSL.llGetPos();
-  RefRot=_LSL.llGetRot();
-  Zoffset= _LSL.integerTypecast(_LSL.llGetObjectDesc());
-  RefPos.z --[[+=]] = RefPos.z +  --[[float]] Zoffset / 100.;
-end
-
---[[list]] Pdata = {};
-  
-function getPosNew( --[[string]] pdata)
-  Pdata = _LSL.llParseString2List(pdata, {" ", }, {});
-end
-  
-function setPos()
-  pr1 = --[[string]] ( --[[vector]] _LSL.llList2String(Pdata, 0) * RefRot + RefPos);
-  pr2 = --[[string]] ( --[[vector]] _LSL.llList2String(Pdata, 2) * RefRot + RefPos);
-  pr1 --[[+=]] = pr1 +  --[[string]] (_LSL.llEuler2Rot( --[[vector]] _LSL.llList2String(Pdata, 1) * _LSL.DEG_TO_RAD) * RefRot);
-  pr2 --[[+=]] = pr2 +  --[[string]] (_LSL.llEuler2Rot( --[[vector]] _LSL.llList2String(Pdata, 3) * _LSL.DEG_TO_RAD) * RefRot);
-  if (BallCount>1) then
-    _LSL.llSay(ch + swap, pr1);
-    _LSL.llSay(ch + not swap, pr2);
-  else
-    _LSL.llSay(ch, pr1);
-  end
-  local  --[[integer]] ix = 0;
-  local function _preIncrement_ix() ix = ix + 1;  return ix;  end
-  ix = 2;
-  while (ix<BallCount) do
-    _LSL.llSay(ch + ix,  --[[string]] ( --[[vector]] _LSL.llList2String(Pdata, 2 * ix) * RefRot + RefPos) ..  --[[string]] (_LSL.llEuler2Rot( --[[vector]] _LSL.llList2String(Pdata, 2 * ix + 1) * _LSL.DEG_TO_RAD) * RefRot));
-    _preIncrement_ix();
-  end
-end
-
-function getChan()
-  ch= _LSL.integerTypecast(("0x" .. _LSL.llGetSubString( --[[string]] _LSL.llGetKey(), -4, -1)));
-end.
-
---[[state]] _defaultState = {};.
-
-_defaultState.state_entry = function()
-  getRefPos();
-  getChan();
-end
-
-_defaultState.on_rez = function( --[[integer]] arg)
-  getRefPos();
-  getChan();
-end
-
-_defaultState.link_message = function( --[[integer]] from,  --[[integer]] num,  --[[string]] cmd,  --[[key]] pkey)
-  if (cmd == "PRIMTOUCH") then
-    return;
-  end
-  if (num == 1 and cmd == "STOP") then
-    swap = 0;
-    return;
-  end
-  if (num) then
-    return;
-  end
-  if (cmd == "POSE") then
-    local  --[[list]] parms=_LSL.llCSV2List( --[[string]] pkey);
-    BallCount=_LSL.llList2Integer(parms, 1);
-    return;
-  elseif (cmd == "POSEPOS") then
-    getPosNew( --[[string]] pkey);
-    setPos();
-  elseif (cmd == "SWAP") then
-    swap= _bit.band( _LSL.integerTypecast(( --[[string]] pkey)) , 1) ;
-    _LSL.llSay(ch + swap, pr1);
-    _LSL.llSay(ch + not swap, pr2);
-  elseif (cmd == "REPOS") then
-    getRefPos();
-  elseif (_LSL.llGetSubString(cmd, 0, 0) == "Z") then
-    local  --[[integer]] change = 0;
-    if (_LSL.llGetSubString(cmd, 1, 1) == "+") then
-      change = _LSL.integerTypecast(_LSL.llGetSubString(cmd, 2, 10)) ;
-    else
-      change = _LSL.integerTypecast(_LSL.llGetSubString(cmd, 1, 10)) ;
-    end
-    Zoffset --[[+=]] = Zoffset + change;
-    RefPos.z --[[+=]] = RefPos.z +  --[[float]] change / 100.;
-    setPos();
-    _LSL.llOwnerSay("Height Adjustment: change by " ..  --[[string]] change .. "cm, new offset: " ..  --[[string]] Zoffset .. "cm");
-    _LSL.llSetObjectDesc( --[[string]] Zoffset);
-  elseif (cmd == "GETREFPOS") then
-    _LSL.llMessageLinked(_LSL.LINK_THIS, 8,  --[[string]] RefPos,  --[[string]] RefRot);
-  end
-end.
-
-_LSL.stateChange(_defaultState)
-
---// End of generated code.
-
-
- -

Here's a wild idea - streaming source code. Start feeding the .lua files to the compiler when you start downloading it, so it compiles as it's downloading. Dunno yet if that would help, might just get stuck early on waiting for the entire file.

- -


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

- - diff --git a/docs/NGIW.Commands.html b/docs/NGIW.Commands.html deleted file mode 100644 index c058a6f..0000000 --- a/docs/NGIW.Commands.html +++ /dev/null @@ -1,46 +0,0 @@ - -NGIW.Commands - - - -

In a virtual world there are many places where an actor (either an avatar directed by a human, an avatar directed by a program (bot), or a scripted object) wants to do something to an object. Something other than just directly change a property of the object. The LSL programming model is that scripts react to events. So I propose we unify commands, LSL events and REST by manipulating even queues.

-

 

-

Proposal

-

If http://sim.ulat.or/obj/oid is the url to some object with id oid, and we have a http connection to http://sim.ulat.or then

- -

And maybe

- -

 

-

What a PUT really sends to the server

-

Supose we are telling the server about the avy touching an object. The actual text that gets sent might look like:

-
   PUT /obj/oid/eq HTTP/1.1
-   Host: sim.ulat.or
-   Content-Type: application/json
-   Content-Length: xxxx
-   
-   {"touch_start":{"force":13,"avy":"uuid","time":1311663233}}
-
-

So you can see it is fairly heavy weight compared to a tuned command language. I will investigate what subsequent requests look like when using the http 1.1 persistent connection features. At the worst the http overhead can be amortised across many commands by using the last two forms of request. The last would look like:

-
   PUT /eq HTTP/1.1
-   Host: sim.ulat.or
-   Content-Type: application/json
-   Content-Length: xxxx
-   
-   [{command1...},{command2...},...]
-
- - diff --git a/docs/NGIW.html b/docs/NGIW.html deleted file mode 100644 index 9d5c039..0000000 --- a/docs/NGIW.html +++ /dev/null @@ -1,50 +0,0 @@ - -NGIW - - - -

See also SledjHamr

-

Random thoughts about Next Generation Immersive Web, or whatever we call it.

-

Here I want to indicate a possible design direction. The buzzword compliant summary is HTTP 1.1, REST and JSON.

-

I don't want to descend into the actual messy details here, so I will make some simplifications. I will assume a simplified world where there are only two kinds of things, boxes and textures. Boxes have a position, a rotation, a size, and a single texture. The software architecture will be simplified to two elements of software, the simulator and the client.

-

Suppose the simulator is at http://simulat.or/sim01 .

-

Then, per usual REST design, to ask about box 104, the client would "GET /sim01/object/b104". Similar to opening http://simulat.or/sim01/object/b104 in a web browser.

-

The sample response might be

-
   {   "at":1000,
-       "id":"b104",
-       "p":[1,1,1],
-       "r":[0,0,0,0],
-       "s":[0.5,0.5,0.5],
-       "t":"/sim01/texture/t104" }
-
-

This is a really important data structure, it is the representation that forms part of the REST acronym. Since we are talking about a simulator, it isn't really complete to say an object has a certain position. In a simulator all properties of objects are dependant on time. The "at" field encodes some time representation. Probably something like Unix time * 1000, aka the number of milliseconds since 1970 UTC. The "id" field is the name of the object. The "p" field is the position encoded as a JSON array of 3 numbers, the "r" the rotation (quaternion) encoded as a JSON array of 4 numbers, the "s" the size encoded as a JSON array of 3 numbers, and "t" is the texture.

-

Since we are talking to a web server, and since we want to sometimes reference textures from other places than the simulator, the value of the texture is a URL. In this case a relative URL that leaves out the server, thus meaning the full URL to the texture is "http://simulat.or/sim01/texture/t104". If the client needs the texture it can do a GET of "http://simulat.or/sim01/texture/t104". There are ways to further compress this information, but let's not fix what isn't broken.

-

Supose the user moved the box up 1 meter by some manipulation of the client. The client would "PUT /sim01/object/b104" with the data

-
   {   "at":1001,
-       "id":"b104",
-       "p":[1,1,2],
-       "r":[0,0,0,0],
-       "s":[0.5,0.5,0.5],
-       "t":"/sim01/texture/t104" }
-
-

Always transfering the full representation of an object could be wasteful and error prone so I slightly bend REST. I will use POST to an object to transmit only the changed fields. So "POST /sim01/object/b104" with the data

-
   {   "at":1001,
-       "id":"b104",
-       "p":[1,1,2]  }
-
-

would cause the same change in the simulator state.

-

To get the current state of the world "GET /sim01/object" would reply with all the objects. In this case it would be a JSON array of JSON objects similar to the first example above:

-
   [   {"at":999,"id":...}, {"at":999,...} ... ]
-
-

But, look what happens when we understand that the reply is using chunked encoding. The simulator might not actually ever finish sending the state of the world. The client might get

-
   [   {"at":999,"id":...}, {"at":999,...},
-
-

in the first chunk, and more

-
   {"at":1000,...}, {"at":1001,...}, ...
-
-

in the second chunk. And so forth. Again, sending all the fields of all the objects, even for just the changed objects is wasteful. I see a few ways to go.

-

If the server knows it has sent a full description of an object to a client, then future updates would, like the POST, only include the changed parts of the object.

-

Alternatively, lowering the load on the server, the client closes the "GET /sim01/object" connection at some point, and does "GET /sim01/object?delta". At that point only updates are ever sent. If the client sees a change to some object it doesn't recognise, is opens a second connection and requests "GET /sim01/object/b999" for example to get the full description.

-

The third alternative is that all the server ever sends in response to "GET /sim01/object" is a stream of changes. If the client doesn't have enough information to render an object, it can query the individual object as in the first example.

- - diff --git a/docs/Nails.html b/docs/Nails.html deleted file mode 100644 index 4eca750..0000000 --- a/docs/Nails.html +++ /dev/null @@ -1,2519 +0,0 @@ - -Nails - - - -

Putting it all together

-

This is where onefang starts to get his hands dirty, though I'll mostly be talking about the modules of the basic architecture that deals with the objects in the world. Most everything else could be dealt with as mostly stand alone pre existing software (jabber, mumble, etc), though some of those would still need to get their hands on some of the data.

-

In this part I'll use the term "client" to refer to anything thing talking to a server, even if it's another server. "Viewer" means the users client that they use to interact with the virtual worlds. "Virtual world" is any group of sims linked together, the equivalent of a 3d web site in this web centric model of virtual worlds. "Sim" is the equivalent of a web page. "Engine" will be any server module that deals with a particular active function. "Object" could be link sets, prims, mesh objects, avatars, the sim itself, or perhaps other things that are tracked per sim. "Data" is any property of an object in the sim that can be sent in a single command, which might consist of several values. "Value" is a single basic property of an object, though it could be a vector, rotation, URL, or other complex data type. "Command" is a something sent from one module to another stating that some data has changed on some object. An example command might be something like "command=value,value,<1.2.3>,"string". "Assets" are any non object thingy that might be part of an object, like textures, scripts, etc. Not so sure if there should be that distinction between object and asset though. Though assets generally don't change, or have "data".

-

The various modules could pretty much be written in any language, it's the protocols between them that is important. Even then, the form of the protocols should be somewhat flexible as well. I'll insist on the central form of the protocols to be tight binary, but lots of people have a co-dependent relationship with abusive things like XML. Slightly saner people might prefer JSON, perhaps BSON, or plain name=value pairs. And just coz everyone else gets to have their favourite bloated human readable text format, I'll add my own MTRX from years ago. I'll be writing my version of the modules in C, with threats of assembler. Others could write things in scheme, smalltalk, PHP, ruby, C#, javascript, or any other less efficient language.

-

The basic modules would be the viewer, the script engine, the physics engine, the sim data store, the inventory data store, and the command pump. Since this is a web centric design, there are web servers involved to. There can be any number of each of these modules, perhaps even a changing number on any given sim, for load balancing or redundancy reasons.

-

 

-

command pump

-

Quite literally, this would be the heart of the system. It's job is to manage the exchange of changes to in world objects between everything else. These changes are always expressed as commands. More about this later.

-

 

-

inventory data store (we should call this "hammerspace")

-

Stores part of a users inventory, and serves it to sim data stores, or other users inventory data stores. This could probably be just a web server, it's protocol would be ordinary HTTP/S sending files around. Generally the files would be protected, only being sent to those that are authorised to get any individual file. The inventory's owner would have complete control. It's two main tasks are to send individual objects to sim data stores, and to send individual objects, or entire folders of objects, to other users inventory stores. All of this is initiated by the owner manually. Some method for the user to manage their inventory objects would be needed, but the world is already full of ways to manage web server contents, so don't need to mention them further. Though perhaps using WebDav as a standard method would be a great idea. It may even be possible for multiple users to manage any given inventory data store, say via a typical CMS system. Public inventory data stores could exist. Shops could just be an ecommerce front end to an inventory data store. It's a web server, any webby thing could be done with it. Objects should be sent as individual files for the purposes of HTTP, though they could be collected and compressed into some archive format when sending lots of them. Folders should be represented directly as paths in the URL.

-

It's entirely up to the web server how it actually stores the objects. I would recommend just storing the commands that define an object, but there will be things like IARs with XML files, exports from other viewers, and such around. Storing just the commands means that they can just be dumped direct to the command pump. XML would have to be translated first. On the other hand, inventories store non object assets, like textures, sound samples, scripts, etc. These could be stored in their native formats.

-

 

-

sim data store

-

Stores objects and their data that are in the sim. Again, it's a web server, but completely public. Though just like ordinary web servers, parts could be private to members only. Most of what was said about inventory data stores applies. There is a change of emphasis though, these would be public in general, with privacy an option, where inventory is private in general, with public being an option. Note that objects and other assets that are contents of a sim object should not be public by default, perhaps they could be handled by inventory data stores. Inventory data stores could be very simple data stores, with authorisation, so would be perfect to be used as data stores for objects contents. Lets us reuse code and protocols, and can share code on the same server.

-

A sim data store could be a web proxy in front of any user in that sim. This is for any inventory data store an the users own computer, so that they can hide behind that sims proxy. Perhaps this could be another module? Not sure how to handle inventory transfers to offline users, especially those without some other web server to have an inventory data store on. Likely users will be a member of at least one web site somewhere that offers inventory data stores.

-

 

-

physics engine

-

Calculates physics interactions between objects in a sim. Does not have to handle all the objects on a sim, but the sim can be partitioned up, probably via some load balancing scheme. Physics is calculated on a frame per frame basis, though the "frame rate" might not have any bearing on the viewer graphics frame rate. It should however be close to human visual frame rate.

-

 

-

script engine

-

Runs scripts, either those in objects in a sim, or those in a users viewer. Does not have to handle all the scripts, but could be load balanced. Viewer scripts would be things like attachments or HUDs, and might run in the viewer. Scripts might set up sensor timers to scan nearby objects, or request specific data from random objects at random times. They also would be interested in specific events, perhaps physics or user interaction events, perhaps others. Scripts can also send arbitrary commands to do their work. Script engines can be identical, whether on servers or viewers.

-

Since sims can have one or more script engines, script engines could service one or more sims, and viewer scripts could be run in the viewer or a specific script engine the user is allowed to use...we can do away with the need to save script state, and load it again on the next sim when avatars move from one sim to the next. That's one of the major time consuming parts of a TP on your average script heavy avatar.

-

 

-

viewer

-

Brings it all together as a rich virtual world for the user. It operates in graphics frames, having to pull everything together from the various sources, and generate all the pixels for the next frame at hopefully human visual rates. It also has to let the user do whatever it is that they want to do in the sim. Some things can happen at a more leisurely rate, like transferring files. People are used to large graphic files rezzing a bit at a time, even in the 2D web for instance.

-

 

-

command pump

-

A command pump has to accept object change commands from the other modules, and make sure that all modules get the data that they need in the form of commands. All the other modules are clients of the command pump. It really has to be as efficient as possible in both network usage and internal processing. It's debatable whether or not it should pre filter data to the other modules or just throw everything at them and let the modules ignore stuff they don't need. I'll err on the filtered data stream side, to keep bandwidth down. It could be a CPU+RAM versus bandwidth trade off. Certainly there should be nothing that prevents that trade off going either way. The other modules SHOULD ignore commands they don't understand. General rule of software engineering - be careful with what you send, be tolerant of what you receive. On the other hand, initial implementations are likely to start simple, just naive with no filters.

-

Data in the form of commands to change object state for particular objects is thrown at the command pump at random by other modules. Some may be slow (human interaction speeds from viewers), some maybe fast (bullets and debris whizzing around from the physics engine). All relevant object state changes should be sent to all other modules, perhaps with a complete resync every once in a while as needed just to be sure. We are not really worried about any lost update problems, if two or more modules are trying to change the same object data, the last one wins.

-

Timing is also a concern. Data changes sent to the viewer for instance should not include many changes to the same object data per frame, only the last one sent is important to the viewer. Same for the physics engine. Scripts generally set their own time for when they want to know about external changes, but likely want to know about changes to the object they are in when they happen, or when they ask.

-

So, the command pump has to understand at least a little about what the command language is. For clients that run at some sort of frame rate, the pump should delete commands when a new one for the same data arrives, so that it sends only one change per data each "frame". It should also delete old commands from previous frames if it detects that the client has moved on without getting all the commands for those frames. Clients could request that they are only interested in specific commands. On the other hand, the pump does not need to know what the data represents, or even what the commands mean. It just stores and forwards, with some arbitrary filtering as requested by each client. So it needs to know which part of each command is the command verb, and which object the command refers to. The command pump also needs to understand which clients have a frame rate, but that could be handled by clients sending filter requests. Filtering entire objects should be possible to, based on what objects the client says it's interested in.

-

So basically, it manages FIFO queues of commands, one per client. Filtering out any command type the client requests, filtering for objects of interest, or filtering object data on a frame rate basis per object. Every now and then, it has to sync the sim data store as well, so that the sim state is persistent across restarts, and clients can just download complete objects from the store when they first need them. Phew.

-

A good optimisation would be for the sim data store and command pump to be the same module. The pump has to keep the current state of objects in memory anyway, and knows how to pump the command data out, all it needs is a persistent backing store to write to and read at start up.

-

As an optional wrapper around the command pump, could be translators for those that want REST, JSON, XMLRPC, or other bloat. With commands to switch to and from these and the native binary protocol. Native binary protocol must always be supported, and always be the default until requested otherwise. 99.9999% of Internet traffic does not NEED to be human readable on the wire, human readable is not so easy for computers to read, they need to translate it. Why slow everyone down? I will insist that these protocol translators operate outside the command pump, don't want to slow that down to satisfy peoples longing for bloat. They should be separate processes, preferably operating on separate cores, or even entirely different computers. They will naturally talk the tight binary protocol to the command pump, just like every one else.

-

There are three basic Internet protocols we could use as the basis for the wire traffic. TCP, UDP, and SCTP. SCTP would be a great candidate, except for the lack of MacOS support. I think we should try SCTP, with TCP as backup, SCTP support might come to Mac sooner or later.

-

 

-

command channels and language

-

In other parts of this document, a command channel is mentioned. Most of the data flowing through this command channel would be for setting or changing prim parameters. I propose a binary format based on llSetLinkPrimitiveParams() http://lslwiki.net/lslwiki/wakka.php?wakka=llSetLinkPrimitiveParams&show_comments=1#comments

-

A command list would usually start with a command stating which link number of which linkset the following commands will change. This command can be sent at any time. The link number can be one of the special link numbers. Then a series of prim parameter commands, also in binary. Each prim parameter command starts with a 32 bit integer parameter type, and then follows the actual parameters. Since each parameter type has a fixed format for it's arguments, no need to specify types. All arguments except strings are fixed width, so strings should be moved to the end of the argument list, zero terminated, and UTF-8. In general, there is only a single string for any command that includes a string, but it could be possible to have any number of zero terminated strings in order. Everything should be sent in network order.

-

There is naturally some room to define more commands. For instance, a delay before executing the next command, a command to stop this one and start a new one with a different link number, or one to set something other than a prim parameter (a land parameter for instance). We could add a command - "JSON" which means "I'm a fucking human, talk to me in something that looks vaguely like English" until the end of the session. Or a few such commands for a few different formats. BSON, BNRY to change back to the default binary mode, and EWWW to change to the XML mode used by OAR files, MTRX for something like my matrix-RAD wire protocol.

-

The command language should be binary.The objects current state is stored as the currently active list of commands for each object. An object in this case would be a prim, mesh, linkset, the sim itself, terrain, or avatars.

-

 

-

propagating language changes

-

In order to support a changing language as things develop, we could use an initial handshake between clients, servers, and engines (acting as clients to the sim data server) that could exist in these several variations. In the following, the variations are numbered for later discussion. The first word on the line is who is sending the data, indented lines then go into the extra detail that is being sent. The client sends first, as it's always the one to start the connection. The word "checksum" means that a checksum of some standard representation of the language known by that computer is sent. The word "signed" means that the language representation is signed in some manner to show it came from some authority.

-
    -
  1. client -> I speak Version 1 checksum
    server -> I speak Version 1 checksum
  2. -
  3. client -> I speak Version 1 checksum
    server -> I speak Version 2 checksum signed
    Version 2 is -
    A=int,int,float
    B=vector,string
    client -> I speak Version 2 checksum
    server -> I speak Version 2 checksum
  4. -
  5. client I speak Version 1 checksum +
    which adds -
    C=rotation,int
    D=string,float,vector
    server I speak Version 1 checksum + (only to this client)
  6. -
  7. client I speak Version 2 checksum
    server I speak Version 2 checksum (which is different) signed
    Version 2 really is -
    A=int,int,float
    B=vector,string
    client I speak Version 2 checksum
    server I speak Version 2 checksum
  8. -
  9. client I speak Version 2 checksum
    server I speak Version 1 checksum
    client I speak Version 2 checksum signed
    Version 2 is -
    A=int,int,float
    B=vector,string
    server I speak Version 2 checksum
  10. -
  11. client I speak Version 1 checksum
    server I speak Version 1 checksum +
    which adds -
    C=rotation,int
    D=string,float,vector
    client I speak Version 1 checksum + (only to this server)
  12. -
-

1) all is good, hopefully the usual thing.

-

2) and 4) are subject to evil servers screwing things up. 5) is subject to to evil clients. Should think of ways to protect from that. GPG signed from a trusted source? Web of trust needed.

-

3) server only uses that version of the language for talking to that client.

-

5) a way to push up an official new protocol version.

-

6) is pathological, but might happen during development. On the other hand, the extra data might be useless, as the client does not know what to do with it.

-

Sim data server to sim data server changes could happen between servers that have some sort of arrangement between them. Like neighbouring sims, or servers run by the same person. The first server is then client, and contacts the other server as normal. Otherwise, language updates are going to be slow getting around. Physics engines would likely only need to know the new languages when they know how to deal with the new data types. Script engines could benefit from command languages if their scripts know how to deal with the new data types.

-

1) 2) 4) 5) both ends just use the same language.

-

3) 6) Store the extra things as name/value pairs, send them back as name/value pairs. The "store" part could be a DOS attack to soak up storage space. However, there should be restrictions on who can change things on any given sim data server, so that will help. Should also send any name/value pairs to other clients/servers that register identical pair formats? Would be useful for development of the next version of the language. Note there could be name clashes, so include the data types for each name/value pair when deciding to send it.

-

 

-

Command language

-

llSetPrimitiveParams() is the model I want to follow.

-

For the binary protocol, we will try to pack things up as much as possible. A lot of the integers don't need to be full 32 bit integers. Some of the vectors can be just small integers instead of floats. etc.

-

Yes, I am trying to micro optimise this part before actual implementation. So I'll go over my assumptions, use cases, and other design decisions here for reference.

-

I want the command language itself to use as little bandwidth as possible. I think the on disk storage should just be this tight little command language. I want the code that deals with this command language to be simple. If there has to be any trade offs, the code can be more complicated if it keeps the command language tight. The reasons for these things is scalability. While the distributed nature of this design means that we are generally only concerned with sim level scalability. We do want to support huge sims with large numbers of users. The command pump code could be used for both servers and clients. Flinging the basic data about, and storing it, is something I want to be efficient as possible from the very beginning. Folks, that means PACKED BINARY dammit. Cringe now and get it over with.

-

Those people that want to use less efficient and more human readable data formats do get to eat their cake by the use of protocol translators. These should NOT be part of the same process as the inner pump, in order to not have them slow down this inner pump. I see these uses of other data formats as being the exception rather than the rule. That's one of my big assumptions. If you want to avoid bloat and lag, use this tight packed binary, but feel free to filter it through a protocol translator for debugging purposes. Just don't ever get in the way of those wanting things to be efficient.

-

The command language will not deal with large binary blob assets directly, things like actual textures, sounds, animations. Instead it will simply deal with pointers to these assets. These pointers might be UUIDs, or names. I want to extend that to include URLs and SHA-1 sums as data pointers (content addressable blobs).

-

The main use cases are those basic modules I have identified above - command pump, inventory and sim data stores, physics and script engines, and the viewer. Each of these modules will have an internal representation of each object of interest.

-

The data stores want to know which object the commands are for so they can store each object separately. They also only want the latest data for each object. They store each object on disk somewhere, but possible have those objects memory mapped and update them as commands come in.

-

The engines want to filter out only the data they need for their work. For the script engine, this filter might be different for each script. The script itself has internal state that would need to be persisted during sim shutdowns, or transfer to inventory.

-

The viewer wants all the data, though probably would be happy to just drop old data if it's too late to render it and newer data is already here. It will have internal representations of objects of interest, but may cache them.

-

The command language is mostly concerned with changing in world properties. In general these are split into prim (object), sim, avatar, animation, and environment (windlight/lightshare) properties.

-

Prims (objects) are the basic building blocks of the world. Originally prims where general 3D primitives, where the idea is that you can build more complex shapes with simple primitives, and the data to describe those primitives is much less that defining each triangle. Since then sculpties have been added, where the triangles are defined as an array of points encoded into and RGB texture, and the triangles have a fixed mapping. Very recently, arbitrary meshes have been introduced, since sculpties had restrictions. Still, the data for the sculpty and mesh triangles and such are treated as blobs of opaque binary data, with pointers to them (and some flags) being the only data dealt with at the prim level. That still works for me. B-)

-

Prim properties can change quickly, by the physics engine, scripts, or users editing them in world in real time.

-

Sim properties in general don't change fast. No point updating the land music URL many times a second, or even many times a minute. Perhaps someone might want to update the terrain or terrain texture quickly, but current viewers are very slow to track those changes anyway. Perhaps in the future we might want to allow piping video into the terrain to simulate an earthquake, but that would still be represented as just attaching one video stream to the terrain heightfield. So in general I think we can treat sim property changes as slow moving.

-

Avatars currently consume the most resources, which is why you can have thousands of prims in an existing SL style sim, but only dozens of avatars. They move around a lot, animate, change clothes, and wear prims. Prims are covered above, animations below, movement might be covered by treating avatars as a prim type. That leaves clothes. In the end, clothes is treated just like a texture change, and is not usually done quickly.

-

Animations are currently really only applied to avatars. They are references to animation assets (BVH files), where the asset is downloaded as needed, perhaps cached, and usually triggered by scripts. These tend to be slow changes (updating which animation asset is in use right now), but scaled up by the number of avatars in the sim at any given time. AO animations may change quicker as people move about.

-

On the other hand, we are extending animations to prim objects, and thinking about in world editing of them, plus allowing ad hoc "animations" via puppeteer style controls. So we need to keep these things in mind.

-

The environment is not changed quickly.

-

So, in the end, looks like prim property changes (including avatars as prims) are the heavy users. This is my next big assumption. There should be lots of commands for dealing with individual prim properties, as opposed to say sim commands where we can pack a bunch of properties into a single command. This is the reason why I'm starting with llSetPrimitiveParams() as my model for the command language. Perhaps a hamming code might work well?

-

After looking at things from the perspective of the above thoughts, there are very few commands that do NOT have a fixed set of parameters. These are generally those with string parameters. Most of those strings are asset pointers, often UUIDs, though some are just arbitrarily long bits of text that are just displayed as is. So I want to leave command lengths out of the basic command language (though know about them internally), but we do have to deal with some variable length commands. We could have three different versions of those commands that deal with asset pointers, UUID and SHA-1 being fixed length commands, name and URL being variable length (name treated as a relative to current sim URL).

-

So a first hack at this that keeps things nice and simple is 8 bit commands, with fixed length parameters for each command. Using a 256 entry table that includes that fixed length, and details of the types of parameters. Perhaps we can use a special value for the length in that table that means "variable length, you might have to actually scan and think about the command data to find it's end", but otherwise just use the fixed length for doing things like skipping to the next command, or copying this command somewhere. I assume that any single command will not be very long. Given that keeping the command data smaller is more important than keeping the code simple, I lean towards the C string style rather than the Pascal string style. In other words, a NULL end of string token instead of a couple of bytes of string length.

-

The other issues to deal with are when and how to do the filtering; and how to handle "old" data.

-

The first level of filtering would be per object. Physics engines are only interested in physics enabled objects (including avatars some of the time). Viewers are only interested in objects within draw distance. Script engines would initially only be interested in the objects with scripts in them, but maybe interested in other objects they are scanning or whatever.

-

The physics and script engines really want to spend most of their resources actually calculating physics and executing scripts. So it might be worthwhile filtering the commands we send to them. Physics is easy, it wants only a few bits of prim data that is well known ahead of time.

-

Scripts are harder, any given script at any given moment, might only be interested in a small subset of info about a prim, or the sim, etc. There are two categories - query a parameter right now, or trigger events based on parameter changes. Note that LSL at the moment treats some "ask for parameter" async, they send the request, then setup an event to get the results.

-

I think all modules only want current data. The world exists only in real time. Some general method for just dropping commands that are too old needs to be included. "Too old" means that some new command arrived that replaces that old commands data, but before that old command has been dealt with. This might be made more complicated by the existence of command variations where some of the data is encoded in the command byte for the current proposed implementation.

-

 

-

Prim commands.

-

There are seven commands not allocated in the middle, and two near the end, no doubt we could use those for the missing commands. These are the commands not currently accounted for in the command language -

-

llSetPrimMediaParams(face, list)

-

Can probably combine most of these. Width and height SHOULD be combined per the LL specs.

- -

llParticleSystem(list)

-

These could be combined a bit, some of them should be.

- -


llCreateLink(key boolean)

-

llSetTextureAnim(integer:7 face integer integer float float float)

-

Stuff to do with the playing of sound clips.

-

 

-

Parcel commands.

-

There is no need for parcels really, they are just a way of managing a fixed sized sim. We use arbitrary sized sims with little or no boundaries. So "parcels" can just be a bunch of smaller sims arranged in what ever way makes them more manageable by the sim owners. I would even suggest that sky boxes be just another sim, but with a high vertical offset from the land sims.

-

 

-

Sim commands.

-

Note that terrain and water could be dealt with by prim commands, treating them as heightfield meshes. This assumes that parcels are just specialised sims.

-

A sim has the following properties, which will need commands to change them -

-

Name, description, owner, group.

-

Rating - LL introduced the concept of maturity ratings, but the web has various other ways of dealing with that, with no standard system across the board. We could just say "let the web server owner figure out their own system", though still have the option of supporting LL style maturity ratings.

-

Land sales and deeding are possibly meaningless in this case, but we can always support the legacy LL method. Note that some of the legacy LL stuff makes no sense outside of LL type grids.

-

Autoreturn setting. Edit terrain and fly permissions, as well as object create, entry, and script running permissions for the land group, and for others. That's a nice set of 8 bits. B-)

-

Creating landmarks permission is similar to creating bookmarks. Not really something that is done on the web, and we are opening this up to web style access systems, so we don't really need that.

-

No damage is irrelevant really, if they want combat on their sims, they can provide a proper combat system. No pushing is likely similar.

-

Showing places in search is really now up to the search engines to cope with this new form of data.

-

A snapshot is good. Teleport landing spot and routing should have more options, but we can start with just supporting the usual LL stuff.

-

Audio and media are now handled differently anyway.

-

Access is now controlled by the usual web methods.

-

Allowing land resale and joining / sub dividing is no longer relevant. Telehubs are no longer relevant. Object bonus, and minimum agent age are not relevant. Agent limit might be relevant, but should be taken care of by usual web access systems.

-

Will still need to send broadcast messages to people in sims.

-

Restarting sims, disabling scripts, collisions, and physics.

-

Four terrain textures, and the four pairs of elevation ranges (one per corner) should still be supported, but we should also support just setting a fixed texture, or even several.

-

Water height, but also allow water heightfield. Terrain raise and lower limits not needed. Terrain heightfield and editing. Baking terrain. Don't really need stuff specific to backing up heightfields, they just become one more texture file on the web server.

-

Sim sun stuff should be handled by the windlight commands.

-

Allowing voice chat becomes a matter of whether the sim owner bothered to set that up.

-

Allow direct teleport is now part of access controls.

-

Covenant is just the sites ToS.

-

Should be able to kick people, and return their stuff. Though that's more content management, which we can leave to CMS style systems. Most everything else is content management, or admin stuff best left to other tools.

-

Create and delete an object. Moving and editing them is up to the prim commands. Though it should be pointed out, the position and rotation of root prims are a property of the sim rather than of the prim or linkset itself.

-

 

-

Windlight commands.

-

 

-

Avatar commands.

-

Some of this could be dealt with by treating the avatar as a prim. In fact, Alice's proposed animation system deals with animating avatars and prims the same way.

-

 

-

Animation commands.

-

Alice is working on that over at the BVJ page.

-

 

-

Meta commands.

-

0 SELECT_OBJECT key

-

There will be a bunch of four byte commands, they all switch up to less efficient command representations, so they can afford to be more verbose. B-)

-

They all are actually one byte commands, with the extra three bytes just being verbose padding for the humans. Let's hope there are no conflicts with other commands, otherwise the other command will just have to move.

- -

Note that a key in SL is a 32 hex digit string (128 bits, or 16 bytes), with four dashes added to make it 36 characters long. We probably don't need that much uniqueness within a sim, or even within a host full of sims. Two bytes gives us 65,536 unique objects, three bytes 16,777,216, and four bytes 4,294,967,296 objects. The maximum number of prims on a 256x256 SL sim is 15,000, and the maximum number of avatars is 100. So two bytes seems like plenty.

-

I would suggest using SHA-1 hashes of fixed blobs like textures and sounds, in the same way that git uses them for content addressable storage. SHA-1 is 160 bits (20 bytes), but as git has shown, if there are a small number of objects, you can get away with using just the first few digits. The advantage here is that multiple copies of the same texture end up with the same SHA-1, and thus we only store one copy.

-

Since we are using the format used by LSL prim parameter setting as the guide, after looking at it, I think we can do something like this...

-

A command is one byte, letting us have 256 commands. The very first command is 0 - select what object the next commands will work on.

-

The prim parameters take up the next 32 commands, but that only needs 5 bits. Some of those prim parameters include an integer, or even boolean, that could only need 3 bits. PRIM_TYPE in particular could encode the type itself into those extra 3 bits, making a total of 8 commands, and making it easy to fit the different sets of parameters into a table. PRIM_TYPE_LEGACY becomes 6 commands; PRIM_MATERIAL 8; PRIM_PHYSICS, _TEMP_ON_REZ, _PHANTOM, _FULLBRIGHT, _FLEXIBLE, _POINT_LIGHT, _CAST_SHADOWS, _TEXGEN 2 each; PRIM_TYPE 8; PRIM_BUMP_SHINY could be 4 with the shiny part in the command number. The other 10 add to make a total of 52. 103 commands left for the other commands, I think that might work.

-

 

-

The big arsed command table

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
decimalhexbinaryASCIIcommandargumentscomments
0000000 0000NULLSELECTkeyNext commands refer to this object.
1010000 0001SOHPRIM_TYPE_LEGACY BOXvector float float vector vector 
2020000 0010STXPRIM_MATERIAL (STONE)integer:3OK, the cleanest way to deal with this conflicting with the BSON commands is to have it as just one command. sigh
3030000 0011ETXPRIM_PHYSICS off  
4040000 0100EOTPRIM_TEMP_ON_REZ off  
5050000 0101ENQPRIM_PHANTOM off  
6060000 0110ACKPRIM_POSITIONvector 
7070000 0111BELPRIM_SIZEvector 
8080000 1000BSPRIM_ROTATIONrotation 
9090000 1001TABPRIM_TYPE BOXinteger:2 vector float vector vector vector 
100A0000 1010LF   
110B0000 1011VT   
120C0000 1100FF   
130D0000 1101CR   
140E0000 1110SO   
150F0000 1111SI   
16100001 0000DLE   
17110001 0001DC1PRIM_TEXTUREface string/key vector vector float 
18120001 0010DC2PRIM_COLOURface (vector float)=colour 
19130001 0011DC3PRIM_BUMP_SHINY PRIM_SHINY_NONEface integer:5 
20140001 0100DC4PRIM_FULLBRIGHT offface 
21150001 0101NAKPRIM_FLEXIBLE off  
22160001 0110SYNPRIM_TEXGEN PRIM_TEXGEN_DEFAULTface 
23170001 0111ETBPRIM_POINT_LIGHT off  
24180001 1000CANPRIM_CAST_SHADOWS off  
25190001 1001EMPRIM_GLOWface float 
261A0001 1010SUBPRIM_TEXTstring (vector float)=colour 
271B0001 1011ESCPRIM_NAMEstring 
281C0001 1100FSPRIM_DESCstring 
291D0001 1101GSPRIM_ROT_LOCALrotation 
301E0001 1110RSPRIM_POS_LOCALvectorThis is just my guess about where LL will put it.
311F0001 1111US   
32200010 0000SPACEPRIM_OMEGAvector float float 
33210010 0001 !PRIM_TYPE_LEGACY CYLINDERvector float float vector vector 
34220010 0010"(PRIM_MATERIAL METAL)  
35230010 0011#   
36240010 0100$   
37250010 0101 %   
38260010 0110&   
39270010 0111'   
40280010 1000(   
41290010 1001)PRIM_TYPE CYLINDERinteger:2 vector float vector vector vector 
422A0010 1010*   
432B0010 1011+   
442C0010 1100,   
452D0010 1101-   
462E0010 1110.   
472F0010 1111/   
48300011 00000   
49310011 00011   
50320011 00102   
51330011 00113   
52340011 01004   
53350011 01015   
54360011 01106   
55370011 01117   
56380011 10008   
57390011 10019   
583A0011 1010 :   
593B0011 1011 ;   
603C0011 1100<   
613D0011 1101=   
623E0011 1110>   
633F0011 1111 ?   
64400100 0000@   
65410100 0001APRIM_TYPE_LEGACY PRISMvector float float vector vector 
66420100 0010BBSON Switch to BSON mode. (Conflicts with PRIM_MATERIAL GLASS)
67430100 0011C   
68440100 0100D   
69450100 0101EEWWW Switch to XML mode, as used by OpenSim in IAR and OAR backup files.
70460100 0110FFUCK Switch to two, four byte command mode; with three, four bytes of object ID.
71470100 0111G   
72480100 1000H   
73490100 1001IPRIM_TYPE PRISMinteger:2 vector float vector vector vector 
744A0100 1010JJSON Switch to JSON mode.
754B0100 1011K   
764C0100 1100L LUA  Switch to Lua mode.
774D0100 1101MMRTX Switch to matrix-RAD mode.
784E0100 1110N   
794F0100 1111O   
80500101 0000P   
81510101 0001Q   
82520101 0010R   
83530101 0011SPRIM_BUMP_SHINY PRIM_SHINY_LOWface integer:5 
84540101 0100TTITE Switch back to the tight binary mode that is the sane default. B-)
85550101 0101U   
86560101 0110V   
87570101 0111W   
88580101 1000X   
89590101 1001Y   
905A0101 1010Z   
915B0101 1011[   
925C0101 1100\   
935D0101 1101]   
945E0101 1110^   
955F0101 1111_   
96600110 0000`   
97610110 0001aPRIM_TYPE_LEGACY SPHEREvector float vector 
98620110 0010bbson Switch to BSON mode. (Conflicts with PRIM_MATERIAL WOOD)
99630110 0011c   
100640110 0100d   
101650110 0101eewww Switch to XML mode, as used by OpenSim in IAR and OAR backup files.
102660110 0110ffuck Switch to two, four byte command mode; with three, four bytes of object ID.
103670110 0111g   
104680110 1000h   
105690110 1001iPRIM_TYPE SPHEREinteger:2 vector float vector vector 
1066A0110 1010jjson Switch to JSON mode.
1076B0110 1011k   
1086C0110 1100l lua  Switch to Lua mode.
1096D0110 1101mmrtx Switch to matrix-RAD mode.
1106E0110 1110n   
1116F0110 1111o   
112700111 0000p   
113710111 0001q   
114720111 0010r   
115730111 0011s   
116740111 0100ttite Switch back to the tight binary mode that is the sane default. B-)
117750111 0101u   
118760111 0110v   
119770111 0111w   
120780111 1000x   
121790111 1001y   
1227A0111 1010z   
1237B0111 1011{   
1247C0111 1100|   
1257D0111 1101}   
1267E0111 1110~   
1277F0111 1111DEL   
128801000 0000   
129811000 0001PRIM_TYPE_LEGACY TORUSvector float float float vector vector 
130821000 0010(PRIM_MATERIAL FLESH)  
131831000 0011ƒPRIM_PHYSICS on  
132841000 0100PRIM_TEMP_ON_REZ on  
133851000 0101PRIM_PHANTOM on  
134861000 0110PRIM_TEXGEN PRIM_TEXGEN_PLANARface 
135871000 0111   
136881000 1000ˆ   
137891000 1001PRIM_TYPE TORUSinteger:2 vector float vector vector vector vector vector float float float 
1388A1000 1010Š   
1398B1000 1011   
1408C1000 1100Œ   
1418D1000 1101   
1428E1000 1110Ž   
1438F1000 1111   
144901001 0000   
145911001 0001   
146921001 0010   
147931001 0011PRIM_BUMP_SHINY PRIM_SHINY_MEDIUMface integer:5 
148941001 0100PRIM_FULLBRIGHT onface 
149951001 0101PRIM_FLEXIBLE oninteger float float float float vector 
150961001 0110   
151971001 0111 PRIM_POINT_LIGHT on(vector)=colour float float float 
152981001 1000 PRIM_CAST_SHADOWS on  
153991001 1001    
1549A1001 1010    
1559B1001 1011    
1569C1001 1100    
1579D1001 1101    
1589E1001 1110    
1599F1001 1111    
160A01010 0000    
161A11010 0001 PRIM_TYPE_LEGACY TUBEvector float float float 
162A21010 0010 (PRIM_MATERIAL PLASTIC)  
163A31010 0011    
164A41010 0100    
165A51010 0101    
166A61010 0110    
167A71010 0111    
168A81010 1000    
169A91010 1001 PRIM_TYPE TUBEinteger:2 vector float vector vector vector vector vector float float float 
170AA1010 1010    
171AB1010 1011    
172AC1010 1100    
173AD1010 1101    
174AE1010 1110    
175AF1010 1111    
176B01011 0000    
177B11011 0001    
178B21011 0010    
179B31011 0011    
180B41011 0100    
181B51011 0101    
182B61011 0110    
183B71011 0111    
184B81011 1000    
185B91011 1001    
186BA1011 1010    
187BB1011 1011    
188BC1011 1100    
189BD1011 1101    
190BE1011 1110    
191BF1011 1111    
192C01100 0000    
193C11100 0001    
194C21100 0010 (PRIM_MATERIAL RUBBER)  
195C31100 0011    
196C41100 0100    
197C51100 0101    
198C61100 0110    
199C71100 0111    
200C81100 1000    
201C91100 1001 PRIM_TYPE RINGinteger:2 vector float vector vector vector vector vector float float float 
202CA1100 1010    
203CB1100 1011    
204CC1100 1100    
205CD1100 1101    
206CE1100 1110    
207CF1100 1111    
208D01101 0000    
209D11101 0001    
210D21101 0010    
211D31101 0011 PRIM_BUMP_SHINY PRIM_SHINY_HIGHface integer:5 
212D41101 0100    
213D51101 0101    
214D61101 0110    
215D71101 0111    
216D81101 1000    
217D91101 1001    
218DA1101 1010    
219DB1101 1011    
220DC1101 1100    
221DD1101 1101    
222DE1101 1110    
223DF1101 1111    
224E01110 0000    
225E11110 0001    
226E21110 0010 (PRIM_MATERIAL LIGHT) Deprecated: Looks the same as [ PRIM_FULLBRIGHT, ALL_SIDES, TRUE ]
227E31110 0011    
228E41110 0100    
229E51110 0101    
230E61110 0110    
231E71110 0111    
232E81110 1000    
233E91110 1001 PRIM_TYPE SCULPTstring/key integer:8 
234EA1110 1010    
235EB1110 1011    
236EC1110 1100    
237ED1110 1101    
238EE1110 1110    
239EF1110 1111    
240F01111 0000    
241F11111 0001    
242F21111 0010    
243F31111 0011    
244F41111 0100    
245F51111 0101    
246F61111 0110    
247F71111 0111    
248F81111 1000    
249F91111 1001    
250FA1111 1010    
251FB1111 1011    
252FC1111 1100    
253FD1111 1101    
254FE1111 1110    
255FF1111 1111    
-

Not sure where else to put this, but nails I think is the bit that drives the network traffic the most -

-low-latency-requires-smart-queuing-traditional-aqm-is-not-enough -

Another article that deals with network issues in a 3D networked game -

-the_internet_sucks_or_what_i_ -


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

- - diff --git a/docs/OMG-WTF-BBQ.html b/docs/OMG-WTF-BBQ.html deleted file mode 100644 index 5e48a14..0000000 --- a/docs/OMG-WTF-BBQ.html +++ /dev/null @@ -1,25 +0,0 @@ - -OMG WTF BBQ - - - -

The rationale

-

Scripts, and sometimes objects, can invoke a file purely by its UUID. It had been suggested we might replace the existing UUID system with something where the file is invoked via some sort of machine address, pointing to the Internet address of the grid or world -- actually, call it an OMG Node -- the file originated from. The problem with this sort of approach is that, a given VR world could go away, making that direct addressing fail, a given world could change its name and location, causing the direct addressing to break. What we need is a system where the UUID of a file is location-agnostic. That is to say, it shouldn't matter where the file originally came from, it should only matter that there is still a way to bring it in when you need it.

-

At that, while it might be possible to go into a script and change the machine-address for the file if it breaks, that makes the assumption one would be able to edit the script, or know what the new pseudo-UUID for that file would be in order to replace it. For one thing, a lot of scripts are going to be no-mod, so even if you did know what that new pseudo-UUID to replace in there was, you wouldn't be able to fix it anyway.

-

What needs to exist is some means of identifying what world a given set of files came from by some kind of UUID subset. That is, each file made on a particular, distinct part of the OMG needs a unique identifier that starts out all UUIDs made there, and that the rest of the UUID would be appended to that would uniquely identify a file that was created there. This unique identifier for an OMG Node also needs to exist in a form that doesn't change when the name or location of the OMG Node changes.

-

OMG Node

-

This would be a server or group of servers that function as a single entity. I.e. the gridrid and the sims that are specifically owned by a person. Another might be the server sim-providing service Waki and Torben are now setting up.

-

WTF -- Where's The File

-

This would be a list of UUID-identified files (pictures, sounds, notecards, scripts, etc) available from a given OMG Node that are currently known on your current machine, and would function as a sort of look up table if those UUIDs get invoked again. It identifies where a particular file came from originally, and/or what machines it traversed getting here. There would be one .WTF file for each OMG Node, and would list all the files that came from there which the local OMG Node has collected in its own interactions with other OMG Nodes, and that are reachable in a Six Degrees of Separation from Bacon sort of way. Basically, any UUID which starts with the code that identifies it as having come from that specific OMG Node would be stored here.

-

BBQ -- Big, Broad Query

-

Here is where the Six Degrees of Separation from Bacon mentioned under the WTF entry comes in. A .BBQ files keeps track of all the OMG Node identifier UUID-subset codes so that when an OMG Node changes its address or ceases to exist, every back address is stored, also, what other places maintain mirror copies of some or all of the files from there that could be called by a full UUID (from inside a script, say) so even when an OMG Node goes away, those files will continue to be available.

-

Basically, if a UUID is invoked by a script, and the file that UUID is tied to isn't in the local OMG Node, a query will be sent out to the nearby OMG Nodes asking if they have this file, if they don't, they might query their nearby OMG Nodes to see if those have it, and so on. Ideally there should develop from that, ant-tracks-style, that identifies the shortest path between OMG Nodes to where files with a given OMG Node identifier UUID-subset's files can be obtained from, even if that OMG Node has been out of business for a decade.

-

COW -- Copy On Write.

-

What's a BBQ without some COW, er I mean beef? We can speed up the BBQ search a bit by pre caching things, but what to pre cache and how?

-

Instead of using UUIDs, which are basically random numbers, we could use SHA1 hashes. This is the same system used by git at least. That means the objects can be content addressable. First benefit is that all these identical copies of any given object would end up with identical names, so that we have a broader field to search. Second benefit is that we don't end up having to store dozens of identical copies of the same object on the local OMG node, since they all end up with the same name. A UUID is 16 bytes, an SHA-1 is 20, but a UUID is usually shown in a format that includes 4 dashes, so they end up being the same length. Much experience with git has shown that you can get away with just the first few digits, depending on how many objects you need to distinguish between. So instead of completely ignoring the half a dozen copies of any given object you are searching for; coz different people uploaded it from different places; you might find it more easily by noticing that you already have it. The .WTF file can include pointers to known locations, and the various names it is known as, but the object itself has the SHA1 hash as it's file name, instead of the UUID. The SHA1 hash is it's internal name. It does not even have to be stored on the local OMG node, just the SHA1 internal name, and some pointers to likely locations.

-

Where does the COW come in? If it's got horns, any where it wants to. Er...

-

Quite often an object gets changed, that would naturally change the SHA1 hash. So now we have a different object, with a different name. But, the object might not be stored locally, just the pointer. The programming field has a name for what happens next, a copy is made when you try to write to it - Copy On Write. So the object is copied from the most convenient nearby OMG node, the changes made, then it is written (under a new SHA1 hash name) onto the local OMG node. This OMG node informs other interested nodes that it now has this new object, they can store pointers to the new object on this OMG node in their .WTF files.

-

Which brings us back to the pre caching. The hungry little OMG node does not have to wait for the BBQ to fire up to get it's COW. It can start to download the object if it has some time on it's hands, just coz.

-

To quote a famous local sporting hero "Where's the cheese?". Ah, that's another story...

- - diff --git a/docs/SledjHamr.html b/docs/SledjHamr.html index b2371f1..304c884 100644 --- a/docs/SledjHamr.html +++ b/docs/SledjHamr.html @@ -8,7 +8,7 @@

This might sometimes be referred to as SledjHamr, SldjHmr, NGIW,or the term that currently has favour - Open Magic Garden (OMG).

I'm a firm believer that we should use the existing SL based viewer code, and the existing OpenSim server code, as crutches. They are both crap really, but they have the benefit of actually working. The alternative is to throw it all out and start from scratch. A virtual world system is REALLY BIG, something a small team will take years to write, even if we did it full time. So that would be many years before we even have enough of a brand new system to have ruth standing still on an empty plane. By leveraging existing systems, we already have something people can use, we just make it better when we can. OpenSim at least is modular, so we can replace things one module at a time. For both server and viewer, we can chip away at existing code at our leisure, slowly turning insane code into sane code. Meta-impy is the fork I made of the Imprudence viewer, so that is the viewer I'm changing.

BTW, my definition of "sane" code is - performance critical stuff should be in C, with perhaps some hand written assembler. A lot of the virtual world stuff is performance critical. Things should be written as small, and as flexible, as possible, so that many small things can work together in unintended ways to do cool stuff. The Enlightenment Foundation Libraries (which I have done some development for) are a good example. matrix-RAD was my 10 year experiment in pursuing some of these ideas, though it was in Java.

-

See NGIW for more ideas from Alice. Interestingly enough, some of my ideas are basically the conclusion of one of the OpenSim developers Masters degree dissertation http://justincc.org/blog/2010/10/25/my-masters-dissertation-on-internet-scale-virtual-environment-architectures/ . Note, I read that after I came up with these ideas.

+

See NGIW for more ideas from Alice. Interestingly enough, some of my ideas are basically the conclusion of one of the OpenSim developers Masters degree dissertation http://justincc.org/blog/2010/10/25/my-masters-dissertation-on-internet-scale-virtual-environment-architectures/ . Note, I read that after I came up with these ideas.

 

boxen

We can have servers that just store and forward the sim data. Clients edit that data, if they are allowed to. Special servers (engines) can do the physics and server side script running, they act as clients to the sim data server. No reason why this can't all be on the same computer, or separate ones.

diff --git a/docs/SledjHamr/Grid-data-flow.html b/docs/SledjHamr/Grid-data-flow.html new file mode 100644 index 0000000..1a91726 --- /dev/null +++ b/docs/SledjHamr/Grid-data-flow.html @@ -0,0 +1,246 @@ + +Grid data flow + + + +

Existing, and possibly incorrect, wisdom

+

In this section I will mention the stuff that I think I know, and why it might be wrong. There have been major changes in how these things have been dealt with, particularly with the introduction of ROBUST. Personally I have experience with the closed source OpenSim fork that was in use at M7, and the open source OpenSim fork that is used at IG.

+

There are two types of assets - things that have been rezzed in a sim, and users inventory. While poking around in the M7 system I figured out that both are somewhat similar.

+

There is database stuff that has meta data at least, and there is file based stuff that seems to include the actual asset data, things like script source, script binaries, texture, sounds, animations. I was not able to completely understand it all before M7 closed.

+

Received wisdom is that sim assets are stored on the sims server, and that inventory assets are stored on the central database. Recent experience has suggested that this is not correct. While I was testing the IGnoble scripts, I loaded an OAR of my home sim into the sim I was running on my local computer. Surprisingly, my sim server spent the next three hours uploading .. something .. to the grid server (my upload speed is not spectacular, and there was a decent amount of data). Only after it had completed that, did it rez the sim in world, which happened quickly for me, but I was sitting on the same computer as the sim server. A quick inspection showed that I had the expected file based assets on my server, though they where in the cache directory.

+

My theory is that the sim assets are also stored on the central server, but cached on the sim server. The big upload was probably the entire contents of the OAR file.

+

Now, lets figure out what's really going on.

+

 

+

ROBUST

+

ROBUST seems to be the centre of the OS data flow universe. "ROBUST is a flexible server shell ..." the OS web site says, not sure exactly what that means. We shall find out. It basically seems to be a way to connect to arbitrary processing and storage modules, and the storage modules part is where our interest lies on this page.

+

Sim servers point to one or more ROBUST servers for their services, These pointers are a HTTP URLs that is usually the grid server, and a port number. You can have different ROBUST services on different port numbers, or on different servers. The ROBUST servers can handle one or more of the services. ROBUST servers can point to others, acting as a proxy. ROBUST hosted services can have others as dependencies, they can point to other instances of ROBUST on other URL/ports.

+

Robust has the concept of IN and OUT connectors. The IN's seem to be the ports used by sim servers and others to connect to the services, they load the proper OUT or code modules. The OUTS seem to be the connectors to the database, or perhaps the code performing the service. Or maybe the OUTs are for sending data back, and the modules are for doing the work?

+

Apparently ROBUST is designed to allow code reuse.

+

Note that this will allow us to easily integrate OMG, as we can do that in any language, implement the relevant parts of the ROBUST wire protocol, listen on a given HTTP port, then just tell the ROBUST clients to use that port. Nails:command pump in fact includes provisions to have wrappers for other protocols, which is a perfect match here. So glad we don't have to deal with direct interfacing to C# code. B-)

+

The ROBUST wire protocol looks like it's HTTP POSTs to the URL and port number. The POST includes the service name, and a verbose (XML, ewww) text command to that service.

+

 

+

sim server view

+

Sim servers have these, which include connection strings to the local database server -

+ +

These only include a URL to the grid server -

+ +

There are three possible asset caches, only one should be on, but none of them can be on -

+ +

 

+

grid server view

+

A quick look shows the sims on the grid server seem to be setup the same way.

+

ROBUST has this to say -

+ +

 

+

the big data holders

+

On sims -

+

Asset and Inventory services include connection strings to the local database, and URLs to the ROBUST grid server. There is also the cache. Only flotsam cache will be looked at for now.

+

On the grid server -

+

Asset service includes a local file part, but may include a database part. Inventory service, dunno. Library service is file based, but not important right now.

+

Soooo, what is stored where? Which are the real assets? Where's the data, database or file? Where's the cheese? B-)

+

The source code is here -

+

 

+

InventoryService

+ +

Question - What does the sim use it's InventoryService database connection string for? Perhaps that's only needed for when the sim is not using ROBUST?

+ +

Hmmm, according to OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs -> CacheInventoryServiceURL() there may already be a mechanism in place to use other inventory servers PER USER. For HG I think. Makes sense. B-)

+

 

+

AssetService

+ + + + + +

 

+

Users of these services

+

The above is what tracing things from the configuration files gets you. But this is C#, an object oriented programming language. Like most such languages, it's carefully designed to hide implementation details from the programmer. Which is fine, unless it's the details that you really want to know. Then it sucks, and you sometimes have to understand the deep magic, and do a lot of searching and head scratching to figure things out.

+

So, that's the provided frame work, let's see if we can sort out how that frame work is used, and if anything steps outside of that frame work.

+

There is still a large piece of the puzzle missing. The above services only seem to deal with the metadata for assets, not with the actual data.

+

 

+

database

+

prims is the prims in the sim. primshapes is their shapes. primitems is the content of the sim prims.

+

prims.RegionID prims.UUID == primshapes.UUID But what about primitems? That has (takes a deep breath) itemID, primID, assetID, and parentfolderID. primID seems to be exactly the same as parentfolderID. And indeed prims.UUID == primitems.primID. itemID and primID are keys, itemID is the primary. primitems.assetID=assets.id

+ +

Primitems is only metadata, where is the actual data? Is this what itemID and/or assetID are all about? Primshapes has a Texture blob, but is it all the face textures that go into a prim?

+

inventoryitems has - inventoryID and assetID (also avatarID and groupID). Oddly enough it has a groupOwned flag to. I thought inventory would only be owned by the person who's inventory it is in, but I have seen things in my own inventory owned by others. Once more, it's only metadata. InventoryID is the primary key.

+

It appears all roads lead to Rome .. er the assets database. One ginormous amorphous blob of all our stuffs. It has some metadata, an id, and a data blob, the contents of the data blobs on the ones I have seen look to be about the correct size for being the actual data for the asset. id is the primary key. There still might be a file system as well? As a cache only? The assets table on sim servers seems to just be the default assets. The grid server assets table is almost 2 million records, or perhaps only half a million, the system gave two very different counts. Could be where all the damn asset data is stored. B-(

+

The grid prims table only has assets for the grid sims, plus a few others that are old sims, which got deleted from the regions table automatically I think.

+

Prims table is all the prims in the grid sims. Prim shapes is data about those prims. Primitems is the contents of those prims. Assets stores stuff for primitems.

+

Umm, things that used to be in the sim get into the OAR? The new sims I created to test OS 0.7.2 now have stuff in their prim* tables from people that have not logged on. I copied them from Sandbox using OARs. It seems to be true, but why only one or three objects? I don't think OARs populated prim* tables on 0.7.1.

+

NOTE - it takes a loooong time to search the assets database for a name.

+

 

+

 

+

Sim assets

+

Sim server opensim.prims.RegionUUID and UUID

+

Sim server opensim.prims.UUID -> Sim server opensim.primshapes.UUID (one to one) The actual prim shape.

+

Sim server opensim.prims.UUID -> Sim server opensim.primitems.primID (one to many) The meta data for the prims contents.

+

Sim server opensim.primitems.assetID -> Grid server opensim.assets.id (one to one) The actual data for the prims contents.

+

prims.SceneGroupID seems to be what ties a linkset together.

+

Primshapes has two binary blobs, one called Texture, the other called ExtraParams.

+

primshapes.ExtraParams includes flexi (various flexi parameters), light (local light parameters), sculpt (type, sculptMapTextureUUID), and projection (projectionTextureUUID, FOV, focus, amb).

+

primshapes.Texture is an OpenMetaverse library binary object that includes data for the textures and colours on each prims side. primshapes.Texture includes texture UUIDs, directly stored as 16 bytes, plus the other texture information, stared as binary, some of it stored as bit fields. For prims with more than one texture, more copies of this data is stored. OpenMetaverse library is included in OpenSim as a binary, no source, but I found the source, just not sure which version.

+

I'm assuming for the moment that actual texture data is all in the grids assets table, probably cached on the sim server using flotsam. In theory textures have to go into inventory first before they are applied to prims. In practice, OARs can bypass that.

+

 

+

Inventory assets

+

All on the grid server.

+

opensim.inventoryitems.inventoryID, avatarID, and parentFolderID

+

opensim.inventoryitems.assetID -> assets.id (one to one) The actual data for the inventory.

+

opensim.inventoryfolders.folderID, agentID, and ParentFolderID

+

This seems pretty straight forward.

+

 

+ +Grid data flow + +

 

+

Experiments

+

 

+

Using a new assetService on an existing sim server.

+

I tried configuring my home sim server to have it's own ROBUST server, and the sim running there to use it only for AssetService. The immediate result was horribly correct. It can't have been that easy. In the end, it was not that easy. It had the meta data about assets, but the assets data was still on the grid server. The sim shows up on the map as white. I was unable to rez things from inventory, but could create new stuff, and even move objects to the next sim running on someone else's server. Everything else seemed to be working fine, though one person (running on a very underpowered computer) had troubles rezzing herself, and switching back to the grid AssetService seemed to fix that. On the other hand, another person rezzed fine. Both these people where connecting to my home sim server from some other place on the planet than my home. The tests where not exhaustive, but the inability to rez from inventory was a show stopper. Something needs to be fixed for that to work. The fact that it still stored the assets data on the grid server means it was a failed experiment, as that's the primary goal.

+

Refinements of that experiment would be to see what happens when a new sim is built up within that configuration from newly created prims. What happens during an OAR load? Will the new assets be stored locally, or sent to the grid server, or will it just not work?

+

 

+

Using a different InventoryService for an existing / new user

+

This is more likely to succeed, as it's a similar mechanism to that used by HG, a pointer to an external InventoryService is stored with the HG users record on the grid they HGed to.

+

UserAccounts.ServiceURLs has "HomeURI= GatekeeperURI= InventoryServerURI= AssetServerURI=", or blank, or NULL. It either has to be empty, or properly filled out. They are normal service URLs as used by ROBUST. I think they are only involved in HG. Only one person in the IG database has those filled out, I think that was a test Rizzy was doing. Not sure what HomeURI is, but the others look like the usual ROBUST services. Though GateKeeper is for incoming users? Wonder what HGers get if they are stored in this database table?

+

HomeURI is the URI to the UserAgent service on their home grid. It's used to authenticate them with their home grid, and to form the URL part that is added to their name in world.

+

Hmmm, does not look like GatekeeperURI is actually used. shrugs

+

 

+

Trying to make a new sim using an old sims UUID on a different server

+

In theory this should not work, since the prim metadata is on the old sim server, and not accessible from the new server.

+

 

+

Load an OAR that includes a texture that is NOT in anyone's inventory, to see where it ends up.

+

I'll have to create a fake texture first, then see if I can fake an OAR with that texture.

+

Should create a sim with just a test prim in it, with the default texture. Save the OAR. Then see if I can insert a faked texture onto that prim in the OAR.

+

The terrain texture might be a good choice to experiment with to, they are easily changed in the OAR, and stored in the OAR. Their UUIDs are stored in the regionsettings table.

+

 

+

notes

+

Just hijacking my own page here for a moment - The console uses the ? key to show help, no matter where you type it. So ? can't be use as part of a name or other arbitrary text. The offending lines are in OpenSim/Framework/Console/LocalConsole.cs starting at line 398.

+

I just woke up and had an idea, it might turn out to be crap once I have actually thought about it. lol

+

One of the biggest problems is that sim asset data is spread between the sim server and the grid server, this makes things hard. We can abuse the cache mechanism. Write a cache module that stores sim asset data on the sim server, in a format that matches the rest of OMG. It's not really a cache though, it's the new sim asset database. Have the sim server tell the grid server that it's OK to delete stuff from the asset server, it has it now. On the grid server side, have a "last accessed" time stamp on the assets database. Archive stuff that's not been used for awhile. Actually delete stuff if there's no inventory pointers to it, AND sims using it have said it's OK to delete. Adding some reference counting to that database might help this process to.

+


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

+ + diff --git a/docs/SledjHamr/Grid_data_flow.png b/docs/SledjHamr/Grid_data_flow.png new file mode 100644 index 0000000..8324280 Binary files /dev/null and b/docs/SledjHamr/Grid_data_flow.png differ diff --git a/docs/SledjHamr/LSL-functions-implemented.html b/docs/SledjHamr/LSL-functions-implemented.html new file mode 100644 index 0000000..7126a49 --- /dev/null +++ b/docs/SledjHamr/LSL-functions-implemented.html @@ -0,0 +1,2671 @@ + +LSL functions implemented + + + +

This is where we can track what LSL functions are implemented in LuaSL, and what the differences are from SL and OpenSim. Note that the goal is to be SL compatible. OpenSim compatibility comes second.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
ColourStatus
WhiteNothing done.
RedJust a stub.
OrangeStub prints debug stuff.
MagentaStub that passes details to the server and waits for the response if one is needed.
GrayStub that fakes enough for the current tests.
YellowFleshed out a bit.
GreenFully implemented, maybe.
PurpleTested and works at least.
CyanCompletely compatible with SL.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
CodeMeaning
LFunction can be done locally, without dealing with the sim or grid.
RFunction can be done through ROBUST.
DFunction can be done through the local sims database.
OFunction needs to deal with the world server.
DO?Can do it through the local sims database, but may need to let the world server know so it notices the change?
gGod mode function.
dObsolete function that has been deprecated.
bFunction is marked as broken by LL, and may not work even in SL.
+

 

+

animation override

+ + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llGetAnimationOverride   
llResetAnimationOverride   
llSetAnimationOverride   
+

 

+

avatar

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llAttachToAvatar  O
llAvatarOnLinkSitTarget  O
llAvatarOnSitTarget  O
llClearCameraParams  O
llDetachFromAvatar  O
llForceMouselook  O
llGetAgentInfo  R?
llGetAgentLanguage   
llGetAgentSize  R?
llGetAnimation  O
llGetAnimationList  O
llGetAttached  O
llGetCameraPos  O
llGetCameraRot  O
llGetDisplayName   
llGetPermissions  O
llGetPermissionsKey  O
llGetUsername  R
llGiveMoney  O
llKey2Name  R
llPointAt  d
llReleaseCamera  dO
llReleaseControls  O
llRequestAgentData  R?
llRequestDisplayName   
llRequestPermissions  O
llRequestUsername  R
llSameGroup  DR
llSetCameraParams  O
llSitTarget  DO?
llStartAnimation  O
llStopAnimation  O
llStopPointAt  dO
llTakeCamera  dO
llTakeControls  O
llTeleportAgentHome  O
llTransferLindenDollars  O
llUnSit  O
+

 

+

collision / detect / sensor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llCastRay   
llCollisionFilter   
llCollisionSound   
llCollisionSprite  b
llDetectedGrab  O
llDetectedGroup  O
llDetectedKey  O
llDetectedLinkNumber  O
llDetectedName  O
llDetectedOwner  O
llDetectedPos  O
llDetectedRot  O
llDetectedTouchBinormal  O
llDetectedTouchFace  O
llDetectedTouchPos  O
llDetectedTouchST  O
llDetectedTouchUV  O
llDetectedType  O
llDetectedVel  O
llPassCollisions   
llPassTouches   
llSensor   
llSensorRemove   
llSensorRepeat   
llVolumeDetect   
+

 

+

communications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llDialog  O
llEmail   
llGetNextEmail   
llInstantMessage  O
llListen  O
llListenControl  O
llListenRemove  O
llMessageLinked  L
llOwnerSay  O
llRegionSay  O
llRegionSayTo  O
llSay  O
llShout  O
llTextBox  O
llWhisper  O
+

 

+

inventory

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llAllowInventoryDrop  DO?
llGetInventoryCreator  D
llGetInventoryKey  D
llGetInventoryName  D
llGetInventoryNumber  D
llGetInventoryPermMask  D
llGetInventoryType  D
llGetNotecardLine  DR
llGetNumberOfNotecardLines  DR
llGiveInventory  O
llGiveInventoryList  O
llGodLikeRezObject  Og
llRemoveInventory  DO?
llRequestInventoryData  D?
llRezAtRoot  O
llRezObject  O
llSetInventoryPermMask  gDO?
+

 

+

JSON

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llJson2List   
llJsonGetValue   
llJsonSetValue   
llJsonValueType   
llList2Json   
+

 

+

land

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llAddToLandBanList    
llAddToLandPassList   
llEjectFromLand   
llGetLandOwnerAt   
llGetParcelDetails   
llGetParcelFlags   
llGetParcelMaxPrims   
llGetParcelMusicURL   
llGetParcelPrimCount   
llGetParcelPrimOwners   
llGetSimStats   
llGround   
llGroundContour   
llGroundNormal   
llGroundSlope   
llManageEstateAccess   
llModifyLand   
llOverMyLand   
llParcelMediaCommandList   
llParcelMediaQuery   
llRemoveFromLandBanList   
llRemoveFromLandPassList   
llResetLandBanList   
llResetLandPassList   
llReturnObjectsByID   
llReturnObjectsByOwner   
llSetParcelMusicURL   
+

 

+

list

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llCSV2List  L
llDeleteSubList  L
llDumpList2String  L
llGetListEntryType  L
llGetListLength  L
llList2CSV  L
llList2Float  L
llList2Integer  L
llList2Key  L
llList2List  L
llList2ListStrided  L
llList2Rot  L
llList2String  L
llList2Vector  L
llListFindList  L
llListInsertList  L
llListReplaceList  L
llListRandomize  L
llListSort  L
llListStatistics  L
llParseString2List  L
llParseStringKeepNulls   L
+

 

+

math

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llAbs  L
llAcos  L
llAngleBetween  L
llAsin  L
llAtan2  L
llAxes2Rot  L
llAxisAngle2Rot  L
llCeil  L
llCos  L
llEuler2Rot  L
llFabs  L
llFloor  L
llFrand  L
llLog  L
llLog10  L
llModPow  L
llPow  L
llRot2Angle  L
llRot2Axis  L
llRot2Euler  L
llRot2Fwd  L
llRot2Left  L
llRot2Up  L
llRotBetween  L
llRound  L
llSin  L
llSqrt  L
llTan  L
llVecDist  L
llVecMag  L
llVecNorm  L
+

 

+

media

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llAdjustSoundVolume   
llClearPrimMedia   
llClearLinkMedia   
llGetLinkMedia   
llGetParcelMusicURL   
llGetPrimMediaParams   
llLoopSound   
llLoopSoundMaster   
llLoopSoundSlave   
llPlaySound   
llPlaySoundSlave   
llPreloadSound   
llRefreshPrimURL  d
llSetLinkMedia   
llSetPrimMediaParams   
llSetPrimURL  d
llSetSoundQueueing   
llSetSoundRadius   
llStopSound   
llSound  d
llSoundPreload  d
llTriggerSound   
llTriggerSoundLimited   
+

 

+

path finding

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llCreateCharacter   
llDeleteCharacter   
llEvade   
llExecCharacterCmd   
llFleeFrom   
llGetClosestNavPoint   
llGetStaticPath   
llNavigateTo   
llPatrolPoints   
llPursue   
llUpdateCharacter   
llWanderWithin   
+

+

 

+

physics

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llApplyImpulse  DO?
llApplyRotationalImpulse  DO?
llGetAccel  D
llGetEnergy  DO?
llGetForce  D
llGetMass  D
llGetMassMKS  D
llGetObjectMass  D
llGetOmega  D
llGetTorque  D
llGetVel  D
llMoveToTarget  DO?
llPushObject  DO?
llSetAngularVelocity  DO?
llSetBuoyancy  DO?
llSetForce  DO?
llSetForceAndTorque  DO?
llSetHoverHeight  DO?
llSetTorque  DO?
llSetVelocity  DO?
llTargetOmega  DO?
+

 

+

object / prim / link

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llBreakAllLinks  DO?
llBreakLink  DO?
llCreateLink  DO?
llDie  DO?
llGetBoundingBox  D
llGetGeometricCenter  D
llGetKey  D
llGetLinkKey  D
llGetLinkPrimitiveParams  D
llGetLinkName  D
llGetLinkNumber  D
llGetLinkNumberOfSides  D
llGetMaxScaleFactor   
llGetMinScaleFactor   
llGetNumberOfPrims  D
llGetObjectDesc  D
llGetObjectDetails  D
llGetObjectName  D
llGetObjectPermMask  D
llGetObjectPrimCount  D
llGetOwner  D
llGetOwnerKey  D
llGetPhysicsMaterial   
llGetPrimitiveParams  D
llGetStatus  D
llLinkParticleSystem  DO?
llLinkSitTarget  DO?
llMakeExplosion  dDO?
llMakeFire  dDO?
llMakeFountain  dDO?
llMakeSmoke  dDO?
llParticleSystem  DO?
llScaleByFactor   
llSetCameraAtOffset  DO?
llSetCameraEyeOffset  DO?
llSetClickAction  DO?
llSetDamage  DO?
llSetKeyframedMotion   
llSetLinkCamera  DO?
llSetLinkPrimitiveParams  DO?
llSetLinkPrimitiveParamsFast  DO?
llSetObjectDesc  DO?
llSetObjectName  DO?
llSetObjectPermMask  gDO?
llSetPayPrice  DO?
llSetPhysicsMaterial   
llSetPrimitiveParams  DO?
llSetSitText  DO?
llSetStatus  DO?
llSetText  DO?
llSetTouchText  DO?
llSitTarget  DO?
+

 

+

rotation / scaling / translation

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llGetLocalPos  D
llGetLocalRot  D
llGetPos  D
llGetRootPosition  D
llGetRootRotation  D
llGetRot  D
llGetScale  D
llLookAt  DO?
llRotLookAt  DO?
llRotTarget  DO?
llRotTargetRemove  DO?
llSetLocalRot  DO?
llSetPos  DO?
llSetRegionPos  DO?
llSetRot  DO?
llSetScale  DO?
llStopLookAt  DO?
+

 

+

script

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llGetFreeMemory  L
llGetMemoryLimit  L
llGetScriptName  L
llGetScriptState  L
llGetSPMaxMemory  L
llGetStartParameter  L
llGetUsedMemory  L
llRemoteLoadScript  d
llRemoteLoadScriptPin   
llResetOtherScript  L
llResetScript  L
llScriptDanger   
llScriptProfiler  L
llSetMemoryLimit  L
llSetRemoteScriptAccessPin  L, but might have to tell the sim server.
llSetScriptState  L, but might have to tell the sim server.
+

 

+

simulator

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llCloud   
llEdgeOfWorld  R
llGetEnv  R?
llGetRegionAgentCount  O
llGetRegionCorner  R
llGetRegionFlags  RD?
llGetRegionFPS  O
llGetRegionName  R
llGetRegionTimeDilation  O
llGetSimulatorHostname  R
llGetSunDirection  R
llMapDestination  O
llRequestSimulatorData  R?
llWater   
llWind   
+

 

+

string

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llBase64ToString  L
llDeleteSubString  L
llGetSubString  L
llInsertString  L
llMD5String  L
llSHA1String  L
llStringLength  L
llStringToBase64  L
llStringTrim  L
llSubStringIndex  L
llToLower  L
llToUpper  L
llXorBase64   
llXorBase64StringsCorrect  L
llXorBase64Strings  Ld
+

 

+

texture

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llGetAlpha  D
llGetColor  D
llGetNumberOfSides  D
llGetTexture  D
llGetTextureOffset  D
llGetTextureRot  D
llGetTextureScale  D
llOffsetTexture  DO?
llRotateTexture  DO?
llScaleTexture  DO?
llSetAlpha  DO?
llSetColor  DO?
llSetLinkAlpha  DO?
llSetLinkColor  DO?
llSetLinkTexture  DO?
llSetLinkTextureAnim  DO?
llSetTexture  DO?
llSetTextureAnim  DO?
+

 

+

time

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llGetAndResetTime  L
llGetDate  L
lGetGMTclock  L
llGetTime  L
llGetTimeOfDay  L
llGetTimestamp  L
llGetUnixTime  L
llGetWallclock  L
llMinEventDelay   
llResetTime  L
llSetTimerEvent  L
llSleep  L
+

 

+

vehicle

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llRemoveVehicleFlags   
llSetVehicleFlags   
llSetVehicleFloatParam   
llSetVehicleType   
llSetVehicleRotationParam   
llSetVehicleVectorParam   
+

 

+

XML-RPC and HTTP

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL functionSL notesOpenSim notesCodes
llCloseRemoteDataChannel   
llEscapeURL   
llGetFreeURLs   
llGetHTTPHeader   
llHTTPRequest   
llHTTPResponse   
llLoadURL   
llOpenRemoteDataChannel   
llReleaseURL   
llRemoteDataReply   
llRemoteDataSetRegion  d
llRequestSecureURL   
llRequestURL   
llSendRemoteData   
llSetContentType   
llUnescapeURLs   
+


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

+ + diff --git a/docs/SledjHamr/LuaSL-New-scripting-engine.html b/docs/SledjHamr/LuaSL-New-scripting-engine.html new file mode 100644 index 0000000..9ceb7f8 --- /dev/null +++ b/docs/SledjHamr/LuaSL-New-scripting-engine.html @@ -0,0 +1,917 @@ + +LuaSL New scripting engine + + + +

LuaSL is a Lua based LSL scripting engine that will aim for LSL +compatibility first, then adding Lua extensions. It aims to replace the +woeful XEngine from OpenSim, and at a later stage, be the basis for a +client side scripting engine.

+

To compile this, you will need Enlightenment Foundation Libraries (EFL) +installed in either /opt/e17 or /usr. These are typical places it get's +installed in. You will also need flex. The rest of the dependencies +are in the ../libraries directory.

+

write our own

+

I had considered in the SledjHamr document writing a new script engine from scratch in Lua. This is what I wrote -

+

"I'd love to write a Lua implementation of LSL, I'm sure Alice would want to write a Scheme one."

+

"I've been thinking of trying out Lua as a backend for LSL, and trying some micro threading style experiments."

+

That's about the sum total of my plans and thoughts though. lol

+

Here are some more random thoughts.

+

Writing an entire scripting engine in a new language is a big job.

+

Lua is meant to be embedded into other things as an internal scripting language. It has great features that let it be a meta language, you can make it look like other languages, or add other language concepts. Plus it's tiny. Being used by online games like WoW means it's probably got what it takes. These are reasons I chose it for both server side and client side scripting.

+

My own personal plan was to cut my teeth on Lua by using EFL for a RL contract I'm working on, then add Lua scripting to the meta-impy viewer. It turns out that the EFL Lua support was not complete, but I managed to use it in that project anyway. My next Lua plans are to implement in EFL those things that project needed. I did not plan on working on a Lua based server side scripting engine until after I had implemented some of the OMG plans. In particular, I want to do that stuff in C, and C is the natural partner for Lua. Adding Lua to .NET / mono is a whole can of worms I personally don't want to get stuck in.

+

I have successfully completed my plans to implement EFL Lua things that my RL contract needed. That's in the current release of the EFL libraries, so I can move onto my next plans now.

+

On the other hand, perhaps it's worthwhile starting on our own scripting engine now? It's a big job, so lets break it down.

+

 

+

Lua to .NET bindings.

+

OpenSim is written in C#, a language I don't know much about. C# is one of the languages that Microsoft's .NET (and the unix port mono) can support. There seems to be a few projects that have done this for us. Some of these might be duplicated, I've not actually read them, just a quick search.

+

Some details about Lua.NET, also mentions some others, but with broken links.

+

LuaInterface

+

Details how to integrate the two from Visual Studio, so really only useful for Windows.

+

Lua.NET

+

Another roll your own example.

+

 

+

Interfacing to the virtual world

+

Some parts of a scripting engine need to interface with the virtual world. Changing prims, detecting touches, playing sounds, starting animations, etc. The existing script engine has C# functions that map LSL script functions to what's needed to do these things in OpenSim. Lua, being an embedded scripting language, has methods of making Lua functions that can call the under laying systems functions. So it should not be that hard to just map pre existing C# functions to Lua functions in the same way that they are now mapped to LSL functions.

+

 

+

Compiler

+

LSL, C#, and Lua are all compiled. I think LSL is compiled to .NET bytecode, C# certainly is. Lua is compiled to it's own bytecode, but perhaps one of the bindings I mentioned before would compile it to .NET bytecode? Compilation is now done server side. It used to be done viewer side, but that changed when LL moved to a mono backend for LSL. OpenSim being .NET / mono in the first place, could just take advantage of that and work in the same way. OpenSim does not support the old LSL script engine. I don't think we need to either.

+

 

+

Language

+

OpenSim allows people to write in world scripts in C# as well as LSL. Personally, I've NEVER seen any actual in world examples being used, only some theoretical examples on web pages. I suspect that people want their scripts to be more or less compatible with SL, so they stick to LSL. Certainly there is a great amount of scripts that came from SL, so they are LSL anyway.

+

It's possible we would want people to be able to write scripts in Lua as well as LSL. That might actually get more traction than C#, as we might attract scripters from WoW and other popular online games that use Lua for scripting. I think it has advantages also for when Lua scripting makes it into the client. Server and client side scripting should be compatible. I don't think LSL is a good language for client side scripting, as it's just not made with that in mind.

+

 

+

Design

+

There are a number of ways we can go about this. Do we write the entire scripting engine in Lua, and only interface with C# for those things we really need to in order to get OpenSim to do in world stuff? Do we write a LSL to Lua translation layer that then compiles the Lua? The OpenSim engine I understand does that, translates LSL to C# then compiles that to .NET. Could we start with a higher level of Lua that interfaces with the existing LSL support functions in OpenSim? Can we even rely on those LSL support functions being a stable API? Should we start by experimenting with Lua's meta language features, see how close we can get it to look like LSL syntax? Perhaps concentrate on those parts of the job that don't require interfacing to OpenSim, and hope that SledjHamr can meet it half way to avoid the entire .NET thing?

+

I choose to do those last two things - see how far I can get Lua to look like LSL, and concentrate on the parts that don't require interfacing to OpenSim, hoping that I can avoid the entire .NET thing.

+ +

The basic design will be made up as I go along, but so far I have this -

+ +

A parser parses an LSL script, validating it and reporting errors.

+ +

A translator takes the result of the parse, and converts it into Lua +source. Each LSL script becomes a Lua state. LSL states are handled as +Lua tables, with each LSL state function being a table function in a +common metatable. LL and OS functions are likely to be C or Lua +functions. Careful testing should be done with LuaJIT FFI, sandboxing, +and performance testing.

+ +

The Lua source is compiled by the Lua compiler.

+ +

LuaJIT is used as the Lua compiler, library, and runtime.

+ +

Luaproc is used to start up operating system threads and hand Lua states +between them. Luaproc messaging is also being used, but might need to +change to edje messaging. Note - luaproc has been extensively rewritten +for this project, mostly converting it to use EFL. That rewrite +substantially shrunk the source code. Then it was all rewritten again +to use EFL threads, and cooperative multitasking.

+ +

THIS IS WHERE WE ARE RIGHT NOW.

+ +

Should implement embedded Lua somehow. Probably the best thing to do is +to have comments like -

+ +

//Lua: local t = {1, 3, 42, x='something', 'something else}

+/*Lua: print(t.x) */

+ +

The LSL parser picks these up and stores them in the AST as Lua +snippets, then the compiler output functions just inserts them in the +Lua code it is generating. Obviously these Lua snippets can access the +rest of the generated Lua code. They should also be able to access +skang and thus do proper GUI stuff on viewers that support skang.

+ +

Nails will be used to pump commands in and out of the LuaSL system. +Incoming commands invoke LSL events via the LuaSL state metatable. LL +and OS functions that impact the world will be converted to nails +commands sent to the command pump.

+ +

Initially, since this is the first thing being written, a nails command +pump client needs to be installed into OpenSim's C# stuff. Though it +might be possible to talk directly to ROBUST instead. Think I'll try +the ROBUST route, see how far I can get. That's the general principle +applying in all of this - try to avoid C# and see how for we can get. +lol

+ +

On the other hand, might be better to leverage the existing C# +implementations of LSL functions, just to get things up and running +quickly. To that end, a protocol involving exchanging snippets of Lua +over a network socket has been developed, and the next step is to write +the C# side. sigh

+ +

A watchdog thread should be used to make sure no LuaSL script spends +forever processing any event.

+ +

Some form of serialisation will need to be created for saving script +state during shutdowns, passing script state to other threads / +processes / computers. Apparently Lua is good at this.

+ +

There will have to be a MySQL (and maybe SQLite) client in the system, +so we can talk directly to the local sim database. Esskyuehl may be +suitable, though it's still in the prototype stage.

+ +

Email, HTTP, and XML-RPC might need to be dealt with by us. A ROBUST +client will be needed to. Azy might be suitable, but it's also in +prototype.

+ +

An object is a file system directory, full of LSL scripts as text files, +notecards as text files, animations as BVH (or later BVJ) files, etc. +There will be some sort of metadata in place. This could be created by +our own OpenSim compatible cache module.

+ + +

Test harness.

+-------------

+ +

I'll build a test harness. It will be based on EFL Edje Lua, with +buttons for triggering LSL events, SL style dialogues, and other goodies.

+ +

The initial goal will be to run standard MLP scripts. They have minimal +interface to the world, and exercise quite a bit of the rest of LSL. +They are also quite common, and sometimes responsible for a lot of the +script running load.

+ +

Later I should add stock standard OpenCollar scripts from SL. They are +a bitch to get working under OpenSim, so would be good compatibility +tests.

+ +

Various eina logging domains might be used to handle whisper, say, shout, +etc.

+ +

Performance testing will have to be done on 5000 scripts, to see how +that compares against XEngine.

+ +

The test harness became the love world server.

+ + +

TODO

+

----

+ +

Useful for limiting the amount of time scripts use - +

https://groups.google.com/forum/#!topic/lua-alchemy-dev/3bDPk2aQ8FE

+

http://stackoverflow.com/questions/862256/how-can-i-end-a-lua-thread-cleanly

+ + + +

 

+

onefangs implementation ideas

+

I'm gonna write an LSL script engine in Lua and C. At least initially, I'll pretend I can use SledjHamr instead of OpenSim, and see how far I get. The source is at https://github.com/onefang/SledjHamr on the experimental branch.

+

 

+

You're in a maze of twisty little quirks, all different.

+

LSL is known for being more quirks than features. Some of the quirks are just limitations that we can get rid of. Some we will have to replicate just to be compatible. OpenSim adds it's own quirks on top of those, but one of the points of doing this is to avoid that particular set of quirks. I'll create two variations, using the first line comment hack OpenSim invented to choose between them. The default is to use the quirky one, where an effort is made to replicate the full quirkiness of LSL. The other choice has no quirks at all, and even lets Lua features be mixed in. This Lua flavoured LSL will be the first one to work on, as it will be a lot easier.

+

 

+

Making Lua look like LSL

+

There are syntactic differences between LSL and Lua. Although Lua is good as a metalanguage, those syntax differences wont go away by themselves. I think some sort of preprocessor would be needed to massage LSL into Lua as a first step in compiling.

+

The preprocessor would have to start by parsing the LSL code into some sort of useful structure. Since the whole point of this exercise as that the OpenSim Xengine sucks, and it's written in C# anyway, don't want to use that. The Aurora script engine likely sucks less, but is still C#. The standard viewer source code includes an LSL parser written using flex and bison. It looks like C code, with C++ wrappers to wedge it nicely into the rest of the viewer code, but it generates C++ code full of LL classes.

+

A test harness could be constructed using EFL Edje Lua to provide some push buttons that can trigger LSL events, provide dialogues, and display various state info. I think a good start is to put the MLP scripts and their notecards / animations into a directory, call that directory an Object, perhaps even implement some of the rest of SledjHamr with some object meta data (MLP will need access to the objects description). MLP is a good test subject, it tends to soak up a lot of sim resources, it's interface to the world is minimal, and it would exercise a lot of the non world interfacing stuff.

+

For reference, here is Lua reference manual, Lua PIL (for Lua 5.0), LuaJIT, LSL Wiki, and SL LSL portal.

+

 

+

comments and line endings

+

Well, comments get stripped out as part of the compile, so probably should not worry about that. Though the preprocessor will need to understand LSL style comments. LSL uses C++ // style comments, every thing from the // to the end of the line is ignored, as well as C style comments, everything between /* and */ is ignored.

+

In LSL, statements need to end in a semicolon. In Lua, they are optional. So we can just leave them in. Just needed to say that somewhere.

+

 

+

types

+

LSL has fixed type per variable. Lua is dynamically typed, and variables can have any type at any given time.

+

The basic LSL types are -

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSL typeLSL detailsLua typeNotes
integerA signed 32 bit integer, can use hex (integer hex = 0xff;).numberLua numbers are C double-precision floating-point IEEE 754 numbers, though other types can be used when compiling Lua. This will be a problem, they wont be stored faithfully.
floatAn IEEE-754 32-bit floating point value.numberPerfect match, if Lua is compiled as default.
vectorThree floats in the form < x , y , z >. Usually a position, colour, or Euler rotation. Use a table and metatable, or a userdata.
rotationA quaternion rotation, made up of 4 floats, < x , y , z , s >. Use a table and metatable, or a usedata.
keyA UUID, specialised string in the same format as UUIDs everywhere. Can use a string, though perhaps a metatable or userdata would help? While it is true that it's just a string representation of a 32 bit integer, Lua has no way of faithfully representing 32 bit integers.
stringA sequence of UTF-8 characters. They support a few backslash escapes at compile time.stringLua string represents an immutable sequences of bytes. Lua is 8-bit clean: strings can contain any 8-bit value, including embedded zeros ('\0').
listA heterogeneous list of the other data types. Use a table with number keys.
+

 

+

bit operations

+

LSL relies on bit operations, especially for some of it's functions. Lua only grew bit operations in 5.2, which I have not looked at yet. A complication is that Lua numbers are floats by default, so these might not be efficient. LuaJIT on the other hand, has the bit operations built in.

+

 

+

scope

+

This is one of the reasons why we are writing our own script engine. The OpenSim XEngine's scope system is very broken. So we gotta do better than that at the very least. Wont be hard. B-)

+

 

+

Brackets, parenthesis, and braces; oh my.

+

LSL uses -

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSLMeaningLuaNotes
 
()Expression re-ordering.()Exact match.
 
{}Code block.do statements endSee the flow control section for other uses.
 
[]List creation.someList = { "a", varB, 3, functionF(foo) } 
 
<>Vector and rotation creation. Well, since we are doing these as a table, we can use table creating functions.
+

 

+

flow control

+

LSL uses C style flow control, Lua does not. "LSL conditions are evaluated left to right, instead of right to left as in most programming languages." They are also not short circuited. There is no break or continue in LSL.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
LSLLuaNotes
 
+
do
+ {
+   statements;
+ } while (condition);
+
+
+
repeat
+  statements
+until condition
+
+
+
 
 
+
for (initialisation; condition; update)
+{
+  statements;
+}
+
+
+
for variable = e1, e2, e3 do
+  statements
+end
+
+
for variableList in explist do
+  statements
+end
+
+
+
In the first Lua form, variable starts from e1, gets e3 added through each loop, and stops at e2. +

The second form is complicated, see the lua reference manual. It can be rewritten as -

+
do
+  local f, s, var = explist
+  while true do
+    local var_1, ···, var_n = f(s, var)
+    if var_1 == nil then break end
+    var = var_1
+    statements
+  end
+end
+
+
+

Neither is a good match against LSL. To make things worse, the for variables in Lua are all local to the for loop, and it's not safe to change them in the loop. So we can't use Lua for loops to implement LSL for loops.

+

A LSL for loop could be rewritten as -

+
initialisation
+while (condition)
+{
+	statements;
+	update;
+}
+
+

Which can be implemented by a Lua while statement.

+
 
+
if (condition)
+{
+  statements;
+}
+else if (condition)
+{
+  statements;
+}
+else
+{
+  statements;
+}
+
+
+
if condition then
+  statements
+elseif condition then
+  statements
+else
+  statements
+end
+
+
+
 
 
+
jump Label;
+statements;
+@Label;
+
+
+
goto Label
+statements
+::Label::
+
+
+
+

Think this is only in Lua 5.2, and there might be good reasons to not use Lua 5.2, especially since we are using LuaJIT. http://lua-users.org/lists/lua-l/2009-11/msg00061.html might help to explain why.

+
 
+
while (condition) 
+{
+  statements;
+}
+
+
+
while condition do
+ statements
+end
+
+
+
 
+

 

+

count from 0 / 1

+

LSL counts list entries from 0. Negative numbers can also be used to count backwards in a list. Therefore, the last element has index -1. The first element would also have an index of (-llGetListLength(myList))

+

LSL string indices start at 0. Using negative numbers for start and/or end causes the index to count backwards from the length of the string, so 0, -1 would be the entire string. If start is larger than end the substring is the exclusion of the entries, so 6, 4 would be the entire string except for the 5th character. If you wish to include the last character in a string, use -1, -1 , the last two, use -2, -1 , etc. Except for llInsertString().

+

Lua counts tables with a sequence of consecutive integer keys from 1 to the length of the sequence as a special table type with syntax sugar and functions to deal with them.

+

Lua string indices also start at 1. Indices are allowed to be negative and are interpreted as indexing backwards, from the end of the string. Thus, the last character is at position -1, and so on.

+

For strings (and utf8 while we are at it) just create a count from 0 strg library that otherwise duplicates the string library. For tables, do the same with a tbl library, make 0 a first class table index like everything else, then I think we are only left with table constructors like x = ["a", "b", "c"].

+

 

+

functions

+

LSL functions have an optional type (in which case it must return that type), and optional typed parameters. Lua is all dynamically typed, so we can just leave out the types, but check them at compile time.

+

LSL passes function parameters by value. Lua passes by value as well, I think. Tables may be passed by reference.

+

 

+

states

+

LSL states can be dealt with as tables of functions, one per state, with all the usual LSL events stubbed out. So a single metatable will help. A currentState table will point to the current LSL state.

+

 

+

Efficiently running thousands of scripts

+

(As a data point, Anarchadia has 3315 scripts running.)

+

LSL scripts seem to be a good match for Lua states. Each script/state is independent, with no global data shared between them except for what is explicitly sent via communications calls, or calls to the system it's embedded in (the world interfacing). Lua scripts can be run in separate OS threads, which lets us make use of multi core CPUs. It's theoretically not too hard to serialise Lua, so running Lua states can be stopped, sent to some other computer, then restarted (good for attachment scripts when TPing).

+

"luaproc is a concurrent programming library for Lua. It implements an approach, geared towards massive concurrency support, which uses multiple independent lua_States as lightweight user threads ("Lua processes") and kernel threads as workers." Sounds like a good match, except it seems to be more an experiment for an academic paper than something useful. It is on github, with recent changes, well, recently added. https://github.com/askyrme/luaproc

+

Lua has cooperative multitasking, but not pre-emptive. LSL is event driven, and no event processing should take forever. However, we would still need to deal with badly written scripts with infinite loops in them.

+ +

I just had a thought. It might be worthwhile doing some typical compiler optimisations. Should see if doing that to the LSL helps. The Lua compiler might do that for us anyway, but certainly worth investigating. On the other hand, LuaJIT probably does most of that for us anyway. Might not be worthwhile.

+

 

+

hacking up Lua source

+

I was hoping to avoid it, but I think we may have to hack up Lua source and not use any system supplied Lua library. The main reason is integers. LSL scripters expect integers to behave like 32 bit signed integers, not like 32 bit floats. So that's gonna cause no end of problems unless we have a a native 32 bit signed integer type in Lua. We can't just compile Lua to use 32 bit signed integers for it's number type, as then LSL floats get broken.

+

Things we should hack up Lua source for -

+ +


Things we could hack up the Lua source for if we are gonna do it anyway -

+ +

Looks like LuaJIT gets us part of the way there, and it's supposed to be the fastest scripting language around, not much slower than C. Some of the above hacking wont be needed. It's a drop in replacement for Lua 5.1, but it has extras as well, some from 5.2, some already mentioned above in the hacks we night need to do. It has FFI, which also speeds up linking to C code, but that's very dangerous low level code. Should see if we can use it, THEN sandbox it away. See this link about sandboxing - http://osdir.com/ml/general/2011-02/msg23395.html

+

 

+

Hooking it up to OpenSim

+

OpenSim has a mechanism for each script to choose the script engine it will run under, and even the language used. The first line of the script is interpreted by OpenSim if it's a comment. If it's not proper, OpenSim bitches about not being able to load a non existent script engine. Some examples of existing supported first lines -

+ +

If no language is added after the colon, LSL is assumed. We will use that, and add -

+ +

As before, if that line is not there, then the default OpenSim script engine and language is used, which these days is XEngine and LSL. The default language for LuaSL will be LuaSL, which is a hybrid of LSL and what ever Lua syntax that can't be mistaken for LSL syntax. In other words, it's LSL, but any Lua code that the LSL parser does not barf on simply gets passed through to the Lua compiler. //LuaSL:Lua means the script is purely Lua code. Though perhaps that should be --LuaSL:Lua, to be compatible with Lua? //LuaSL:lsl means that the script is purely LSL code, no Lua will be tolerated.

+

//LuaSL:LuaSL is what I'm writing to start off with, as it's the simplest thing to do. Well, OK, Pure Lua would be simpler, coz I could leave out the LSL parser stage, but that bit is half done anyway. Either way, the big part of the job is writing all those LSL functions, especially those that deal with the world.

+

Ewww, will have to write C# stubs for OpenSim interfacing. Using a nails command pump as the intermediary sounds like a sane approach, as we will have to end up with one of those anyway. LuaSL will be a separate process, running scripts in threads, with a base control thread. The base control thread will handle our end of the nails command pump.

+

 

+

non world interfacing functions

+

Some LSL functions don't need to actually interface with the world, we can do them in the script engine without needing to bother OpenSim. Things like list handling functions, strings, maths, etc.

+

 

+

stepping outside the world

+

LSL has functions for dealing with email, HTTP, and XML-RPC. Now we could implement those systems ourselves, but to start with might be easier to just use the OpenSim implementation. Doing it ourselves may screw with internal state of OpenSim if it's doing those things for non LuaSL using scripts. Or they might fight over open ports and such.

+

 

+

getting world events

+

What ever 'orrible method OpenSim uses to get in world events to scripts, we will have to capture and send to our shiny new script engine.

+

 

+

changing the world

+

When our scripts want to change the world, we will have to convince OpenSim to do that for us. If we are really lucky, we can talk directly to the asset server. Might be able to just talk to the sims local database, but that gets tricky if the script engine is NOT running on the sim server, which is a possibility we want to keep open.

+

For the functions that get and set prim properties, we should use wrappers around llSetPrimitiveParams() and friends. The Nails protocol is partly based on those functions, so this will work out well for the future, when we move to a Nails command pump.

+

 

+

Lifestyles of the rich and infamous... er I mean life cycle of a script, and communications with the engine.

+

Scripts start life currently in OpenSim, will get sent to the script engine to be compiled, than started or stopped, eventually might get deleted. While they are running, the script engine requests in world services, and responds to events. Each of these things needs OpenSim and the script engine to refer to specific scripts, can use script UUIDs for that. My basic idea is to run the script engine as a separate process, communicating over a socket to the OpenSim processes. Initially, just for ease of implementation, I'm thinking of sending function calls and parameters as Lua function calls, and getting the results back as Lua values. We can use Lua table syntax to provide the script UUID, which will be called "SID" in the following discussion.

+

It's really quite arbitrary whether OpenSim or LuaSL will be the server end. On the one hand, when we are using nails, the central nails command pump is currently being talked about as if it's a server, with every thing else, including the script engine, being clients. On the other hand, the script engine might be better off as a ROBUST service. which implies it's a server, though a server hiding behind the ROBUST proxy. I guess you could look at it as OpenSim is using the script engine as a server that runs scripts, and the script engine using OpenSim as a server to run certain functions is only a temporary measure. Have to make a decision one way or another - Deciding to have LuaSL run as the server end, OpenSim as the client end. Later I'll add the ability to read the OpenSim config files to LuaSL, but for now the default hard coded port will be 8211.

+

Note that the final goal is to move as much of the OpenSim script functionality to the script Engine as possible. Later we will be replacing other bits of OpenSim as well, this is just the first part. So some of these communications might be inefficient, and might stay that way, but still could speed things up if that's not too hard. This is just a preliminary suggested protocol to get things up and running quickly. From my experiments, looks like it might be best to restrict this temporary protocol to function calls and returned values.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
Life stageOpenSimLuaSL script engine
 
save script +
SID.save([=[
+default 
+{ 
+  state_entry() 
+  {
+    llSay(0, "Saluton Mondon.");
+  }
+}
+]=])
+
+

The [=[ ... ]=] syntax is Lua code for a multi line string. Actually, this is too delicate. What if the script happens to have the end string delimiter in it? Have OpenSim just write the file itself, it already has the script text in memory anyway. Much more robust. Also, later, our special asset "cache" will write them for us anyway.

+
 
 
compile script +
SID.compile(/path/to/script/source)
+
+

The filename can be a URL, or a FILE:// URL, or just a file name.

+
 
 
  Compiles the script. +
SID.compilerError(42,10,"Something icky here!")
+SID.compilerWarning(123,38,"Eww, you did not mean that, surely?")
+SID.compiled(false)
+
+
+

That's line number, column number, and error message in the first two. true or false in the last one to show if it finish OK, or gave up.

+
 
start script +
SID.start()
+
+
 
 
  Starts / resumes the script.
 
script calls in world ll*() function  +
SID.llSay(0,"Hello World")
+
+
 
 Sends the text to channel 0. 
 
   +
SID.llUnsit("66864f3c-e095-d9c8-058d-d6575e6ed1b8")
+
+
 
 Avatar stands up. 
 
   +
SID.llGetAgentSize("66864f3c-e095-d9c8-058d-d6575e6ed1b8")
+
+
 
  +
SID.return {x=0.45, y=0.6, z=1.8}
+
+

OpenSim sends back a vector.

+
 
 
in world event +
SID.events.detectedNames(
+{
+  "kelly rocket",
+  "onefang rejected",
+}) 
+SID.events.detectedKeys(
+{
+  "01234567-89ab-cdef-0123-456789abcdef",
+  "66864f3c-e095-d9c8-058d-d6575e6ed1b8",
+})
+SID.events.touch_start(2)
+
+
+

Sent as three separate lines, one per function call.

+
 
 
  Calls that event handler in the current state, making sure that calls to llDetected*() return the proper results.
 
stop script +
SID.stop()
+
+
 
 
  Pauses (yields) the script
 
delete script +
SID.delete()
+
+
 
 
  Deletes it's local copy of the script, and it's compiled version.
+

 

+

XMRE?

+

A lot of us came from Meta 7, and some of us liked the Meta 7 extensions to LSL that where part of XMRE. I don't think it's a good idea to just clone XMRE, for a few reasons. Would be much better to just provide similar functionality. Some of it comes for free from Lua anyway, just with a different syntax.

+

This script engine is only gonna be source code compatible, as we are not using Mono like every one else, so no such thing as binary compatibility can be provided. Source code is how scripts travel between grids anyway.

+

There are many scripts from the millions of SL users, going back almost a decade of SL life. This means there are lots of scripts that originated from SL floating around the OpenSim community. Some are open source, some people brought scripts with them from SL that they wrote themselves, some are being used outside of SL with the permission of the scripts authors. It's theoretically impossible to steal script source code from SL, but it can probably be done through social engineering or some such. So I expect there are some illegal copies of SL scripts out there to. The point is, there's LOTS of scripts from SL. This is why SL compatibility is important. There is a huge pool of available scripts from SL.

+

OpenSim added some extensions to LSL, and they are available on all the OpenSim grids, though some might be disabled. There is a smaller pool of scripts available from OpenSim. Scripters in OpenSim expect the those extensions to exist. Being compatible with those extensions would be important, and would help other OpenSim grids adopt this script engine if it turns out to be any good.

+

Meta 7 was much smaller, not around for so long, and most scripts there either came from the SL pool of available scripts, the OpenSim pool of available scripts, or where written in Meta 7 by LSL scripters. I don't think the Meta 7 specific pool of scripts is anything other than small, the pool of scripts that need XMRE extensions is probably minuscule. OpenSim scripters don't expect those extensions to be available. So I don't think that being strictly compatible with XMRE is needed. Those small number of scripts written to use XMRE extensions can probably be converted to what I'm about to propose.

+

I was lucky that kelly managed to save the reference pages from Meta 7 that covered their extensions in detail. I was able to go over them and figure out what to do. The summary is this - we should be able to provide similar functionality as XMRE, but not an exact clone. Lua already has powerful table stuff that is better than the XMRE array stuff, with a similar syntax for those parts that they share. No need to reinvent that wheel. Switch, continue, and exception handling could be treated as just adding things from other C like languages to the LSL C like language. On the other hand, it's gonna be simpler to just let people use Lua style stuff for these things. Writing an LSL scripting engine is already a huge job, the functionality is there in Lua, we could skip implementing the exact C like syntax and get more important things done. We can add in the C style syntax later if there is much call for it. The event stuff I would already be one third of the way there based on my current design. The other two thirds we could get just by designing the rest of that subsystem to suit. After all, not much difference if we store those structures in C or Lua, since it all has to go to Lua anyway. Might as well do it in Lua, and give the scripters access.

+

This XMRE type stuff would be using the //LuaSL:LuaSL engine. Pure //LuaSL:LSL would not have it, and pure //LuaSL:Lua would not need it. So by writing the LuaSL variation first, we get some parts of XMRE like extensions for free, mostly the Lua table stuff that is similar to XMRE arrays, only better.

+

 

+

flow control - break, case, constant, continue, default, switch

+

Lua has no switch (so no case or default either), but since you can store functions in tables, you can fake it easily enough. We can add the "case" part as a set of anonymous functions stored in a switch table; index the switch table with the value of the switch statement to find the correct function to call; use a metatable to detect when a switch value is missing to call the default anonymous function of the switch; have a switch.fallthrough(x) function that just calls the X case function in the switch table. There, done. Though this does not cater for XMRE case ranges. Case ranges are not normally a part of C like syntax. On the other hand, Lua tables can be indexed by any Lua type, so perhaps case ranges can be dealt with in some way. I'm not sure it's important enough to worry about for now, so leaving it off until someone wants it. Hopefully people will be to distracted by the fact they can use ANY type in case statements, and even mixed types, to miss case ranges. Actually, we could use the same mechanism we use for default, it just checks any case ranges that where registered in the switch table before calling default. That's just my quick and dirty idea, there are more here - http://lua-users.org/wiki/SwitchStatement

+

Constant is not really needed, as it's only there to support a limitation of the XMRE case statement. The above implementation has no such limitation, so we can leave it off.

+

There is break in Lua, but no continue. Continue can be done by a jump to a label anyway, though that's a Lua 5.2 addition, and there might be good reasons to not use Lua 5.2, especially since we are using LuaJIT. http://lua-users.org/lists/lua-l/2009-11/msg00061.html might help to explain why.

+

http://lua-users.org/wiki/ContinueProposa would be of interest.

+

 

+

arrays

+

Lua tables have similar functionality to XMRE arrays, but I think are more powerful. So might as well just use them.

+

LSL is statically typed, while Lua is dynamically typed. Which means we don't need to deal with the XMRE array type detection and conversion stuff. Everything is a first class value, and can be stored as table elements, or used as indexes, except the special value nil, which is similar to the XMRE value undef. XMRE arrays use lists for multi dimensional arrays, but Lua does not really have that concept. It's easy enough to store tables in tables though, so sparse matrices can be done. Lua has proper arrays, so long as you don't mind counting from 1, though I think I'll fix that. So for example, you might have a list, and since I'm converting that to a Lua table, you could use Lua table syntax with it -

+
myList[42] = "Life, the universe, and everything";
+llOwnerSay(myList[42]);
+myList[foo + bar] = 42;
+myOtherList["foo"] = myList;
+myOtherList[myList] = 42.0; // Using a Lua table as an index.
+
+
+

That last one is different from what it means in XMRE. XMRE uses lists as array indexes to support multi dimension arrays, Lua just uses it to index the single dimension table element that happens to have a table as the index.

+

Since they are Lua tables, we can do this sort of thing to -

+
myOtherList["myFunc"] = someFunction; // Yes, this is storing the function, not the return value of the function.
+myOtherList["myFunc"](x, y); // Calling the function we just stored.
+myOtherList.myFunc(x, y);  // Same as the last one.
+
+
+

That last one uses a Lua syntactic sugar short cut. It works for table indexes that are strings with no spaces in them. This sort of thing essentially comes for free, since my script engine converts to Lua before compiling that. People that know Lua already know all those fun things you can do with Lua tables, they are quite powerful.

+

Lua table initialisation is a little different, but the LSL parser can handle that -

+
a = {[f(1)] = g; "x", "y"; x = 1, f(x), [30] = 23; 45}
+
+
+

I'll leave it as an exercise for the reader to look up the Lua manual (which that example is taken from) to see what that line does. lol

+

OK, commas and semi colons in that line are interchangeable, they just separate array elements. [30] = 23 means that the table element with the index of 30 is assigned the value 23. x = 1 is shorthand for ["x"] = 1, the table element with the string index of "x" is assigned the value 1. [f(1)] = g means that what ever value that the function call f(1) returns is used as an index, it's value is assigned the value of the variable g (no matter what type it is). The rest don't include any index, so are assigned to sequentially numbered indexes starting from 1. Apart from being more powerful, the only real difference with LSL is the use of {} instead of [] to contain the list initialisers.

+

 

+

exception handling

+

The XMRE exception handling I could not do a clone of anyway, the system exceptions are not specified, except for the divide by zero, and even then I'm not so sure.

+

Lua has it's own sorta exception system, it can probably be bent into this sort of shape, but why bother? The alternative is to add stuff to the LSL parser to turn something like normal C++ / Java style exception handling into the Lua system. Not sure it's worth it, so not coming up with a proposal right now. Could be added later if people want it. http://lua-users.org/wiki/ErrorHandling might be of some interest.

+

 

+

event handling

+

Event stuff is basically - wait for an event in the middle of some function, save and restore the llDetect*() information for event nesting, call an event handler directly, and put an event you got from the first thing back on the event queue. Note, all LSL functions are called from event handlers, or are the event handlers themselves. Lists are used to store the llDetect*() info, and the events returned / put on the queue, as well as invoking the handler direct. I'm sure it's possible to fake these Lists.

+

The method I'll be using to represent LSL states in Lua (as tables with the event handlers stored as functions) already allows direct calling of event handlers anyway. The others are just direct access to the event queue, and to the source of the llDetect*() information so that we may molest them. Sticking the event queue in a table sounds feasible. It would be a good idea to have the llDetect*() stuff in a table with a metatable, where the various llDetect*() functions are functions provided by that metatable. Then they can just stash this table away safely while calling other event handlers direct, passing on a faked up table, or a copy of the original.

+
float timeout = 4.2;
+myEvents = events.wait(timeout, link_message, listen, touch_start);  // Functions are first class citizens, so just pass them to the wait function, which has variable arguments.
+myDetects = events.copyDetects();
+default.link_message(LINK_ROOT, 42, "So long, and thanks for all the fish.", llGetOwner());
+events.detects(myDetects);
+events.queue(myEvents);
+
+
+

Or something like that might be feasible.

+

XMRE can both wait for events, or have them called in the background, then continue waiting for the events it's waiting for. The above events.wait does not do that. We could pass two tables like this -

+
list waitEvents = [link_message, listen];
+list backgroundEvents = [touch_start, touch_end];
+myEvents = events.wait(timeout, waitEvents, backgroundEvents);
+
+
+

 

+

an example

+

This is the current result of compiling the MLP ~pos script (white space adjusted for better readability) -

+
--// Generated code goes here.
+
+local _bit = require("bit")
+local _LSL = require("LSL")
+
+--[[integer]] MAX_BALLS = 6;
+--[[integer]] ch = 0;
+--[[integer]] swap = 0;
+--[[integer]] BallCount = 0;
+--[[string]] pr1 = "";
+--[[string]] pr2 = "";
+--[[integer]] Zoffset = 0;
+--[[vector]] RefPos = _LSL.ZERO_VECTOR;
+--[[rotation]] RefRot = _LSL.ZERO_ROTATION;
+.
+  
+function getRefPos()
+  RefPos=_LSL.llGetPos();
+  RefRot=_LSL.llGetRot();
+  Zoffset= _LSL.integerTypecast(_LSL.llGetObjectDesc());
+  RefPos.z --[[+=]] = RefPos.z +  --[[float]] Zoffset / 100.;
+end
+
+--[[list]] Pdata = {};
+  
+function getPosNew( --[[string]] pdata)
+  Pdata = _LSL.llParseString2List(pdata, {" ", }, {});
+end
+  
+function setPos()
+  pr1 = --[[string]] ( --[[vector]] _LSL.llList2String(Pdata, 0) * RefRot + RefPos);
+  pr2 = --[[string]] ( --[[vector]] _LSL.llList2String(Pdata, 2) * RefRot + RefPos);
+  pr1 --[[+=]] = pr1 +  --[[string]] (_LSL.llEuler2Rot( --[[vector]] _LSL.llList2String(Pdata, 1) * _LSL.DEG_TO_RAD) * RefRot);
+  pr2 --[[+=]] = pr2 +  --[[string]] (_LSL.llEuler2Rot( --[[vector]] _LSL.llList2String(Pdata, 3) * _LSL.DEG_TO_RAD) * RefRot);
+  if (BallCount>1) then
+    _LSL.llSay(ch + swap, pr1);
+    _LSL.llSay(ch + not swap, pr2);
+  else
+    _LSL.llSay(ch, pr1);
+  end
+  local  --[[integer]] ix = 0;
+  local function _preIncrement_ix() ix = ix + 1;  return ix;  end
+  ix = 2;
+  while (ix<BallCount) do
+    _LSL.llSay(ch + ix,  --[[string]] ( --[[vector]] _LSL.llList2String(Pdata, 2 * ix) * RefRot + RefPos) ..  --[[string]] (_LSL.llEuler2Rot( --[[vector]] _LSL.llList2String(Pdata, 2 * ix + 1) * _LSL.DEG_TO_RAD) * RefRot));
+    _preIncrement_ix();
+  end
+end
+
+function getChan()
+  ch= _LSL.integerTypecast(("0x" .. _LSL.llGetSubString( --[[string]] _LSL.llGetKey(), -4, -1)));
+end.
+
+--[[state]] _defaultState = {};.
+
+_defaultState.state_entry = function()
+  getRefPos();
+  getChan();
+end
+
+_defaultState.on_rez = function( --[[integer]] arg)
+  getRefPos();
+  getChan();
+end
+
+_defaultState.link_message = function( --[[integer]] from,  --[[integer]] num,  --[[string]] cmd,  --[[key]] pkey)
+  if (cmd == "PRIMTOUCH") then
+    return;
+  end
+  if (num == 1 and cmd == "STOP") then
+    swap = 0;
+    return;
+  end
+  if (num) then
+    return;
+  end
+  if (cmd == "POSE") then
+    local  --[[list]] parms=_LSL.llCSV2List( --[[string]] pkey);
+    BallCount=_LSL.llList2Integer(parms, 1);
+    return;
+  elseif (cmd == "POSEPOS") then
+    getPosNew( --[[string]] pkey);
+    setPos();
+  elseif (cmd == "SWAP") then
+    swap= _bit.band( _LSL.integerTypecast(( --[[string]] pkey)) , 1) ;
+    _LSL.llSay(ch + swap, pr1);
+    _LSL.llSay(ch + not swap, pr2);
+  elseif (cmd == "REPOS") then
+    getRefPos();
+  elseif (_LSL.llGetSubString(cmd, 0, 0) == "Z") then
+    local  --[[integer]] change = 0;
+    if (_LSL.llGetSubString(cmd, 1, 1) == "+") then
+      change = _LSL.integerTypecast(_LSL.llGetSubString(cmd, 2, 10)) ;
+    else
+      change = _LSL.integerTypecast(_LSL.llGetSubString(cmd, 1, 10)) ;
+    end
+    Zoffset --[[+=]] = Zoffset + change;
+    RefPos.z --[[+=]] = RefPos.z +  --[[float]] change / 100.;
+    setPos();
+    _LSL.llOwnerSay("Height Adjustment: change by " ..  --[[string]] change .. "cm, new offset: " ..  --[[string]] Zoffset .. "cm");
+    _LSL.llSetObjectDesc( --[[string]] Zoffset);
+  elseif (cmd == "GETREFPOS") then
+    _LSL.llMessageLinked(_LSL.LINK_THIS, 8,  --[[string]] RefPos,  --[[string]] RefRot);
+  end
+end.
+
+_LSL.stateChange(_defaultState)
+
+--// End of generated code.
+
+
+ +

Here's a wild idea - streaming source code. Start feeding the .lua files to the compiler when you start downloading it, so it compiles as it's downloading. Dunno yet if that would help, might just get stuck early on waiting for the entire file.

+ +


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

+ + diff --git a/docs/SledjHamr/README.Bookie b/docs/SledjHamr/README.Bookie deleted file mode 100644 index bec4b19..0000000 --- a/docs/SledjHamr/README.Bookie +++ /dev/null @@ -1,33 +0,0 @@ -Shared dynamic libraries is a bit of an issue for cross platform code. -LL viewers deal with it by including their own copies of the libraries -they use. This bypasses the idea of sharing them, and thus uses too -much resources. On the other hand, it seems to be the Windows way of -doing things, lots of Windows packages I have seen include their own -copies of libraries. Mac Os X seems to do the same, each application is -installed as it's own directory, filled with it's own copies of -libraries. Not a lot of sharing going on. Linux and the BSDs do the -right thing, most libraries are actually shared. Except that LL viewers -STILL bring their own libraries. - -I think the main difference is having a proper package management -system. Apt, RPM, and portage (I think) can track dependencies on -libraries, install the libraries automatically, and even have different -versions of libraries installed side by side. Without this, the OS has -no official way of tracking library dependencies, so every one has to -supply their own. Sure Mac OS X has had a few package systems ported to -it, but none of them are the official one, so developers can't rely on -them. - -SledjHamr has to deal with this, and try to do so in some sort of smart -way. As usual, the right way to do things is generally to do the -opposite of what LL does. lol - -Bookie should be a sub system that probes the OS, trying to see if -there's some sort of OS store of libraries, and try to find reasonable -versions of the libraries needed in that. If not found, it could invoke -an OS specific method of installing a suitable library. If that fails, -it can download a SledjHamr specific version into the SledjHamr -installed directory. So it tries to do the right thing first, and -gradually falls back to doing the wrong thing like LL does. - -That's the theory, in practice, gonna be a pain. diff --git a/docs/SledjHamr/README.libraries b/docs/SledjHamr/README.libraries deleted file mode 100644 index 8b99b7f..0000000 --- a/docs/SledjHamr/README.libraries +++ /dev/null @@ -1,34 +0,0 @@ -There are some base libraries that should be used in common. Notable -the Enlightenment Foundation Libraries (EFL), Irrlicht, lemon, LuaJIT, -and luaproc. Other external open source projects that we just use -directly should go here to. Makes it easy to compile it all. - -Note that in some cases, there might be changes. Such changes should be -documented, and marked with "// onefang changes". - -EFL has been released, so not including that anymore. You can find it -in distro repos, PPA's, etc. Or http://enlightenment.org/ - -Irrlicht has been slightly modified to get it to use externally created -GL stuff, and not use their internal copies of bzip, jpeglib, libpng, -and zlib. - -Lemon is from http://www.hwaci.com/sw/lemon/. - -LuaJIT 2.0 has been released for Ubuntu 13.04 and later, try using -https://launchpad.net/~mwild1/+archive/ppa for 12.04. Not including -that anymore. - -luaproc has been hacked up a bit, and will continue to be hacked up. -Merged it into LuaSL, so it's no longer here. Then replaced it -completely. - --------------------------------------------------------------------- - -These are the libraries written for the SledjHamr project. - -libLumbrJack is a library of logging stuff, coz every one wants to log. - -libRunnr is for running Lua scripts. Named (sorta) after a friend of mine. - -libSledjHamr is a motley collection of stuff that is needed. diff --git a/docs/SledjHamr/The_Naminator.txt b/docs/SledjHamr/The_Naminator.txt deleted file mode 100644 index 0002d2e..0000000 --- a/docs/SledjHamr/The_Naminator.txt +++ /dev/null @@ -1,14 +0,0 @@ -The Naminator eliminates human readable names, to make way for computer -names from SkyNet. Or something. - -In world names can be anything, but they map more or less to file names -and URLs, so the names have to be munged accordingly. A further issue -is that different in world objects can have the same name. Lots of -copies of the same thing, or two different things that happen to be -called the same thing. No one is gonna individually name each tree in a -forest, or every lamppost in the city. File names and URLs have to be -unique. The Naminator deals with munging names to deal with these -issues. It should generate names that are compatible with a variety of -operating and file systems, as well as being URL compatible. This is -such a useful thing to do that it should be a shared library, even if it -will be tiny. diff --git a/docs/SledjHamr/no_accounts.txt b/docs/SledjHamr/no_accounts.txt deleted file mode 100644 index 5ecbe08..0000000 --- a/docs/SledjHamr/no_accounts.txt +++ /dev/null @@ -1,29 +0,0 @@ -We don need no stinkin' accounts. - -We don't really need accounts, so we can do away with them. Though -obviously since SledjHamr is designed to be a flexible set of tools -rather than one big take it or leave it system, people can use what ever -accounts system they need for their purposes. SledjHamr not only doesn't -impose an accounts system, we eliminate the need for one in the general -case. So we don't have to write one. B-) - -When a user fires up the extantz client for the first time, it can use -their local computer account name as the users name (I think most -operating systems make you create one when you install them). Extantz -could also do a reverse DNS lookup on the computers IP, and likely end -up with an ISPs dynamic IP reverse mapping, or maybe a real domain name. - -Extantz then tries to connect to a love server running on the same -computer, or starts one if it can't find one. This local love server by -default runs a small grid, with maybe a nice little cottage, and a star -gate. This is the users home, they can do what ever they like with it. - -The star gate works similar to current OpenSim hypergates, linking to -external grids and allowing HyperGrid access to them. Since the user -already has a local name and domain name, with the local love server -acting as the users home HyperGrid server, they are good to go visit -other grids. No real in world account need ever be created. - -The drawback is that the virtual worlds will be filled with lots of -root@123_231.bigisp-dyn.com users. Naturally it should be simple for -users to change the default name to anything they want. diff --git a/docs/SledjHamr/portals.txt b/docs/SledjHamr/portals.txt deleted file mode 100644 index 28498c2..0000000 --- a/docs/SledjHamr/portals.txt +++ /dev/null @@ -1,106 +0,0 @@ -SledjHamrs killer feature, or one of them. - -A major reason for SledjHamr is to break down the garden walls. We do -this by allowing free travel between peoples virtual worlds. In OpenSim -this is done by HyperGrid, which is clunky and hard to use. Second Life -deliberately has no such system. Even worse, it's hard convincing people -in SL to visit your grid, coz it's all very hard, again due to -deliberate policy decisions by LL. LL knows their content is the key to -their business, even though almost all of it was created by the users, -LL locks it up tight. So people visiting OpenSim grids from SL have to -create a new avatar from scratch, which is such a major pain that most -people baulk at that and don't bother. And they can't bring their -inventory with them, inventory they paid for and spent years collecting. - -In SledjHamr, as well as allowing completely unrestricted and easy -access to lots of content, we should make it easy to travel between -virtual worlds. Part of this is to include compatibility layers in -separate modules to be compatible with what ever virtual world systems -are around. You would still need to create accounts and log onto those -worlds though. How can we mix them up? I imagine easy to use portal -objects. Let's start with the basics, and work out some more complex -examples. - -As mentioned in the no_accounts.txt document, every SledjHamr user has -their own little world running on their computer by default when they -start up the extantz client. There is a star gate on this default -world, an already setup portal that can connect to a bunch of default -external worlds. The user can use this star gate, and other peoples -portals to travel around other peoples worlds. Initially this could be -using OpenSim and its HyperGrid system. Later it would be SledjHamr -style worlds as well. - -A portal would be like Cobalt style portals, you can see the destination -in real time, and step through it to go there. They can be permanent, -or temporary. You can carry them in your inventory, they could just be -normal scripted in world objects. - -So you travel around the virtual worlds, meeting people, and you want to -invite some one to your home, or a group of people. You right click on -them and select "Invite them home" from the menu. Extantz knows your -home world, that's where you started and it's running on the same -computer. Extantz communicates to that home server, or starts it up -first. The home server adds this new person to it's access list. -Extant creates a portal object and offers it to the person, so they can -rez it anywhere. Or you could rez this portal object in the world you -are in. Either way, once the portal is in a world, it connects to your -home world, showing a view of your front gate, maybe including your -lovely garden in your front yard. The portal connects to the "front -gate" of your home world. - -Any one on your home worlds access list can step through this portal to -get to your home world. Simple to use, no figuring out HyperGate URLs -and copy pasting them, no manual messing with hard to use access systems. -Though it would still be possible to create URLs to in world places, to -store as landmarks, to email to someone, or to copy'n'paste into -farcebook. - -Portals rezzed in world could be temporary, and vanish after who ever -you invited to come stepped through it. Or time out several minutes -later so as not to clutter the universe with left over portals. Or -deleted by the owner / managers of the world you left them, or deleted -yourself from your own world. Portals could be permanent. Say you -found a larger world that you and the owner decide you wish to be a part -of. Portals could be left on both worlds linking them. The "portal" -could just be reconfiguring each world to locate the other world near -them, like neighbouring sims. Still, that should be done via the portal -interface, just a simple click. - -Portals can be fully open if you want to run a public world. People can -be banned. Or private worlds with specific groups and people allowed. -Similar to many web sites, you could have your own account system on -your world, people with accounts are allowed to build, or allowed to -with certain limits, or are the only ones allowed to visit. Privacy can -be applied to the portal, only those that can step through can see -through, or semi private, you can see a limited area, but not step -through. A portal could include a "door bell", people that want to -visit ring the door bell, someone might answer and let them in, but can -chat with them across the portal first. Perhaps getting dressed first. - -For those hard to reach places, I'm looking at you SL, a portal could be -coded as an LSL script in a SL prim object that you keep in your SL -inventory. It can operate in two modes, depending on who is looking. -If someone using a SledjHamr aware client looks, they see the usual -portal view mentioned above, and can easily step through it as usual. -Others would see a still photo of the view through the portal, or -perhaps a live video stream if the other world server has enough -bandwidth to support that. Or they could see just a logo if the world -owner hasn't bothered to pay LL to upload a suitable photo. If the user -of the viewer that is not SledjHamr aware clicks on or tries to step -through the portal, they are sent to a web page that lets them download -SledjHamr aware clients, with instructions on what to do to actually get -to that world. - -Once a user of that closed world steps through the portal using a -SledjHamr aware client, their client knows what that person looks like, -and has access to that persons inventory in that closed world, so they -can bring it all with them with no need to do anything other than step -through. The user remains logged on to the closed world, coz SledjHamr -needs no actual accounts. What their avatar is left doing in the closed -world for others to see is an open question. Perhaps sitting on some -chair on the portal prims, snoozing. Just had a better idea, the user -gets a new tab, in their original world they can wander off again and do -stuff, and in the new world they can do new stuff. Likely LL will ban -this in their TOS, and ban SLedjHamr aware viewers, they are anal like -that, and want to own your content to keep people locked in their walled -garden. Here's a SledjHamr for you all, break those walls open. B-) diff --git a/docs/SledjHamr/privacy.txt b/docs/SledjHamr/privacy.txt deleted file mode 100644 index 992867b..0000000 --- a/docs/SledjHamr/privacy.txt +++ /dev/null @@ -1,5 +0,0 @@ -There is more to come on this subject, but I just want to make a quick -note about stuff a friend just brought up. - -For people that share their computers, should have master passwords for -each user, and encrypt accounts, logs, log out photos, settings, etc. diff --git a/docs/common/BlackListAssetServersTracker.html b/docs/common/BlackListAssetServersTracker.html new file mode 100644 index 0000000..d080e87 --- /dev/null +++ b/docs/common/BlackListAssetServersTracker.html @@ -0,0 +1,37 @@ + +BlackListAssetServersTracker + + + +

Late night realization about multiple asset servers and Censorship and such.

+

(04:33:43 AM) alice_crush: Oh!

+

(04:36:29 AM) alice_crush: What if we let folks run more than one inventory asset server, and make some asset servers private/subscription. Which just means if a person takes no action they'll never see an asset from a private server. *Then* say folks in Japan can have a sim full of nasty lolicon, and folks from countries that make it illegal to see such pictures won't ever be accidentally exposed. *And* the grid will stay 'pure' never serving "bad" images. "Hey idiot, if you choose to download illegal content, don't complain to us!"

+

(04:38:17 AM) alice_crush: so you could walk around in a t-shirt with a grossly illegal image on it, and unless someone is subscribed to the right asset server they just see gray.

+

(04:39:07 AM) alice_crush: have to get to like phase 2 or whatever, not the stop gap quick fix proxying feature

+

(04:40:26 AM) onefang: That goes to the whole "Hey it's just a web server, you can implement whatever access policy you want" thing.

+

(04:40:53 AM) onefang: "You are not authorized to see this t-shirt.".

+

(04:41:04 AM) alice_crush: though would need some special client side controls/subscriptions something like that.

+

(04:41:26 AM) onefang: "Knomes stole this skirt, quick get hippos."

+

(04:41:34 AM) alice_crush: "This texture above your security grade" lol

+

(04:43:07 AM) onefang: "These are not the clothes you are searching for."

+

(04:43:10 AM) alice_crush: minor issue of when uploading a texture specifying which asset server it goes to...

+

(04:44:03 AM) alice_crush: you could give me your illegal images (drawing of the profit, peace be on him) I could put them out in my sim, and never see the blasphemy myself

+

(04:44:33 AM) onefang: Well, no, that's the whole point of allowing multiple inventory stores. You get to manage them, decide what goes where. Sometimes using ordinary web CMS software, or a file browser for local ones..

+

(04:45:37 AM) alice_crush: Hmmm maybe folks could sell say a pg skin and a X version, and folks could choose to avoid the X asset servers... and not see grey people.

+

(04:46:20 AM) alice_crush: Lol, theres always a clever policy choice that makes the thought police un necessary.

+

(04:46:47 AM) alice_crush: LL will hate it (Breaks the shared experience rule)

+

(04:47:00 AM) alice_crush: OS will probably hate it too

+

(04:48:08 AM) onefang: I'm not particularly worried about pissing off those two groups.

+

(04:48:37 AM) alice_crush: I would rather make thought police optional, then market forces will eliminate them.

+

(04:48:02 AM) alice_crush: some day could have certificates for asset servers, collect them in classes "PG servers", "IP Clean servers" lol

+

 

+

More linear description of above

+

Imagine that texture assets can come from multiple sources. When a sim tells your client about a texture it only tells you an ID, your client has to find out which server has the resource for you.

+

Imagine your client has a list of servers to try, it can simply go through the list of servers stopping as soon as a server gives a response.

+

Imagine that some of the servers in the list come from standard places such as the sim. Imagine that other of the servers come from a manually selected list of private subscription servers.

+

Say I am in simulator 101, I get told about a resource named "409" from the simulator. I check all the asset servers I know. If I don't find it, I show a blank/gray texture.

+

You might be in the same simulator, and you get told about the same resource named "409" by the simulator. In addition to the simulator though, you have a private server you can check, and there you find resource "409" so you client can draw it for you.

+

In this way you and I looking at a third person might see something different. You see the third person wearing a shirt with the logo of a sports team. I see a very plain gray 'slider' shirt, not even with textures cuffs and hems.

+


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

+ + diff --git a/docs/common/NGIW.Commands.html b/docs/common/NGIW.Commands.html new file mode 100644 index 0000000..c058a6f --- /dev/null +++ b/docs/common/NGIW.Commands.html @@ -0,0 +1,46 @@ + +NGIW.Commands + + + +

In a virtual world there are many places where an actor (either an avatar directed by a human, an avatar directed by a program (bot), or a scripted object) wants to do something to an object. Something other than just directly change a property of the object. The LSL programming model is that scripts react to events. So I propose we unify commands, LSL events and REST by manipulating even queues.

+

 

+

Proposal

+

If http://sim.ulat.or/obj/oid is the url to some object with id oid, and we have a http connection to http://sim.ulat.or then

+ +

And maybe

+ +

 

+

What a PUT really sends to the server

+

Supose we are telling the server about the avy touching an object. The actual text that gets sent might look like:

+
   PUT /obj/oid/eq HTTP/1.1
+   Host: sim.ulat.or
+   Content-Type: application/json
+   Content-Length: xxxx
+   
+   {"touch_start":{"force":13,"avy":"uuid","time":1311663233}}
+
+

So you can see it is fairly heavy weight compared to a tuned command language. I will investigate what subsequent requests look like when using the http 1.1 persistent connection features. At the worst the http overhead can be amortised across many commands by using the last two forms of request. The last would look like:

+
   PUT /eq HTTP/1.1
+   Host: sim.ulat.or
+   Content-Type: application/json
+   Content-Length: xxxx
+   
+   [{command1...},{command2...},...]
+
+ + diff --git a/docs/common/NGIW.html b/docs/common/NGIW.html new file mode 100644 index 0000000..dfe6f83 --- /dev/null +++ b/docs/common/NGIW.html @@ -0,0 +1,50 @@ + +NGIW + + + +

See also SledjHamr

+

Random thoughts about Next Generation Immersive Web, or whatever we call it.

+

Here I want to indicate a possible design direction. The buzzword compliant summary is HTTP 1.1, REST and JSON.

+

I don't want to descend into the actual messy details here, so I will make some simplifications. I will assume a simplified world where there are only two kinds of things, boxes and textures. Boxes have a position, a rotation, a size, and a single texture. The software architecture will be simplified to two elements of software, the simulator and the client.

+

Suppose the simulator is at http://simulat.or/sim01 .

+

Then, per usual REST design, to ask about box 104, the client would "GET /sim01/object/b104". Similar to opening http://simulat.or/sim01/object/b104 in a web browser.

+

The sample response might be

+
   {   "at":1000,
+       "id":"b104",
+       "p":[1,1,1],
+       "r":[0,0,0,0],
+       "s":[0.5,0.5,0.5],
+       "t":"/sim01/texture/t104" }
+
+

This is a really important data structure, it is the representation that forms part of the REST acronym. Since we are talking about a simulator, it isn't really complete to say an object has a certain position. In a simulator all properties of objects are dependant on time. The "at" field encodes some time representation. Probably something like Unix time * 1000, aka the number of milliseconds since 1970 UTC. The "id" field is the name of the object. The "p" field is the position encoded as a JSON array of 3 numbers, the "r" the rotation (quaternion) encoded as a JSON array of 4 numbers, the "s" the size encoded as a JSON array of 3 numbers, and "t" is the texture.

+

Since we are talking to a web server, and since we want to sometimes reference textures from other places than the simulator, the value of the texture is a URL. In this case a relative URL that leaves out the server, thus meaning the full URL to the texture is "http://simulat.or/sim01/texture/t104". If the client needs the texture it can do a GET of "http://simulat.or/sim01/texture/t104". There are ways to further compress this information, but let's not fix what isn't broken.

+

Supose the user moved the box up 1 meter by some manipulation of the client. The client would "PUT /sim01/object/b104" with the data

+
   {   "at":1001,
+       "id":"b104",
+       "p":[1,1,2],
+       "r":[0,0,0,0],
+       "s":[0.5,0.5,0.5],
+       "t":"/sim01/texture/t104" }
+
+

Always transfering the full representation of an object could be wasteful and error prone so I slightly bend REST. I will use POST to an object to transmit only the changed fields. So "POST /sim01/object/b104" with the data

+
   {   "at":1001,
+       "id":"b104",
+       "p":[1,1,2]  }
+
+

would cause the same change in the simulator state.

+

To get the current state of the world "GET /sim01/object" would reply with all the objects. In this case it would be a JSON array of JSON objects similar to the first example above:

+
   [   {"at":999,"id":...}, {"at":999,...} ... ]
+
+

But, look what happens when we understand that the reply is using chunked encoding. The simulator might not actually ever finish sending the state of the world. The client might get

+
   [   {"at":999,"id":...}, {"at":999,...},
+
+

in the first chunk, and more

+
   {"at":1000,...}, {"at":1001,...}, ...
+
+

in the second chunk. And so forth. Again, sending all the fields of all the objects, even for just the changed objects is wasteful. I see a few ways to go.

+

If the server knows it has sent a full description of an object to a client, then future updates would, like the POST, only include the changed parts of the object.

+

Alternatively, lowering the load on the server, the client closes the "GET /sim01/object" connection at some point, and does "GET /sim01/object?delta". At that point only updates are ever sent. If the client sees a change to some object it doesn't recognise, is opens a second connection and requests "GET /sim01/object/b999" for example to get the full description.

+

The third alternative is that all the server ever sends in response to "GET /sim01/object" is a stream of changes. If the client doesn't have enough information to render an object, it can query the individual object as in the first example.

+ + diff --git a/docs/common/Nails.html b/docs/common/Nails.html new file mode 100644 index 0000000..152549d --- /dev/null +++ b/docs/common/Nails.html @@ -0,0 +1,2519 @@ + +Nails + + + +

Putting it all together

+

This is where onefang starts to get his hands dirty, though I'll mostly be talking about the modules of the basic architecture that deals with the objects in the world. Most everything else could be dealt with as mostly stand alone pre existing software (jabber, mumble, etc), though some of those would still need to get their hands on some of the data.

+

In this part I'll use the term "client" to refer to anything thing talking to a server, even if it's another server. "Viewer" means the users client that they use to interact with the virtual worlds. "Virtual world" is any group of sims linked together, the equivalent of a 3d web site in this web centric model of virtual worlds. "Sim" is the equivalent of a web page. "Engine" will be any server module that deals with a particular active function. "Object" could be link sets, prims, mesh objects, avatars, the sim itself, or perhaps other things that are tracked per sim. "Data" is any property of an object in the sim that can be sent in a single command, which might consist of several values. "Value" is a single basic property of an object, though it could be a vector, rotation, URL, or other complex data type. "Command" is a something sent from one module to another stating that some data has changed on some object. An example command might be something like "command=value,value,<1.2.3>,"string". "Assets" are any non object thingy that might be part of an object, like textures, scripts, etc. Not so sure if there should be that distinction between object and asset though. Though assets generally don't change, or have "data".

+

The various modules could pretty much be written in any language, it's the protocols between them that is important. Even then, the form of the protocols should be somewhat flexible as well. I'll insist on the central form of the protocols to be tight binary, but lots of people have a co-dependent relationship with abusive things like XML. Slightly saner people might prefer JSON, perhaps BSON, or plain name=value pairs. And just coz everyone else gets to have their favourite bloated human readable text format, I'll add my own MTRX from years ago. I'll be writing my version of the modules in C, with threats of assembler. Others could write things in scheme, smalltalk, PHP, ruby, C#, javascript, or any other less efficient language.

+

The basic modules would be the viewer, the script engine, the physics engine, the sim data store, the inventory data store, and the command pump. Since this is a web centric design, there are web servers involved to. There can be any number of each of these modules, perhaps even a changing number on any given sim, for load balancing or redundancy reasons.

+

 

+

command pump

+

Quite literally, this would be the heart of the system. It's job is to manage the exchange of changes to in world objects between everything else. These changes are always expressed as commands. More about this later.

+

 

+

inventory data store (we should call this "hammerspace")

+

Stores part of a users inventory, and serves it to sim data stores, or other users inventory data stores. This could probably be just a web server, it's protocol would be ordinary HTTP/S sending files around. Generally the files would be protected, only being sent to those that are authorised to get any individual file. The inventory's owner would have complete control. It's two main tasks are to send individual objects to sim data stores, and to send individual objects, or entire folders of objects, to other users inventory stores. All of this is initiated by the owner manually. Some method for the user to manage their inventory objects would be needed, but the world is already full of ways to manage web server contents, so don't need to mention them further. Though perhaps using WebDav as a standard method would be a great idea. It may even be possible for multiple users to manage any given inventory data store, say via a typical CMS system. Public inventory data stores could exist. Shops could just be an ecommerce front end to an inventory data store. It's a web server, any webby thing could be done with it. Objects should be sent as individual files for the purposes of HTTP, though they could be collected and compressed into some archive format when sending lots of them. Folders should be represented directly as paths in the URL.

+

It's entirely up to the web server how it actually stores the objects. I would recommend just storing the commands that define an object, but there will be things like IARs with XML files, exports from other viewers, and such around. Storing just the commands means that they can just be dumped direct to the command pump. XML would have to be translated first. On the other hand, inventories store non object assets, like textures, sound samples, scripts, etc. These could be stored in their native formats.

+

 

+

sim data store

+

Stores objects and their data that are in the sim. Again, it's a web server, but completely public. Though just like ordinary web servers, parts could be private to members only. Most of what was said about inventory data stores applies. There is a change of emphasis though, these would be public in general, with privacy an option, where inventory is private in general, with public being an option. Note that objects and other assets that are contents of a sim object should not be public by default, perhaps they could be handled by inventory data stores. Inventory data stores could be very simple data stores, with authorisation, so would be perfect to be used as data stores for objects contents. Lets us reuse code and protocols, and can share code on the same server.

+

A sim data store could be a web proxy in front of any user in that sim. This is for any inventory data store an the users own computer, so that they can hide behind that sims proxy. Perhaps this could be another module? Not sure how to handle inventory transfers to offline users, especially those without some other web server to have an inventory data store on. Likely users will be a member of at least one web site somewhere that offers inventory data stores.

+

 

+

physics engine

+

Calculates physics interactions between objects in a sim. Does not have to handle all the objects on a sim, but the sim can be partitioned up, probably via some load balancing scheme. Physics is calculated on a frame per frame basis, though the "frame rate" might not have any bearing on the viewer graphics frame rate. It should however be close to human visual frame rate.

+

 

+

script engine

+

Runs scripts, either those in objects in a sim, or those in a users viewer. Does not have to handle all the scripts, but could be load balanced. Viewer scripts would be things like attachments or HUDs, and might run in the viewer. Scripts might set up sensor timers to scan nearby objects, or request specific data from random objects at random times. They also would be interested in specific events, perhaps physics or user interaction events, perhaps others. Scripts can also send arbitrary commands to do their work. Script engines can be identical, whether on servers or viewers.

+

Since sims can have one or more script engines, script engines could service one or more sims, and viewer scripts could be run in the viewer or a specific script engine the user is allowed to use...we can do away with the need to save script state, and load it again on the next sim when avatars move from one sim to the next. That's one of the major time consuming parts of a TP on your average script heavy avatar.

+

 

+

viewer

+

Brings it all together as a rich virtual world for the user. It operates in graphics frames, having to pull everything together from the various sources, and generate all the pixels for the next frame at hopefully human visual rates. It also has to let the user do whatever it is that they want to do in the sim. Some things can happen at a more leisurely rate, like transferring files. People are used to large graphic files rezzing a bit at a time, even in the 2D web for instance.

+

 

+

command pump

+

A command pump has to accept object change commands from the other modules, and make sure that all modules get the data that they need in the form of commands. All the other modules are clients of the command pump. It really has to be as efficient as possible in both network usage and internal processing. It's debatable whether or not it should pre filter data to the other modules or just throw everything at them and let the modules ignore stuff they don't need. I'll err on the filtered data stream side, to keep bandwidth down. It could be a CPU+RAM versus bandwidth trade off. Certainly there should be nothing that prevents that trade off going either way. The other modules SHOULD ignore commands they don't understand. General rule of software engineering - be careful with what you send, be tolerant of what you receive. On the other hand, initial implementations are likely to start simple, just naive with no filters.

+

Data in the form of commands to change object state for particular objects is thrown at the command pump at random by other modules. Some may be slow (human interaction speeds from viewers), some maybe fast (bullets and debris whizzing around from the physics engine). All relevant object state changes should be sent to all other modules, perhaps with a complete resync every once in a while as needed just to be sure. We are not really worried about any lost update problems, if two or more modules are trying to change the same object data, the last one wins.

+

Timing is also a concern. Data changes sent to the viewer for instance should not include many changes to the same object data per frame, only the last one sent is important to the viewer. Same for the physics engine. Scripts generally set their own time for when they want to know about external changes, but likely want to know about changes to the object they are in when they happen, or when they ask.

+

So, the command pump has to understand at least a little about what the command language is. For clients that run at some sort of frame rate, the pump should delete commands when a new one for the same data arrives, so that it sends only one change per data each "frame". It should also delete old commands from previous frames if it detects that the client has moved on without getting all the commands for those frames. Clients could request that they are only interested in specific commands. On the other hand, the pump does not need to know what the data represents, or even what the commands mean. It just stores and forwards, with some arbitrary filtering as requested by each client. So it needs to know which part of each command is the command verb, and which object the command refers to. The command pump also needs to understand which clients have a frame rate, but that could be handled by clients sending filter requests. Filtering entire objects should be possible to, based on what objects the client says it's interested in.

+

So basically, it manages FIFO queues of commands, one per client. Filtering out any command type the client requests, filtering for objects of interest, or filtering object data on a frame rate basis per object. Every now and then, it has to sync the sim data store as well, so that the sim state is persistent across restarts, and clients can just download complete objects from the store when they first need them. Phew.

+

A good optimisation would be for the sim data store and command pump to be the same module. The pump has to keep the current state of objects in memory anyway, and knows how to pump the command data out, all it needs is a persistent backing store to write to and read at start up.

+

As an optional wrapper around the command pump, could be translators for those that want REST, JSON, XMLRPC, or other bloat. With commands to switch to and from these and the native binary protocol. Native binary protocol must always be supported, and always be the default until requested otherwise. 99.9999% of Internet traffic does not NEED to be human readable on the wire, human readable is not so easy for computers to read, they need to translate it. Why slow everyone down? I will insist that these protocol translators operate outside the command pump, don't want to slow that down to satisfy peoples longing for bloat. They should be separate processes, preferably operating on separate cores, or even entirely different computers. They will naturally talk the tight binary protocol to the command pump, just like every one else.

+

There are three basic Internet protocols we could use as the basis for the wire traffic. TCP, UDP, and SCTP. SCTP would be a great candidate, except for the lack of MacOS support. I think we should try SCTP, with TCP as backup, SCTP support might come to Mac sooner or later.

+

 

+

command channels and language

+

In other parts of this document, a command channel is mentioned. Most of the data flowing through this command channel would be for setting or changing prim parameters. I propose a binary format based on llSetLinkPrimitiveParams() http://lslwiki.net/lslwiki/wakka.php?wakka=llSetLinkPrimitiveParams&show_comments=1#comments

+

A command list would usually start with a command stating which link number of which linkset the following commands will change. This command can be sent at any time. The link number can be one of the special link numbers. Then a series of prim parameter commands, also in binary. Each prim parameter command starts with a 32 bit integer parameter type, and then follows the actual parameters. Since each parameter type has a fixed format for it's arguments, no need to specify types. All arguments except strings are fixed width, so strings should be moved to the end of the argument list, zero terminated, and UTF-8. In general, there is only a single string for any command that includes a string, but it could be possible to have any number of zero terminated strings in order. Everything should be sent in network order.

+

There is naturally some room to define more commands. For instance, a delay before executing the next command, a command to stop this one and start a new one with a different link number, or one to set something other than a prim parameter (a land parameter for instance). We could add a command - "JSON" which means "I'm a fucking human, talk to me in something that looks vaguely like English" until the end of the session. Or a few such commands for a few different formats. BSON, BNRY to change back to the default binary mode, and EWWW to change to the XML mode used by OAR files, MTRX for something like my matrix-RAD wire protocol.

+

The command language should be binary.The objects current state is stored as the currently active list of commands for each object. An object in this case would be a prim, mesh, linkset, the sim itself, terrain, or avatars.

+

 

+

propagating language changes

+

In order to support a changing language as things develop, we could use an initial handshake between clients, servers, and engines (acting as clients to the sim data server) that could exist in these several variations. In the following, the variations are numbered for later discussion. The first word on the line is who is sending the data, indented lines then go into the extra detail that is being sent. The client sends first, as it's always the one to start the connection. The word "checksum" means that a checksum of some standard representation of the language known by that computer is sent. The word "signed" means that the language representation is signed in some manner to show it came from some authority.

+
    +
  1. client -> I speak Version 1 checksum
    server -> I speak Version 1 checksum
  2. +
  3. client -> I speak Version 1 checksum
    server -> I speak Version 2 checksum signed
    Version 2 is -
    A=int,int,float
    B=vector,string
    client -> I speak Version 2 checksum
    server -> I speak Version 2 checksum
  4. +
  5. client I speak Version 1 checksum +
    which adds -
    C=rotation,int
    D=string,float,vector
    server I speak Version 1 checksum + (only to this client)
  6. +
  7. client I speak Version 2 checksum
    server I speak Version 2 checksum (which is different) signed
    Version 2 really is -
    A=int,int,float
    B=vector,string
    client I speak Version 2 checksum
    server I speak Version 2 checksum
  8. +
  9. client I speak Version 2 checksum
    server I speak Version 1 checksum
    client I speak Version 2 checksum signed
    Version 2 is -
    A=int,int,float
    B=vector,string
    server I speak Version 2 checksum
  10. +
  11. client I speak Version 1 checksum
    server I speak Version 1 checksum +
    which adds -
    C=rotation,int
    D=string,float,vector
    client I speak Version 1 checksum + (only to this server)
  12. +
+

1) all is good, hopefully the usual thing.

+

2) and 4) are subject to evil servers screwing things up. 5) is subject to to evil clients. Should think of ways to protect from that. GPG signed from a trusted source? Web of trust needed.

+

3) server only uses that version of the language for talking to that client.

+

5) a way to push up an official new protocol version.

+

6) is pathological, but might happen during development. On the other hand, the extra data might be useless, as the client does not know what to do with it.

+

Sim data server to sim data server changes could happen between servers that have some sort of arrangement between them. Like neighbouring sims, or servers run by the same person. The first server is then client, and contacts the other server as normal. Otherwise, language updates are going to be slow getting around. Physics engines would likely only need to know the new languages when they know how to deal with the new data types. Script engines could benefit from command languages if their scripts know how to deal with the new data types.

+

1) 2) 4) 5) both ends just use the same language.

+

3) 6) Store the extra things as name/value pairs, send them back as name/value pairs. The "store" part could be a DOS attack to soak up storage space. However, there should be restrictions on who can change things on any given sim data server, so that will help. Should also send any name/value pairs to other clients/servers that register identical pair formats? Would be useful for development of the next version of the language. Note there could be name clashes, so include the data types for each name/value pair when deciding to send it.

+

 

+

Command language

+

llSetPrimitiveParams() is the model I want to follow.

+

For the binary protocol, we will try to pack things up as much as possible. A lot of the integers don't need to be full 32 bit integers. Some of the vectors can be just small integers instead of floats. etc.

+

Yes, I am trying to micro optimise this part before actual implementation. So I'll go over my assumptions, use cases, and other design decisions here for reference.

+

I want the command language itself to use as little bandwidth as possible. I think the on disk storage should just be this tight little command language. I want the code that deals with this command language to be simple. If there has to be any trade offs, the code can be more complicated if it keeps the command language tight. The reasons for these things is scalability. While the distributed nature of this design means that we are generally only concerned with sim level scalability. We do want to support huge sims with large numbers of users. The command pump code could be used for both servers and clients. Flinging the basic data about, and storing it, is something I want to be efficient as possible from the very beginning. Folks, that means PACKED BINARY dammit. Cringe now and get it over with.

+

Those people that want to use less efficient and more human readable data formats do get to eat their cake by the use of protocol translators. These should NOT be part of the same process as the inner pump, in order to not have them slow down this inner pump. I see these uses of other data formats as being the exception rather than the rule. That's one of my big assumptions. If you want to avoid bloat and lag, use this tight packed binary, but feel free to filter it through a protocol translator for debugging purposes. Just don't ever get in the way of those wanting things to be efficient.

+

The command language will not deal with large binary blob assets directly, things like actual textures, sounds, animations. Instead it will simply deal with pointers to these assets. These pointers might be UUIDs, or names. I want to extend that to include URLs and SHA-1 sums as data pointers (content addressable blobs).

+

The main use cases are those basic modules I have identified above - command pump, inventory and sim data stores, physics and script engines, and the viewer. Each of these modules will have an internal representation of each object of interest.

+

The data stores want to know which object the commands are for so they can store each object separately. They also only want the latest data for each object. They store each object on disk somewhere, but possible have those objects memory mapped and update them as commands come in.

+

The engines want to filter out only the data they need for their work. For the script engine, this filter might be different for each script. The script itself has internal state that would need to be persisted during sim shutdowns, or transfer to inventory.

+

The viewer wants all the data, though probably would be happy to just drop old data if it's too late to render it and newer data is already here. It will have internal representations of objects of interest, but may cache them.

+

The command language is mostly concerned with changing in world properties. In general these are split into prim (object), sim, avatar, animation, and environment (windlight/lightshare) properties.

+

Prims (objects) are the basic building blocks of the world. Originally prims where general 3D primitives, where the idea is that you can build more complex shapes with simple primitives, and the data to describe those primitives is much less that defining each triangle. Since then sculpties have been added, where the triangles are defined as an array of points encoded into and RGB texture, and the triangles have a fixed mapping. Very recently, arbitrary meshes have been introduced, since sculpties had restrictions. Still, the data for the sculpty and mesh triangles and such are treated as blobs of opaque binary data, with pointers to them (and some flags) being the only data dealt with at the prim level. That still works for me. B-)

+

Prim properties can change quickly, by the physics engine, scripts, or users editing them in world in real time.

+

Sim properties in general don't change fast. No point updating the land music URL many times a second, or even many times a minute. Perhaps someone might want to update the terrain or terrain texture quickly, but current viewers are very slow to track those changes anyway. Perhaps in the future we might want to allow piping video into the terrain to simulate an earthquake, but that would still be represented as just attaching one video stream to the terrain heightfield. So in general I think we can treat sim property changes as slow moving.

+

Avatars currently consume the most resources, which is why you can have thousands of prims in an existing SL style sim, but only dozens of avatars. They move around a lot, animate, change clothes, and wear prims. Prims are covered above, animations below, movement might be covered by treating avatars as a prim type. That leaves clothes. In the end, clothes is treated just like a texture change, and is not usually done quickly.

+

Animations are currently really only applied to avatars. They are references to animation assets (BVH files), where the asset is downloaded as needed, perhaps cached, and usually triggered by scripts. These tend to be slow changes (updating which animation asset is in use right now), but scaled up by the number of avatars in the sim at any given time. AO animations may change quicker as people move about.

+

On the other hand, we are extending animations to prim objects, and thinking about in world editing of them, plus allowing ad hoc "animations" via puppeteer style controls. So we need to keep these things in mind.

+

The environment is not changed quickly.

+

So, in the end, looks like prim property changes (including avatars as prims) are the heavy users. This is my next big assumption. There should be lots of commands for dealing with individual prim properties, as opposed to say sim commands where we can pack a bunch of properties into a single command. This is the reason why I'm starting with llSetPrimitiveParams() as my model for the command language. Perhaps a hamming code might work well?

+

After looking at things from the perspective of the above thoughts, there are very few commands that do NOT have a fixed set of parameters. These are generally those with string parameters. Most of those strings are asset pointers, often UUIDs, though some are just arbitrarily long bits of text that are just displayed as is. So I want to leave command lengths out of the basic command language (though know about them internally), but we do have to deal with some variable length commands. We could have three different versions of those commands that deal with asset pointers, UUID and SHA-1 being fixed length commands, name and URL being variable length (name treated as a relative to current sim URL).

+

So a first hack at this that keeps things nice and simple is 8 bit commands, with fixed length parameters for each command. Using a 256 entry table that includes that fixed length, and details of the types of parameters. Perhaps we can use a special value for the length in that table that means "variable length, you might have to actually scan and think about the command data to find it's end", but otherwise just use the fixed length for doing things like skipping to the next command, or copying this command somewhere. I assume that any single command will not be very long. Given that keeping the command data smaller is more important than keeping the code simple, I lean towards the C string style rather than the Pascal string style. In other words, a NULL end of string token instead of a couple of bytes of string length.

+

The other issues to deal with are when and how to do the filtering; and how to handle "old" data.

+

The first level of filtering would be per object. Physics engines are only interested in physics enabled objects (including avatars some of the time). Viewers are only interested in objects within draw distance. Script engines would initially only be interested in the objects with scripts in them, but maybe interested in other objects they are scanning or whatever.

+

The physics and script engines really want to spend most of their resources actually calculating physics and executing scripts. So it might be worthwhile filtering the commands we send to them. Physics is easy, it wants only a few bits of prim data that is well known ahead of time.

+

Scripts are harder, any given script at any given moment, might only be interested in a small subset of info about a prim, or the sim, etc. There are two categories - query a parameter right now, or trigger events based on parameter changes. Note that LSL at the moment treats some "ask for parameter" async, they send the request, then setup an event to get the results.

+

I think all modules only want current data. The world exists only in real time. Some general method for just dropping commands that are too old needs to be included. "Too old" means that some new command arrived that replaces that old commands data, but before that old command has been dealt with. This might be made more complicated by the existence of command variations where some of the data is encoded in the command byte for the current proposed implementation.

+

 

+

Prim commands.

+

There are seven commands not allocated in the middle, and two near the end, no doubt we could use those for the missing commands. These are the commands not currently accounted for in the command language -

+

llSetPrimMediaParams(face, list)

+

Can probably combine most of these. Width and height SHOULD be combined per the LL specs.

+ +

llParticleSystem(list)

+

These could be combined a bit, some of them should be.

+ +


llCreateLink(key boolean)

+

llSetTextureAnim(integer:7 face integer integer float float float)

+

Stuff to do with the playing of sound clips.

+

 

+

Parcel commands.

+

There is no need for parcels really, they are just a way of managing a fixed sized sim. We use arbitrary sized sims with little or no boundaries. So "parcels" can just be a bunch of smaller sims arranged in what ever way makes them more manageable by the sim owners. I would even suggest that sky boxes be just another sim, but with a high vertical offset from the land sims.

+

 

+

Sim commands.

+

Note that terrain and water could be dealt with by prim commands, treating them as heightfield meshes. This assumes that parcels are just specialised sims.

+

A sim has the following properties, which will need commands to change them -

+

Name, description, owner, group.

+

Rating - LL introduced the concept of maturity ratings, but the web has various other ways of dealing with that, with no standard system across the board. We could just say "let the web server owner figure out their own system", though still have the option of supporting LL style maturity ratings.

+

Land sales and deeding are possibly meaningless in this case, but we can always support the legacy LL method. Note that some of the legacy LL stuff makes no sense outside of LL type grids.

+

Autoreturn setting. Edit terrain and fly permissions, as well as object create, entry, and script running permissions for the land group, and for others. That's a nice set of 8 bits. B-)

+

Creating landmarks permission is similar to creating bookmarks. Not really something that is done on the web, and we are opening this up to web style access systems, so we don't really need that.

+

No damage is irrelevant really, if they want combat on their sims, they can provide a proper combat system. No pushing is likely similar.

+

Showing places in search is really now up to the search engines to cope with this new form of data.

+

A snapshot is good. Teleport landing spot and routing should have more options, but we can start with just supporting the usual LL stuff.

+

Audio and media are now handled differently anyway.

+

Access is now controlled by the usual web methods.

+

Allowing land resale and joining / sub dividing is no longer relevant. Telehubs are no longer relevant. Object bonus, and minimum agent age are not relevant. Agent limit might be relevant, but should be taken care of by usual web access systems.

+

Will still need to send broadcast messages to people in sims.

+

Restarting sims, disabling scripts, collisions, and physics.

+

Four terrain textures, and the four pairs of elevation ranges (one per corner) should still be supported, but we should also support just setting a fixed texture, or even several.

+

Water height, but also allow water heightfield. Terrain raise and lower limits not needed. Terrain heightfield and editing. Baking terrain. Don't really need stuff specific to backing up heightfields, they just become one more texture file on the web server.

+

Sim sun stuff should be handled by the windlight commands.

+

Allowing voice chat becomes a matter of whether the sim owner bothered to set that up.

+

Allow direct teleport is now part of access controls.

+

Covenant is just the sites ToS.

+

Should be able to kick people, and return their stuff. Though that's more content management, which we can leave to CMS style systems. Most everything else is content management, or admin stuff best left to other tools.

+

Create and delete an object. Moving and editing them is up to the prim commands. Though it should be pointed out, the position and rotation of root prims are a property of the sim rather than of the prim or linkset itself.

+

 

+

Windlight commands.

+

 

+

Avatar commands.

+

Some of this could be dealt with by treating the avatar as a prim. In fact, Alice's proposed animation system deals with animating avatars and prims the same way.

+

 

+

Animation commands.

+

Alice is working on that over at the BVJ page.

+

 

+

Meta commands.

+

0 SELECT_OBJECT key

+

There will be a bunch of four byte commands, they all switch up to less efficient command representations, so they can afford to be more verbose. B-)

+

They all are actually one byte commands, with the extra three bytes just being verbose padding for the humans. Let's hope there are no conflicts with other commands, otherwise the other command will just have to move.

+ +

Note that a key in SL is a 32 hex digit string (128 bits, or 16 bytes), with four dashes added to make it 36 characters long. We probably don't need that much uniqueness within a sim, or even within a host full of sims. Two bytes gives us 65,536 unique objects, three bytes 16,777,216, and four bytes 4,294,967,296 objects. The maximum number of prims on a 256x256 SL sim is 15,000, and the maximum number of avatars is 100. So two bytes seems like plenty.

+

I would suggest using SHA-1 hashes of fixed blobs like textures and sounds, in the same way that git uses them for content addressable storage. SHA-1 is 160 bits (20 bytes), but as git has shown, if there are a small number of objects, you can get away with using just the first few digits. The advantage here is that multiple copies of the same texture end up with the same SHA-1, and thus we only store one copy.

+

Since we are using the format used by LSL prim parameter setting as the guide, after looking at it, I think we can do something like this...

+

A command is one byte, letting us have 256 commands. The very first command is 0 - select what object the next commands will work on.

+

The prim parameters take up the next 32 commands, but that only needs 5 bits. Some of those prim parameters include an integer, or even boolean, that could only need 3 bits. PRIM_TYPE in particular could encode the type itself into those extra 3 bits, making a total of 8 commands, and making it easy to fit the different sets of parameters into a table. PRIM_TYPE_LEGACY becomes 6 commands; PRIM_MATERIAL 8; PRIM_PHYSICS, _TEMP_ON_REZ, _PHANTOM, _FULLBRIGHT, _FLEXIBLE, _POINT_LIGHT, _CAST_SHADOWS, _TEXGEN 2 each; PRIM_TYPE 8; PRIM_BUMP_SHINY could be 4 with the shiny part in the command number. The other 10 add to make a total of 52. 103 commands left for the other commands, I think that might work.

+

 

+

The big arsed command table

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
decimalhexbinaryASCIIcommandargumentscomments
0000000 0000NULLSELECTkeyNext commands refer to this object.
1010000 0001SOHPRIM_TYPE_LEGACY BOXvector float float vector vector 
2020000 0010STXPRIM_MATERIAL (STONE)integer:3OK, the cleanest way to deal with this conflicting with the BSON commands is to have it as just one command. sigh
3030000 0011ETXPRIM_PHYSICS off  
4040000 0100EOTPRIM_TEMP_ON_REZ off  
5050000 0101ENQPRIM_PHANTOM off  
6060000 0110ACKPRIM_POSITIONvector 
7070000 0111BELPRIM_SIZEvector 
8080000 1000BSPRIM_ROTATIONrotation 
9090000 1001TABPRIM_TYPE BOXinteger:2 vector float vector vector vector 
100A0000 1010LF   
110B0000 1011VT   
120C0000 1100FF   
130D0000 1101CR   
140E0000 1110SO   
150F0000 1111SI   
16100001 0000DLE   
17110001 0001DC1PRIM_TEXTUREface string/key vector vector float 
18120001 0010DC2PRIM_COLOURface (vector float)=colour 
19130001 0011DC3PRIM_BUMP_SHINY PRIM_SHINY_NONEface integer:5 
20140001 0100DC4PRIM_FULLBRIGHT offface 
21150001 0101NAKPRIM_FLEXIBLE off  
22160001 0110SYNPRIM_TEXGEN PRIM_TEXGEN_DEFAULTface 
23170001 0111ETBPRIM_POINT_LIGHT off  
24180001 1000CANPRIM_CAST_SHADOWS off  
25190001 1001EMPRIM_GLOWface float 
261A0001 1010SUBPRIM_TEXTstring (vector float)=colour 
271B0001 1011ESCPRIM_NAMEstring 
281C0001 1100FSPRIM_DESCstring 
291D0001 1101GSPRIM_ROT_LOCALrotation 
301E0001 1110RSPRIM_POS_LOCALvectorThis is just my guess about where LL will put it.
311F0001 1111US   
32200010 0000SPACEPRIM_OMEGAvector float float 
33210010 0001 !PRIM_TYPE_LEGACY CYLINDERvector float float vector vector 
34220010 0010"(PRIM_MATERIAL METAL)  
35230010 0011#   
36240010 0100$   
37250010 0101 %   
38260010 0110&   
39270010 0111'   
40280010 1000(   
41290010 1001)PRIM_TYPE CYLINDERinteger:2 vector float vector vector vector 
422A0010 1010*   
432B0010 1011+   
442C0010 1100,   
452D0010 1101-   
462E0010 1110.   
472F0010 1111/   
48300011 00000   
49310011 00011   
50320011 00102   
51330011 00113   
52340011 01004   
53350011 01015   
54360011 01106   
55370011 01117   
56380011 10008   
57390011 10019   
583A0011 1010 :   
593B0011 1011 ;   
603C0011 1100<   
613D0011 1101=   
623E0011 1110>   
633F0011 1111 ?   
64400100 0000@   
65410100 0001APRIM_TYPE_LEGACY PRISMvector float float vector vector 
66420100 0010BBSON Switch to BSON mode. (Conflicts with PRIM_MATERIAL GLASS)
67430100 0011C   
68440100 0100D   
69450100 0101EEWWW Switch to XML mode, as used by OpenSim in IAR and OAR backup files.
70460100 0110FFUCK Switch to two, four byte command mode; with three, four bytes of object ID.
71470100 0111G   
72480100 1000H   
73490100 1001IPRIM_TYPE PRISMinteger:2 vector float vector vector vector 
744A0100 1010JJSON Switch to JSON mode.
754B0100 1011K   
764C0100 1100L LUA  Switch to Lua mode.
774D0100 1101MMRTX Switch to matrix-RAD mode.
784E0100 1110N   
794F0100 1111O   
80500101 0000P   
81510101 0001Q   
82520101 0010R   
83530101 0011SPRIM_BUMP_SHINY PRIM_SHINY_LOWface integer:5 
84540101 0100TTITE Switch back to the tight binary mode that is the sane default. B-)
85550101 0101U   
86560101 0110V   
87570101 0111W   
88580101 1000X   
89590101 1001Y   
905A0101 1010Z   
915B0101 1011[   
925C0101 1100\   
935D0101 1101]   
945E0101 1110^   
955F0101 1111_   
96600110 0000`   
97610110 0001aPRIM_TYPE_LEGACY SPHEREvector float vector 
98620110 0010bbson Switch to BSON mode. (Conflicts with PRIM_MATERIAL WOOD)
99630110 0011c   
100640110 0100d   
101650110 0101eewww Switch to XML mode, as used by OpenSim in IAR and OAR backup files.
102660110 0110ffuck Switch to two, four byte command mode; with three, four bytes of object ID.
103670110 0111g   
104680110 1000h   
105690110 1001iPRIM_TYPE SPHEREinteger:2 vector float vector vector 
1066A0110 1010jjson Switch to JSON mode.
1076B0110 1011k   
1086C0110 1100l lua  Switch to Lua mode.
1096D0110 1101mmrtx Switch to matrix-RAD mode.
1106E0110 1110n   
1116F0110 1111o   
112700111 0000p   
113710111 0001q   
114720111 0010r   
115730111 0011s   
116740111 0100ttite Switch back to the tight binary mode that is the sane default. B-)
117750111 0101u   
118760111 0110v   
119770111 0111w   
120780111 1000x   
121790111 1001y   
1227A0111 1010z   
1237B0111 1011{   
1247C0111 1100|   
1257D0111 1101}   
1267E0111 1110~   
1277F0111 1111DEL   
128801000 0000   
129811000 0001PRIM_TYPE_LEGACY TORUSvector float float float vector vector 
130821000 0010(PRIM_MATERIAL FLESH)  
131831000 0011ƒPRIM_PHYSICS on  
132841000 0100PRIM_TEMP_ON_REZ on  
133851000 0101PRIM_PHANTOM on  
134861000 0110PRIM_TEXGEN PRIM_TEXGEN_PLANARface 
135871000 0111   
136881000 1000ˆ   
137891000 1001PRIM_TYPE TORUSinteger:2 vector float vector vector vector vector vector float float float 
1388A1000 1010Š   
1398B1000 1011   
1408C1000 1100Œ   
1418D1000 1101   
1428E1000 1110Ž   
1438F1000 1111   
144901001 0000   
145911001 0001   
146921001 0010   
147931001 0011PRIM_BUMP_SHINY PRIM_SHINY_MEDIUMface integer:5 
148941001 0100PRIM_FULLBRIGHT onface 
149951001 0101PRIM_FLEXIBLE oninteger float float float float vector 
150961001 0110   
151971001 0111 PRIM_POINT_LIGHT on(vector)=colour float float float 
152981001 1000 PRIM_CAST_SHADOWS on  
153991001 1001    
1549A1001 1010    
1559B1001 1011    
1569C1001 1100    
1579D1001 1101    
1589E1001 1110    
1599F1001 1111    
160A01010 0000    
161A11010 0001 PRIM_TYPE_LEGACY TUBEvector float float float 
162A21010 0010 (PRIM_MATERIAL PLASTIC)  
163A31010 0011    
164A41010 0100    
165A51010 0101    
166A61010 0110    
167A71010 0111    
168A81010 1000    
169A91010 1001 PRIM_TYPE TUBEinteger:2 vector float vector vector vector vector vector float float float 
170AA1010 1010    
171AB1010 1011    
172AC1010 1100    
173AD1010 1101    
174AE1010 1110    
175AF1010 1111    
176B01011 0000    
177B11011 0001    
178B21011 0010    
179B31011 0011    
180B41011 0100    
181B51011 0101    
182B61011 0110    
183B71011 0111    
184B81011 1000    
185B91011 1001    
186BA1011 1010    
187BB1011 1011    
188BC1011 1100    
189BD1011 1101    
190BE1011 1110    
191BF1011 1111    
192C01100 0000    
193C11100 0001    
194C21100 0010 (PRIM_MATERIAL RUBBER)  
195C31100 0011    
196C41100 0100    
197C51100 0101    
198C61100 0110    
199C71100 0111    
200C81100 1000    
201C91100 1001 PRIM_TYPE RINGinteger:2 vector float vector vector vector vector vector float float float 
202CA1100 1010    
203CB1100 1011    
204CC1100 1100    
205CD1100 1101    
206CE1100 1110    
207CF1100 1111    
208D01101 0000    
209D11101 0001    
210D21101 0010    
211D31101 0011 PRIM_BUMP_SHINY PRIM_SHINY_HIGHface integer:5 
212D41101 0100    
213D51101 0101    
214D61101 0110    
215D71101 0111    
216D81101 1000    
217D91101 1001    
218DA1101 1010    
219DB1101 1011    
220DC1101 1100    
221DD1101 1101    
222DE1101 1110    
223DF1101 1111    
224E01110 0000    
225E11110 0001    
226E21110 0010 (PRIM_MATERIAL LIGHT) Deprecated: Looks the same as [ PRIM_FULLBRIGHT, ALL_SIDES, TRUE ]
227E31110 0011    
228E41110 0100    
229E51110 0101    
230E61110 0110    
231E71110 0111    
232E81110 1000    
233E91110 1001 PRIM_TYPE SCULPTstring/key integer:8 
234EA1110 1010    
235EB1110 1011    
236EC1110 1100    
237ED1110 1101    
238EE1110 1110    
239EF1110 1111    
240F01111 0000    
241F11111 0001    
242F21111 0010    
243F31111 0011    
244F41111 0100    
245F51111 0101    
246F61111 0110    
247F71111 0111    
248F81111 1000    
249F91111 1001    
250FA1111 1010    
251FB1111 1011    
252FC1111 1100    
253FD1111 1101    
254FE1111 1110    
255FF1111 1111    
+

Not sure where else to put this, but nails I think is the bit that drives the network traffic the most -

+low-latency-requires-smart-queuing-traditional-aqm-is-not-enough +

Another article that deals with network issues in a 3D networked game -

+the_internet_sucks_or_what_i_ +


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

+ + diff --git a/docs/common/OMG-WTF-BBQ.html b/docs/common/OMG-WTF-BBQ.html new file mode 100644 index 0000000..5e48a14 --- /dev/null +++ b/docs/common/OMG-WTF-BBQ.html @@ -0,0 +1,25 @@ + +OMG WTF BBQ + + + +

The rationale

+

Scripts, and sometimes objects, can invoke a file purely by its UUID. It had been suggested we might replace the existing UUID system with something where the file is invoked via some sort of machine address, pointing to the Internet address of the grid or world -- actually, call it an OMG Node -- the file originated from. The problem with this sort of approach is that, a given VR world could go away, making that direct addressing fail, a given world could change its name and location, causing the direct addressing to break. What we need is a system where the UUID of a file is location-agnostic. That is to say, it shouldn't matter where the file originally came from, it should only matter that there is still a way to bring it in when you need it.

+

At that, while it might be possible to go into a script and change the machine-address for the file if it breaks, that makes the assumption one would be able to edit the script, or know what the new pseudo-UUID for that file would be in order to replace it. For one thing, a lot of scripts are going to be no-mod, so even if you did know what that new pseudo-UUID to replace in there was, you wouldn't be able to fix it anyway.

+

What needs to exist is some means of identifying what world a given set of files came from by some kind of UUID subset. That is, each file made on a particular, distinct part of the OMG needs a unique identifier that starts out all UUIDs made there, and that the rest of the UUID would be appended to that would uniquely identify a file that was created there. This unique identifier for an OMG Node also needs to exist in a form that doesn't change when the name or location of the OMG Node changes.

+

OMG Node

+

This would be a server or group of servers that function as a single entity. I.e. the gridrid and the sims that are specifically owned by a person. Another might be the server sim-providing service Waki and Torben are now setting up.

+

WTF -- Where's The File

+

This would be a list of UUID-identified files (pictures, sounds, notecards, scripts, etc) available from a given OMG Node that are currently known on your current machine, and would function as a sort of look up table if those UUIDs get invoked again. It identifies where a particular file came from originally, and/or what machines it traversed getting here. There would be one .WTF file for each OMG Node, and would list all the files that came from there which the local OMG Node has collected in its own interactions with other OMG Nodes, and that are reachable in a Six Degrees of Separation from Bacon sort of way. Basically, any UUID which starts with the code that identifies it as having come from that specific OMG Node would be stored here.

+

BBQ -- Big, Broad Query

+

Here is where the Six Degrees of Separation from Bacon mentioned under the WTF entry comes in. A .BBQ files keeps track of all the OMG Node identifier UUID-subset codes so that when an OMG Node changes its address or ceases to exist, every back address is stored, also, what other places maintain mirror copies of some or all of the files from there that could be called by a full UUID (from inside a script, say) so even when an OMG Node goes away, those files will continue to be available.

+

Basically, if a UUID is invoked by a script, and the file that UUID is tied to isn't in the local OMG Node, a query will be sent out to the nearby OMG Nodes asking if they have this file, if they don't, they might query their nearby OMG Nodes to see if those have it, and so on. Ideally there should develop from that, ant-tracks-style, that identifies the shortest path between OMG Nodes to where files with a given OMG Node identifier UUID-subset's files can be obtained from, even if that OMG Node has been out of business for a decade.

+

COW -- Copy On Write.

+

What's a BBQ without some COW, er I mean beef? We can speed up the BBQ search a bit by pre caching things, but what to pre cache and how?

+

Instead of using UUIDs, which are basically random numbers, we could use SHA1 hashes. This is the same system used by git at least. That means the objects can be content addressable. First benefit is that all these identical copies of any given object would end up with identical names, so that we have a broader field to search. Second benefit is that we don't end up having to store dozens of identical copies of the same object on the local OMG node, since they all end up with the same name. A UUID is 16 bytes, an SHA-1 is 20, but a UUID is usually shown in a format that includes 4 dashes, so they end up being the same length. Much experience with git has shown that you can get away with just the first few digits, depending on how many objects you need to distinguish between. So instead of completely ignoring the half a dozen copies of any given object you are searching for; coz different people uploaded it from different places; you might find it more easily by noticing that you already have it. The .WTF file can include pointers to known locations, and the various names it is known as, but the object itself has the SHA1 hash as it's file name, instead of the UUID. The SHA1 hash is it's internal name. It does not even have to be stored on the local OMG node, just the SHA1 internal name, and some pointers to likely locations.

+

Where does the COW come in? If it's got horns, any where it wants to. Er...

+

Quite often an object gets changed, that would naturally change the SHA1 hash. So now we have a different object, with a different name. But, the object might not be stored locally, just the pointer. The programming field has a name for what happens next, a copy is made when you try to write to it - Copy On Write. So the object is copied from the most convenient nearby OMG node, the changes made, then it is written (under a new SHA1 hash name) onto the local OMG node. This OMG node informs other interested nodes that it now has this new object, they can store pointers to the new object on this OMG node in their .WTF files.

+

Which brings us back to the pre caching. The hungry little OMG node does not have to wait for the BBQ to fire up to get it's COW. It can start to download the object if it has some time on it's hands, just coz.

+

To quote a famous local sporting hero "Where's the cheese?". Ah, that's another story...

+ + diff --git a/docs/common/README.Bookie b/docs/common/README.Bookie new file mode 100644 index 0000000..bec4b19 --- /dev/null +++ b/docs/common/README.Bookie @@ -0,0 +1,33 @@ +Shared dynamic libraries is a bit of an issue for cross platform code. +LL viewers deal with it by including their own copies of the libraries +they use. This bypasses the idea of sharing them, and thus uses too +much resources. On the other hand, it seems to be the Windows way of +doing things, lots of Windows packages I have seen include their own +copies of libraries. Mac Os X seems to do the same, each application is +installed as it's own directory, filled with it's own copies of +libraries. Not a lot of sharing going on. Linux and the BSDs do the +right thing, most libraries are actually shared. Except that LL viewers +STILL bring their own libraries. + +I think the main difference is having a proper package management +system. Apt, RPM, and portage (I think) can track dependencies on +libraries, install the libraries automatically, and even have different +versions of libraries installed side by side. Without this, the OS has +no official way of tracking library dependencies, so every one has to +supply their own. Sure Mac OS X has had a few package systems ported to +it, but none of them are the official one, so developers can't rely on +them. + +SledjHamr has to deal with this, and try to do so in some sort of smart +way. As usual, the right way to do things is generally to do the +opposite of what LL does. lol + +Bookie should be a sub system that probes the OS, trying to see if +there's some sort of OS store of libraries, and try to find reasonable +versions of the libraries needed in that. If not found, it could invoke +an OS specific method of installing a suitable library. If that fails, +it can download a SledjHamr specific version into the SledjHamr +installed directory. So it tries to do the right thing first, and +gradually falls back to doing the wrong thing like LL does. + +That's the theory, in practice, gonna be a pain. diff --git a/docs/common/README.libraries b/docs/common/README.libraries new file mode 100644 index 0000000..8b99b7f --- /dev/null +++ b/docs/common/README.libraries @@ -0,0 +1,34 @@ +There are some base libraries that should be used in common. Notable +the Enlightenment Foundation Libraries (EFL), Irrlicht, lemon, LuaJIT, +and luaproc. Other external open source projects that we just use +directly should go here to. Makes it easy to compile it all. + +Note that in some cases, there might be changes. Such changes should be +documented, and marked with "// onefang changes". + +EFL has been released, so not including that anymore. You can find it +in distro repos, PPA's, etc. Or http://enlightenment.org/ + +Irrlicht has been slightly modified to get it to use externally created +GL stuff, and not use their internal copies of bzip, jpeglib, libpng, +and zlib. + +Lemon is from http://www.hwaci.com/sw/lemon/. + +LuaJIT 2.0 has been released for Ubuntu 13.04 and later, try using +https://launchpad.net/~mwild1/+archive/ppa for 12.04. Not including +that anymore. + +luaproc has been hacked up a bit, and will continue to be hacked up. +Merged it into LuaSL, so it's no longer here. Then replaced it +completely. + +-------------------------------------------------------------------- + +These are the libraries written for the SledjHamr project. + +libLumbrJack is a library of logging stuff, coz every one wants to log. + +libRunnr is for running Lua scripts. Named (sorta) after a friend of mine. + +libSledjHamr is a motley collection of stuff that is needed. diff --git a/docs/common/README.mumble b/docs/common/README.mumble new file mode 100644 index 0000000..1010f18 --- /dev/null +++ b/docs/common/README.mumble @@ -0,0 +1,5 @@ +Viewer integration with mumble and whisper, and using it for as many +audio services as it can. + +Mumble is a voice system designed for networked 3D game usage. Sounds +perfect, just what we need. B-) diff --git a/docs/common/The_Naminator.txt b/docs/common/The_Naminator.txt new file mode 100644 index 0000000..0002d2e --- /dev/null +++ b/docs/common/The_Naminator.txt @@ -0,0 +1,14 @@ +The Naminator eliminates human readable names, to make way for computer +names from SkyNet. Or something. + +In world names can be anything, but they map more or less to file names +and URLs, so the names have to be munged accordingly. A further issue +is that different in world objects can have the same name. Lots of +copies of the same thing, or two different things that happen to be +called the same thing. No one is gonna individually name each tree in a +forest, or every lamppost in the city. File names and URLs have to be +unique. The Naminator deals with munging names to deal with these +issues. It should generate names that are compatible with a variety of +operating and file systems, as well as being URL compatible. This is +such a useful thing to do that it should be a shared library, even if it +will be tiny. diff --git a/docs/common/no_accounts.txt b/docs/common/no_accounts.txt new file mode 100644 index 0000000..5ecbe08 --- /dev/null +++ b/docs/common/no_accounts.txt @@ -0,0 +1,29 @@ +We don need no stinkin' accounts. + +We don't really need accounts, so we can do away with them. Though +obviously since SledjHamr is designed to be a flexible set of tools +rather than one big take it or leave it system, people can use what ever +accounts system they need for their purposes. SledjHamr not only doesn't +impose an accounts system, we eliminate the need for one in the general +case. So we don't have to write one. B-) + +When a user fires up the extantz client for the first time, it can use +their local computer account name as the users name (I think most +operating systems make you create one when you install them). Extantz +could also do a reverse DNS lookup on the computers IP, and likely end +up with an ISPs dynamic IP reverse mapping, or maybe a real domain name. + +Extantz then tries to connect to a love server running on the same +computer, or starts one if it can't find one. This local love server by +default runs a small grid, with maybe a nice little cottage, and a star +gate. This is the users home, they can do what ever they like with it. + +The star gate works similar to current OpenSim hypergates, linking to +external grids and allowing HyperGrid access to them. Since the user +already has a local name and domain name, with the local love server +acting as the users home HyperGrid server, they are good to go visit +other grids. No real in world account need ever be created. + +The drawback is that the virtual worlds will be filled with lots of +root@123_231.bigisp-dyn.com users. Naturally it should be simple for +users to change the default name to anything they want. diff --git a/docs/common/portals.txt b/docs/common/portals.txt new file mode 100644 index 0000000..28498c2 --- /dev/null +++ b/docs/common/portals.txt @@ -0,0 +1,106 @@ +SledjHamrs killer feature, or one of them. + +A major reason for SledjHamr is to break down the garden walls. We do +this by allowing free travel between peoples virtual worlds. In OpenSim +this is done by HyperGrid, which is clunky and hard to use. Second Life +deliberately has no such system. Even worse, it's hard convincing people +in SL to visit your grid, coz it's all very hard, again due to +deliberate policy decisions by LL. LL knows their content is the key to +their business, even though almost all of it was created by the users, +LL locks it up tight. So people visiting OpenSim grids from SL have to +create a new avatar from scratch, which is such a major pain that most +people baulk at that and don't bother. And they can't bring their +inventory with them, inventory they paid for and spent years collecting. + +In SledjHamr, as well as allowing completely unrestricted and easy +access to lots of content, we should make it easy to travel between +virtual worlds. Part of this is to include compatibility layers in +separate modules to be compatible with what ever virtual world systems +are around. You would still need to create accounts and log onto those +worlds though. How can we mix them up? I imagine easy to use portal +objects. Let's start with the basics, and work out some more complex +examples. + +As mentioned in the no_accounts.txt document, every SledjHamr user has +their own little world running on their computer by default when they +start up the extantz client. There is a star gate on this default +world, an already setup portal that can connect to a bunch of default +external worlds. The user can use this star gate, and other peoples +portals to travel around other peoples worlds. Initially this could be +using OpenSim and its HyperGrid system. Later it would be SledjHamr +style worlds as well. + +A portal would be like Cobalt style portals, you can see the destination +in real time, and step through it to go there. They can be permanent, +or temporary. You can carry them in your inventory, they could just be +normal scripted in world objects. + +So you travel around the virtual worlds, meeting people, and you want to +invite some one to your home, or a group of people. You right click on +them and select "Invite them home" from the menu. Extantz knows your +home world, that's where you started and it's running on the same +computer. Extantz communicates to that home server, or starts it up +first. The home server adds this new person to it's access list. +Extant creates a portal object and offers it to the person, so they can +rez it anywhere. Or you could rez this portal object in the world you +are in. Either way, once the portal is in a world, it connects to your +home world, showing a view of your front gate, maybe including your +lovely garden in your front yard. The portal connects to the "front +gate" of your home world. + +Any one on your home worlds access list can step through this portal to +get to your home world. Simple to use, no figuring out HyperGate URLs +and copy pasting them, no manual messing with hard to use access systems. +Though it would still be possible to create URLs to in world places, to +store as landmarks, to email to someone, or to copy'n'paste into +farcebook. + +Portals rezzed in world could be temporary, and vanish after who ever +you invited to come stepped through it. Or time out several minutes +later so as not to clutter the universe with left over portals. Or +deleted by the owner / managers of the world you left them, or deleted +yourself from your own world. Portals could be permanent. Say you +found a larger world that you and the owner decide you wish to be a part +of. Portals could be left on both worlds linking them. The "portal" +could just be reconfiguring each world to locate the other world near +them, like neighbouring sims. Still, that should be done via the portal +interface, just a simple click. + +Portals can be fully open if you want to run a public world. People can +be banned. Or private worlds with specific groups and people allowed. +Similar to many web sites, you could have your own account system on +your world, people with accounts are allowed to build, or allowed to +with certain limits, or are the only ones allowed to visit. Privacy can +be applied to the portal, only those that can step through can see +through, or semi private, you can see a limited area, but not step +through. A portal could include a "door bell", people that want to +visit ring the door bell, someone might answer and let them in, but can +chat with them across the portal first. Perhaps getting dressed first. + +For those hard to reach places, I'm looking at you SL, a portal could be +coded as an LSL script in a SL prim object that you keep in your SL +inventory. It can operate in two modes, depending on who is looking. +If someone using a SledjHamr aware client looks, they see the usual +portal view mentioned above, and can easily step through it as usual. +Others would see a still photo of the view through the portal, or +perhaps a live video stream if the other world server has enough +bandwidth to support that. Or they could see just a logo if the world +owner hasn't bothered to pay LL to upload a suitable photo. If the user +of the viewer that is not SledjHamr aware clicks on or tries to step +through the portal, they are sent to a web page that lets them download +SledjHamr aware clients, with instructions on what to do to actually get +to that world. + +Once a user of that closed world steps through the portal using a +SledjHamr aware client, their client knows what that person looks like, +and has access to that persons inventory in that closed world, so they +can bring it all with them with no need to do anything other than step +through. The user remains logged on to the closed world, coz SledjHamr +needs no actual accounts. What their avatar is left doing in the closed +world for others to see is an open question. Perhaps sitting on some +chair on the portal prims, snoozing. Just had a better idea, the user +gets a new tab, in their original world they can wander off again and do +stuff, and in the new world they can do new stuff. Likely LL will ban +this in their TOS, and ban SLedjHamr aware viewers, they are anal like +that, and want to own your content to keep people locked in their walled +garden. Here's a SledjHamr for you all, break those walls open. B-) diff --git a/docs/common/privacy.txt b/docs/common/privacy.txt new file mode 100644 index 0000000..992867b --- /dev/null +++ b/docs/common/privacy.txt @@ -0,0 +1,5 @@ +There is more to come on this subject, but I just want to make a quick +note about stuff a friend just brought up. + +For people that share their computers, should have master passwords for +each user, and encrypt accounts, logs, log out photos, settings, etc. diff --git a/docs/index.html b/docs/index.html index db70d09..ce47ca2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -15,41 +15,41 @@ Welcome to the home of SledjHamr!
  • SledjHamr Tearing down the garden walls.
  • Server side -
  • -
  • Nails bangs it all together, mostly via the command pump.
  • -
  • mumble Voice integration.
  • -
  • The various libraries used.
  • +
  • We take privacy seriously.
  • +
  • portals Killer feature!
  • +
  • OMG WTF BBQ A means of making UUIDs location-agnostic. This is where we deal with systems to keep track of where in the web assets are, and to cache them.
  • +
  • no accounts We don need no stinkin' accounts.
  • +
  • NGIW REST is probably good to apply to the web server part. Alice wants JSON to, but see nails.
  • + +
  • The Naminator eliminates human readable names, to make way for computer names from SkyNet. Or something.
  • +
  • Nails bangs it all together, mostly via the command pump.
  • +
  • mumble Voice integration.
  • +
  • The various libraries used.
  • Croquet integration Just an idea, but we should support other virtual world tech if we can.
  • -
  • ClientHamr How to rip code out of the client and make it better.
  • +
  • ClientHamr How to rip code out of the client and make it better.
  • -
  • Bookie Dealing with libraries.
  • +
  • Bookie Dealing with libraries.
  • +
  • BlackListAssetServersTracker Might be cool if you could accept/reject asset servers. For copyright control or to avoid seeing yucky stuff.
  • We have a code repo on github now - https://github.com/onefang/SledjHamr with just a small README that points to this page. The experimental branch has all the actual code and stuff. We can finally start writing code. A local copy of the source can be found here.

    Now that we have a web site, I should turn this into a real web site, huh?

    -- cgit v1.1