aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-01-01 21:57:24 +1000
committerDavid Walter Seikel2016-01-01 21:57:24 +1000
commitbc44e6b3339976fc08d86eecc79f972fb90aecab (patch)
tree8c4dc473840ba773a7a2ee393b2045cc758dc024
parentAdded a test HTML page for bringing the design docs into the source repo. (diff)
downloadSledjHamr-bc44e6b3339976fc08d86eecc79f972fb90aecab.zip
SledjHamr-bc44e6b3339976fc08d86eecc79f972fb90aecab.tar.gz
SledjHamr-bc44e6b3339976fc08d86eecc79f972fb90aecab.tar.bz2
SledjHamr-bc44e6b3339976fc08d86eecc79f972fb90aecab.tar.xz
Import the design docs from Drupal / MediaWiki.
-rw-r--r--docs/BVJ.html160
-rw-r--r--docs/BlackListAssetServersTracker.html7
-rw-r--r--docs/ClientHamr.html10
-rw-r--r--docs/Croquet-integration.html114
-rw-r--r--docs/Grid-data-flow.html245
-rw-r--r--docs/Grid_data_flow.pngbin0 -> 207031 bytes
-rw-r--r--docs/InworldAnimationEditor.html109
-rw-r--r--docs/LSL-functions-implemented.html61
-rw-r--r--docs/LuaSL-New-scripting-engine.html796
-rw-r--r--docs/NGIW.Commands.html45
-rw-r--r--docs/NGIW.html49
-rw-r--r--docs/Nails.html2514
-rw-r--r--docs/OMG-WTF-BBQ.html54
-rw-r--r--docs/SledjHamr.html134
-rw-r--r--docs/index.html31
15 files changed, 4299 insertions, 30 deletions
diff --git a/docs/BVJ.html b/docs/BVJ.html
new file mode 100644
index 0000000..c96574d
--- /dev/null
+++ b/docs/BVJ.html
@@ -0,0 +1,160 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<h2> Syntax </h2>
6<p>This example BVH is 20 lines 505 characters, and defines a pointless animation on a trivial skeleton.</p>
7<pre> HIERARCHY
8 ROOT Hips
9 {
10 OFFSET 0.00 0.00 0.00
11 CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation
12 JOINT RightUpLeg
13 {
14 OFFSET -3.91 0.00 0.00
15 CHANNELS 3 Zrotation Xrotation Yrotation
16 End Site
17 {
18 OFFSET 0.00 -3.46 0.00
19 }
20 }
21 }
22 MOTION
23 Frames: 2
24 Frame Time: 0.033333
25 8.03 35.01 88.36 -3.41 14.78 -164.35 13.09 40.30 -24.60
26 7.81 35.10 86.47 -3.78 12.94 -166.97 12.64 42.57 -22.34
27</pre>
28<p>&nbsp;</p>
29<h3> JSON </h3>
30<p>First the syntax is changed to be JSON. The sample above is transformed to 19 lines 715 characters:</p>
31<pre> {
32 "HIERARCHY":{
33 "NAME":"Hips",
34 "OFFSET":[0.00,0.00,0.00],
35 "CHANNELS":["Xposition","Yposition","Zposition","Zrotation","Xrotation","Yrotation"],
36 "JOINTS":[
37 {
38 "NAME": "RightUpLeg",
39 "OFFSET": [-3.91, 0.00, 0.00],
40 "CHANNELS": ["Zrotation", "Xrotation", "Yrotation"],
41 "JOINTS": [
42 {
43 "END": true,
44 "OFFSET": [0.00, -3.46, 0.00]}]}]},
45 "MOTION":{
46 "Frame Time":0.033333,
47 "Frames":[
48 [8.03,35.01,88.36,-3.41,14.78,-164.35,13.09,40.30,-24.60],
49 [7.81,35.10,86.47,-3.78,12.94,-166.97,12.64,42.57,-22.34]]}}
50
51</pre>
52<p>or equivalently to 5 lines 469 characters:</p>
53<pre> {"HIERARCHY":{"NAME":"Hips","OFFSET":[0.00,0.00,0.00],"CHANNELS":["Xposition","Yposition","Zposition","Zrotation","Xrotation","Yrotation"],
54 "JOINTS":[{"NAME":"RightUpLeg","OFFSET":[-3.91,0.00,0.00],"CHANNELS":["Zrotation","Xrotation","Yrotation"],
55 "JOINTS":[{"END":true,"OFFSET":[0.00,-3.46,0.00]}]}]},
56 "MOTION":{"Frame Time":0.033333,"Frames":[[8.03,35.01,88.36,-3.41,14.78,-164.35,13.09,40.30,-24.60],
57 [7.81,35.10,86.47,-3.78,12.94,-166.97,12.64,42.57,-22.34]]}}
58</pre>
59<p>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.</p>
60<p>&nbsp;</p>
61<h2> Semantics </h2>
62<p>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.</p>
63<p>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.</p>
64<p>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 visualized.</p>
65<p>&nbsp;</p>
66<h2> Attachment points </h2>
67<p>The hierarchy portion of a BVJ is a fine place to express attachment points.</p>
68<p>&nbsp;</p>
69<h3> Syntax </h3>
70<pre> ...
71 {
72 "NAME": "RightUpLeg",
73 "ATTACH": [12],
74 "OFFSET": [-3.91, 0.00, 0.00],
75 ...
76</pre>
77<p>&nbsp;</p>
78<h3> Semantics </h3>
79<p>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.</p>
80<p>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.</p>
81<p>Q: How to define the zero rotation at the attachment point? Need to match what is done now.</p>
82<p>&nbsp;</p>
83<h3> Multi-attach </h3>
84<p>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:</p>
85<pre> ...
86 {
87 "NAME": "RightUpLeg",
88 "ATTACH": [12,99]
89 "OFFSET": [-3.91, 0.00, 0.00],
90 ...
91</pre>
92<p>&nbsp;</p>
93<h3> Still More Attachments </h3>
94<p>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.</p>
95<p>&nbsp;</p>
96<h2> Animating Prims </h2>
97<p>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.</p>
98<p>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.</p>
99<p>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 center 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 center 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.</p>
100<p>&nbsp;</p>
101<h2> Animating Attached Prims </h2>
102<p>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.</p>
103<p>&nbsp;</p>
104<h3> Yet More Attachment Points </h3>
105<p>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 atachment point 103, the object "Pretty Bow" would move with a part of the tail, not with some random part of the avy.</p>
106<p>&nbsp;</p>
107<h2> Sampling and Keyframing </h2>
108<p>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.</p>
109<p>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.</p>
110<p>&nbsp;</p>
111<h3> Keyframe Syntax and Semantics </h3>
112<p>I propose adding keyframe syntax as an alternative to the existing "MOTION" section of BVH files.</p>
113<pre> {
114 "HIERARCHY":{...},
115 "KEYFRAMES":[
116 {
117 "AT":0.00,
118 "Hips":[8.03,35.01,88.36,-3.41,14.78,-164.35],
119 "RightUpLeg":[13.09,40.30,-24.60]},
120 {
121 "AT":0.033333,
122 "Hips":[7.81,35.10,86.47,-3.78,12.94,-166.97],
123 "RightUpLeg":[12.64,42.57,-22.34]}]}
124</pre>
125<p>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.</p>
126<p>&nbsp;</p>
127<h2> Animations, Not BVH Files </h2>
128<p>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.</p>
129<p>I favor this placement</p>
130<pre> {
131 "priority":3.5,
132 "looped":false,
133 "HIERARCHY":{ ... } ...}
134</pre>
135<p>But can see arguments for this instead</p>
136<pre> {
137 "HIERARCHY":{ ... }
138 "MOTION": {
139 "priority":3.5,
140 "looped":false,
141 ...} ...}
142</pre>
143<p>&nbsp;</p>
144<p>&nbsp;</p>
145<h2> At This Time </h2>
146<p>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 analog 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 <strong>after</strong> animation time 0 and ends <strong>before</strong> 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.</p>
147<p>&nbsp;</p>
148<h2> Tools to Make BVJ Files </h2>
149<p>Currently there are none, but see <a href="InworldAnimationEditor.html">InworldAnimationEditor</a> 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 synthesize a keyframe representation that is a close match to a set of samples.</p>
150<p>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.</p>
151<p>&nbsp;</p>
152<h2> Client to Client </h2>
153<p>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.</p>
154<p>&nbsp;</p>
155<h3> Changing Poses </h3>
156<p>Fang Said: See the very last paragraph of <a href="SledjHamr.html">SledjHamr</a>, the "random notes from my old Web 3.0 document " section at the bottom, to see one suggested method of moving your hand.</p>
157<p>Alice Replied: Looks cool, but requires Inverse Kinematics (if you mean the touch commands), or some puppeteer protocol that I know nothing about.</p>
158<p>What I imagine right now is <a href="InworldAnimationEditor.html">InworldAnimationEditor</a></p>
159</body>
160</html>
diff --git a/docs/BlackListAssetServersTracker.html b/docs/BlackListAssetServersTracker.html
new file mode 100644
index 0000000..f1aae3e
--- /dev/null
+++ b/docs/BlackListAssetServersTracker.html
@@ -0,0 +1,7 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<p><br /> This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p>
6</body>
7</html>
diff --git a/docs/ClientHamr.html b/docs/ClientHamr.html
new file mode 100644
index 0000000..42cb46e
--- /dev/null
+++ b/docs/ClientHamr.html
@@ -0,0 +1,10 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<p>Consider your inventory. A mess huh. Well, what is it really, especially in a world like <a href="NGIW.html">NGIW</a> / <a href="index.html">OMG</a> 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.</p>
6<p>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.</p>
7<p>That's the Client Hammer.</p>
8<p>Note - The simian grid has a WebDav front end to inventory. <a href="http://code.google.com/p/openmetaverse/">http://code.google.com/p/openmetaverse/</a></p>
9</body>
10</html>
diff --git a/docs/Croquet-integration.html b/docs/Croquet-integration.html
new file mode 100644
index 0000000..943274e
--- /dev/null
+++ b/docs/Croquet-integration.html
@@ -0,0 +1,114 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<p>I just stumbled on this - <a href="http://forum.world.st/OpenCobalt-Croquet-client-for-Opensim-td622809.html">http://forum.world.st/OpenCobalt-Croquet-client-for-Opensim-td622809.html</a></p>
6<div>
7<p>&nbsp;</p>
8<p>I'll reproduce the relevant part here -</p>
9<pre>Rich White wrote:
10
11&gt; Thinking out loud regarding the feasible of a OpenCobalt /Croquet
12&gt; client/peer for Opensim ?
13&gt;
14&gt; * Connect to Opensim Server - much like Cobalt connects to Jabber now
15&gt; * Portal window opens to server - much like opening a stored file or
16&gt; connecting to another peer
17&gt;
18&gt; Convergence of the technologies would seem to bring the best of both
19&gt; "worlds" (peer/server/content) into one ecosystem.
20&gt;
21&gt; A few dangling pointers:
22&gt; http://opensimulator.org/wiki/OpenSim_Archives
23&gt; http://opensimulator.org/wiki/User_Documentation
24&gt;
25&gt;
26&gt; Ideas? Is a convergence possible? ... This though may be WAY off but
27&gt; wanted to bring it up and see what others thought.
28&gt;
29&gt; Cheers,
30&gt; Rich
31&gt; ===
32&gt;
33&gt;
34... [show rest of quote]
35
36Actually, I've been looking at merging SL and Croquet off and on for
37several years, and there's far more interesting ways of merging the two
38that can serve as a pattern for using Croquet in many situations besides
39formal virtual worlds.
40
41The simplest is to simply use the SL media plugin or the equivalents
42that work with 3rd party viewers, and create a "telepresence" between
43worlds. I.E. a simple view-only portal or 2D equivalent using VNC, with
44or without interaction:
45
46 http://wiki.secondlife.com/wiki/User:Saijanai_Kuhn/Plugins_discussion#Media_Rendering_Plugin
47
48This particular use can be extended to provide a service that could be
49added to SL instant messaging, so that you could create a temporary
50world and invite a buncha people to join you in a private 3D chat
51island, for collaboration or simply to "hangout" without having the
52overhead of maintaining a genuine OpenSim or SL sim.
53
54Obviously, you can extend the concept to be an option for ANY kind of 2D
55collaboration system, from Jabber to IRC to Google Wave to whatever.
56Imagine having a "create Croquet island/invite people" option as
57standard in any IRC client.
58
59Getting back to typical virtual worlds usage, the idea of a viewer
60plugin that leverages all of Squeak/Croquet's functionality to enhance
61some other viewer shouldn't be sneered at. Right now, the SL viewer (for
62example) barely provides access to raw mouse coordinates for UV tracking
63on a texture (the current media plugin scenario), but there's no reason
64why any arbitrary event or internet packet couldn't be intercepted and
65shunted off to squeak for pre/post processing.
66
67http://wiki.secondlife.com/wiki/User:Saijanai_Kuhn/Plugins_discussion#Proposed_Extension_to_Media_Plugin
68
69
70I'm currently working on a proof of concept of this last by intercepting
71arbitrary packets to/from the SL server/viewer using the Gridproxy
72utility and/or injecting or pre/post processing such packets. When you
73combine that with the ability to intercept mouse UV coordinates on a
74texture in SL and render into said texture from Squeak/Croquet directly,
75you get all sorts of possibilities. Add localhost/seaside into mix and
76you've got a very powerful experimental system that can project control
77surfaces via html on a prim, or in the SL built-in browser, or via
78VNC-like interactions directly to a prim on the local SL viewer.
79Combine that with broadcasting to streaming server, and you have a
80virtual worlds whiteboard that can project into SL ala the metanomics
81virtual lecture hall.
82
83http://www.metanomics.net/
84
85
86Start interacting with internal viewer events, and you can leverage
87physics/graphics creation/etc from the Squeak/Croquet side, and merge it
88directly into a local SL instance for custom puppeteering with the
89possiblilty of doing a P2P collaboration mechanima where individual
90avatars can be controlled by a single machine using a script and/or
91timeline control interface. The resulting avatar activity can be
92"filmed" for mechanima, or could be uploaded to a central server for
93rebroadcast to a virtual world audience (or both).
94
95http://wiki.secondlife.com/wiki/User:Saijanai_Kuhn/Plugins_discussion#Puppeteering_Plugin
96
97
98Instead of using 2D projections, you could also leverage the 3D portal
99system of Croquet to inject 3D cenes from Croquet into a given virtual
100world viewer, and either maintain a backk-end P2P connection between
101participants, or shoot the composite scene to a central server in some
102fashion using the existing virtual world protocols.
103
104The possibilities are endless for synergy between Croquet and other
105virtual worlds, IMHO.
106
107
108Lawson (Saijani Kuhn in Second Life)
109
110
111</pre>
112</div>
113</body>
114</html>
diff --git a/docs/Grid-data-flow.html b/docs/Grid-data-flow.html
new file mode 100644
index 0000000..f36b79f
--- /dev/null
+++ b/docs/Grid-data-flow.html
@@ -0,0 +1,245 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<h2> Existing, and possibly incorrect, wisdom </h2>
6<p>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.</p>
7<p>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.</p>
8<p>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.</p>
9<p>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.</p>
10<p>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.</p>
11<p>Now, lets figure out what's really going on.</p>
12<p>&nbsp;</p>
13<h2> ROBUST </h2>
14<p>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.</p>
15<p>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.</p>
16<p>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?</p>
17<p>Apparently ROBUST is designed to allow code reuse.</p>
18<p>Note that this will allow us to easily integrate <a href="index.html">OMG</a>, 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. <a href="Nails.html#command_pump">Nails:command pump</a> 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-)</p>
19<p>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.</p>
20<p>&nbsp;</p>
21<h2> sim server view </h2>
22<p>Sim servers have these, which include connection strings to the local database server -</p>
23<ul>
24<li>AssetService - Also includes a URL to the grid server.</li>
25<li>AvatarService - Also includes a URL to the grid server.</li>
26<li>AuthenticationService - Also includes a URL to the grid server.</li>
27<li>DatabaseService -</li>
28<li>FriendsService - Also includes a URL to the grid server.</li>
29<li>GridUserService - Also includes a URL to the grid server.</li>
30<li>InventoryService - Also includes a URL to the grid server.</li>
31<li>UserAccountService - Also includes a URL to the grid server.</li>
32</ul>
33<p>These only include a URL to the grid server -</p>
34<ul>
35<li>GridService - Also includes the GatekeeperService URL, a different port.</li>
36<li>PresenceService</li>
37<li>ProfileServerURL - For HG profiles, same port as the Gatekeeper, but more on the end of the URL.</li>
38</ul>
39<p>There are three possible asset caches, only one should be on, but none of them can be on -</p>
40<ul>
41<li>CenomeMemoryAssetCache</li>
42<li>FlotsamAssetCache - file cache on the sim server. The config implies that the disk cache can be temporary.</li>
43<li>GlynnTuckerAssetCache</li>
44</ul>
45<p>&nbsp;</p>
46<h2> grid server view </h2>
47<p>A quick look shows the sims on the grid server seem to be setup the same way.</p>
48<p>ROBUST has this to say -</p>
49<ul>
50<li>AssetService - Has a default asset loader that looks like a file based system. Think there is a database component to.</li>
51<li>AuthenticationService - database.</li>
52<li>AvatarService - Avatar appearance?</li>
53<li>DatabaseService - connection string to grid database.</li>
54<li>FreeswitchService - voice stuff.</li>
55<li>FriendsService -</li>
56<li>GatekeeperService - controls incoming HG users, has dependencies, will list them later if important for the dataflow.</li>
57<li>GridInfoService - supplies info to viewer grid managers when they request it.</li>
58<li>GridService - depends on AssetService for map tiles.</li>
59<li>GridUserService - database.</li>
60<li>HGAsset and HGInventory services, ignore for now.
61<ul>
62<li>HGInventoryService - limited wrapper around InventoryService for HG.</li>
63</ul>
64</li>
65<li>InventoryService -</li>
66<li>LibraryService - The assets in the library, file based.</li>
67<li>LoginService - controls users logins.
68<ul>
69<li>Depends on UserAccountService, GridUserService, AuthenticationService, InventoryService, AvatarService, PresenceService, GridService, SimulationService, LibraryService, UserAgentService, FriendsService.</li>
70<li>Includes URLS to GateKeeper, Home, InventoryServer, AssetServer, ProfileServer.</li>
71</ul>
72</li>
73<li>OpenIdService - just depends on AuthenticationService and UserAccountService.</li>
74<li>PresenceService -</li>
75<li>UserAccountService - database. Depends on AuthenticationService, PresenceService, GridService, and InventoryService.</li>
76<li>UserAgentService - controls outgoing HG users.
77<ul>
78<li>depends on GridUserService, GridService, GatekeeperService. Optionally includes the IP of the LoginService server if it's on a different box.</li>
79</ul>
80</li>
81<li>WifiService - really badly named, it's a brand name for a web front end.</li>
82</ul>
83<p>&nbsp;</p>
84<h2> the big data holders </h2>
85<p>On sims -</p>
86<p>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.</p>
87<p>On the grid server -</p>
88<p>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.</p>
89<p>Soooo, what is stored where? Which are the real assets? Where's the data, database or file? Where's the cheese? B-)</p>
90<p>The source code is here -</p>
91<p>&nbsp;</p>
92<h3> InventoryService </h3>
93<ul>
94<li>The sim uses OpenSim//Services/Connectors/Inventory/XInventoryConnector.cs
95<ul>
96<li>Looks for it's ROBUST URL.</li>
97<li>Has a bunch of methods that just wrap ROBUST URL/xinventory POST requests.</li>
98</ul>
99</li>
100</ul>
101<p>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?</p>
102<ul>
103<li>ROBUST uses OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs (the IN connector)
104<ul>
105<li>Looks for config entry [InventoryService] LocalServiceModule, which in this case is OpenSim/Services/InventoryService/XInventoryService.cs.</li>
106<li>Loads that module, then registers a POST handler.</li>
107<li>The POST handler finds out which command was requested, and hands that off to the method that deals with that command.</li>
108<li>The method is a wrapper around suitable methods in the LocalServiceModule. The wrapper method encodes results for sending back as the POST reply as more XML.</li>
109</ul>
110</li>
111<li>OpenSim/Services/InventoryService/XInventoryService.cs
112<ul>
113<li>Looks for it's database connection string.</li>
114<li>Opens a database connection.</li>
115<li>Waits for the IN connector to invoke it's methods.</li>
116<li>Likely other things besides this IN connector can load this code and call it for other Inventory services.</li>
117</ul>
118</li>
119</ul>
120<p>Hmmm, according to OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs -&gt; CacheInventoryServiceURL() there may already be a mechanism in place to use other inventory servers PER USER. For HG I think. Makes sense. B-)</p>
121<p>&nbsp;</p>
122<h3> AssetService </h3>
123<ul>
124<li>The sim uses - OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
125<ul>
126<li>Looks for it's ROBUST URL.</li>
127<li>Registers the "dump asset" console command.</li>
128<li>Has a bunch of methods that just wrap ROBUST URL/asssets GET, DELETE, and POST requests.
129<ul>
130<li>They check the cache first, do the request, and keep the cache up to date.</li>
131<li>Some make a handler() call. Not sure what that is.</li>
132</ul>
133</li>
134</ul>
135</li>
136</ul>
137<ul>
138<li>OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs
139<ul>
140<li>See the description for the ROBUST version of this.</li>
141</ul>
142</li>
143</ul>
144<ul>
145<li>flotsam cache - OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs</li>
146</ul>
147<ul>
148<li>ROBUST uses OpenSim/Server/Handlers/Asset/AssetServerConnector.cs (the IN connector)
149<ul>
150<li>Looks for config entry [AssetService] LocalServiceModule, which in this case is OpenSim/Services/AssetService/AssetService.cs.</li>
151<li>Loads that module, then registers GET, DELETE, and POST handlers.</li>
152<li>Those handlers override Handle(), which just wraps calls to the LocalServiceModule in response to HTTP GET, DELETE, and POST requests.</li>
153</ul>
154</li>
155<li>OpenSim/Services/AssetService/AssetService.cs
156<ul>
157<li>Looks for it's database connection string.</li>
158<li>Opens a database connection.</li>
159<li>Registers the "show digest" and "delete asset" console commands.</li>
160<li>Looks for DefaultAssetLoader, which in this case is OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs
161<ul>
162<li>Default assets are things like the stuff in the inventory Library folder, and basic things like the sounds that the viewer makes.</li>
163<li>These are on disk assets. The library has it's own pointers to this data.</li>
164<li>Note than these default assets have to be on the grid AND on each sim server. There is a note that OpenSim intends to fix this bug. This is not good for the idea of moving freebies to the library. B-(</li>
165</ul>
166</li>
167<li>Has a bunch of virtual methods that are thin wrappers around database calls.</li>
168</ul>
169</li>
170</ul>
171<ul>
172<li>OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs</li>
173</ul>
174<p>&nbsp;</p>
175<h3> Users of these services </h3>
176<p>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.</p>
177<p>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.</p>
178<p>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.</p>
179<p>&nbsp;</p>
180<h3> database </h3>
181<p>prims is the prims in the sim. primshapes is their shapes. primitems is the content of the sim prims.</p>
182<p>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</p>
183<ul>
184<li>delete from primshapes left join prims on prims.uuid = primshapes.uuid where prims.RegionUUID='75e91aa0-e9e4-406e-a85e-1bab7c55301c';</li>
185<li>delete from primitems left join prims on primitems.primID = prims.uuid where prims.RegionUUID='75e91aa0-e9e4-406e-a85e-1bab7c55301c';</li>
186<li>delete from prims where RegionUUID='75e91aa0-e9e4-406e-a85e-1bab7c55301c';</li>
187</ul>
188<p>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?</p>
189<p>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.</p>
190<p>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-(</p>
191<p>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.</p>
192<p>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.</p>
193<p>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.</p>
194<p>NOTE - it takes a loooong time to search the assets database for a name.</p>
195<p>&nbsp;</p>
196<p>&nbsp;</p>
197<h4> Sim assets </h4>
198<p>Sim server opensim.prims.RegionUUID and UUID</p>
199<p>Sim server opensim.prims.UUID -&gt; Sim server opensim.primshapes.UUID (one to one) The actual prim shape.</p>
200<p>Sim server opensim.prims.UUID -&gt; Sim server opensim.primitems.primID (one to many) The meta data for the prims contents.</p>
201<p>Sim server opensim.primitems.assetID -&gt; Grid server opensim.assets.id (one to one) The actual data for the prims contents.</p>
202<p>prims.SceneGroupID seems to be what ties a linkset together.</p>
203<p>Primshapes has two binary blobs, one called Texture, the other called ExtraParams.</p>
204<p>primshapes.ExtraParams includes flexi (various flexi parameters), light (local light parameters), sculpt (type, sculptMapTextureUUID), and projection (projectionTextureUUID, FOV, focus, amb).</p>
205<p>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.</p>
206<p>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.</p>
207<p>&nbsp;</p>
208<h4> Inventory assets </h4>
209<p>All on the grid server.</p>
210<p>opensim.inventoryitems.inventoryID, avatarID, and parentFolderID</p>
211<p>opensim.inventoryitems.assetID -&gt; assets.id (one to one) The actual data for the inventory.</p>
212<p>opensim.inventoryfolders.folderID, agentID, and ParentFolderID</p>
213<p>This seems pretty straight forward.</p>
214<p>&nbsp;</p>
215
216<img src="Grid_data_flow.png" alt="Grid data flow"/>
217
218<p>&nbsp;</p>
219<h2> Experiments </h2>
220<p>&nbsp;</p>
221<h3> Using a new assetService on an existing sim server. </h3>
222<p>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.</p>
223<p>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?</p>
224<p>&nbsp;</p>
225<h3> Using a different InventoryService for an existing / new user </h3>
226<p>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.</p>
227<p>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?</p>
228<p>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.</p>
229<p>Hmmm, does not look like GatekeeperURI is actually used. shrugs</p>
230<p>&nbsp;</p>
231<h3> Trying to make a new sim using an old sims UUID on a different server </h3>
232<p>In theory this should not work, since the prim metadata is on the old sim server, and not accessible from the new server.</p>
233<p>&nbsp;</p>
234<h3> Load an OAR that includes a texture that is NOT in anyone's inventory, to see where it ends up. </h3>
235<p>I'll have to create a fake texture first, then see if I can fake an OAR with that texture.</p>
236<p>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.</p>
237<p>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.</p>
238<p>&nbsp;</p>
239<h2> notes </h2>
240<p>Just hijacking my own page here for a moment - The console uses the&nbsp;? key to show help, no matter where you type it. So&nbsp;? 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.</p>
241<p>I just woke up and had an idea, it might turn out to be crap once I have actually thought about it. lol</p>
242<p>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.</p>
243<p><br /> This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p>
244</body>
245</html>
diff --git a/docs/Grid_data_flow.png b/docs/Grid_data_flow.png
new file mode 100644
index 0000000..8324280
--- /dev/null
+++ b/docs/Grid_data_flow.png
Binary files differ
diff --git a/docs/InworldAnimationEditor.html b/docs/InworldAnimationEditor.html
new file mode 100644
index 0000000..d3cbf3e
--- /dev/null
+++ b/docs/InworldAnimationEditor.html
@@ -0,0 +1,109 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<h2> Normal Editing </h2>
6<p>Step 1: right click avy &gt; edit pose &gt; a list of currently playing animations displays and you can choose one. Or right click avy &gt; new pose</p>
7<p>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 gray ball.</p>
8<p>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.</p>
9<ul>
10<li>It has a help button</li>
11</ul>
12<ul>
13<li>It has a first use dialog</li>
14</ul>
15<ul>
16<li>It includes a numbers area
17<ul>
18<li>channel values for the current joint</li>
19<li>you can type in numbers</li>
20<li>you can hit a spinner to increase/decrease</li>
21</ul>
22</li>
23</ul>
24<ul>
25<li>It has meta info edit boxes
26<ul>
27<li>animation name</li>
28<li>UUID (if it lives on a server)</li>
29<li>File path (if it lives on your hard drive)</li>
30<li>save to inventory/disk button(s)</li>
31<li>priority</li>
32<li>loop points as numbers</li>
33</ul>
34</li>
35</ul>
36<ul>
37<li>It has a time graph
38<ul>
39<li>showing which frames have animation information</li>
40<li>what the 'current time' of the animation is</li>
41<li>play button</li>
42<li>pause button</li>
43<li>step forward button</li>
44<li>step backward button</li>
45<li>set the current time</li>
46<li>loop points as marks on the time line</li>
47<li>click a frame mark, highlights joints with animation information</li>
48<li>can delete the keyframe</li>
49<li>can add/update a keyframe</li>
50<li>indication of unsaved changes near/on
51<ul>
52<li>the step/play/pause buttons and the close button</li>
53</ul>
54</li>
55</ul>
56</li>
57</ul>
58<ul>
59<li>It has a skeleton editor
60<ul>
61<li>acts a lot like a hierarchy browser</li>
62<li>can move rename add and delete joints</li>
63<li>/me hand waves about selecting new things for new joints</li>
64<li>includes place to change meta data about a joint
65<ul>
66<li>name</li>
67<li>channels</li>
68</ul>
69</li>
70</ul>
71</li>
72</ul>
73<ul>
74<li>It has a bunch of new keyboard short cuts when the GUI is focused
75<ul>
76<li>u/o rotate about X</li>
77<li>i/k rotate about Y</li>
78<li>j/l rotate about Z</li>
79<li>y move up the joint hierarchy</li>
80<li>h move to a sibling/cousin at the same level. I.e. flip from right foot to left foot.</li>
81<li>n move down the joint hierarchy</li>
82<li>p play/pause</li>
83<li>&lt;space&gt; step forward</li>
84</ul>
85</li>
86</ul>
87<p>&nbsp;</p>
88<h2> Inverse Kinematics </h2>
89<p>The GUI I imagine for IK, perhaps a tab on the animation editor?</p>
90<ul>
91<li>something to lock/unlock joints</li>
92<li>a standard edit control on the selected joint
93<ul>
94<li>dragging the joint makes IK do it's magic to compute angles</li>
95</ul>
96</li>
97</ul>
98<p>&nbsp;</p>
99<h2> Edit Multiple Animations </h2>
100<p>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 synchronized, so stepping a frame forward, steps all animations forward.</p>
101<p>Most importantly, if you are granted permission, you should be able to right click on another avy, and choose edit pose.</p>
102<p>&nbsp;</p>
103<h2> Animate other stuff </h2>
104<p>Now, I described all this as if <a href="BVJ.html">BVJ</a>'s only applied to avatars. They don't. But the commands and behaviors are the same when editing animations for a door, an avatar, or an attachment (to an attachment to...) to an avatar.</p>
105<p>&nbsp;</p>
106<h2> Possibilities </h2>
107<p>If you edit your pose, and the animations of 3 small balls, you could make a juggle animation with balls and hands synchronized. You can make "play catch" animations for two people and a ball. Be a multi-legged creature: add bones, attach prims, animate, enjoy.</p>
108</body>
109</html>
diff --git a/docs/LSL-functions-implemented.html b/docs/LSL-functions-implemented.html
index 622d4e3..84a881e 100644
--- a/docs/LSL-functions-implemented.html
+++ b/docs/LSL-functions-implemented.html
@@ -23,7 +23,7 @@
23<td>Stub that passes details to the server and waits for the response if one is needed.</td> 23<td>Stub that passes details to the server and waits for the response if one is needed.</td>
24</tr> 24</tr>
25<tr> 25<tr>
26<td><span style="color: magenta;"><span style="color: #999999;">Gray</span></span></td> 26<td><span style="color: #999999;">Gray</span></td>
27<td>Stub that fakes enough for the current tests.</td> 27<td>Stub that fakes enough for the current tests.</td>
28</tr> 28</tr>
29<tr> 29<tr>
@@ -81,8 +81,8 @@
81</tr> 81</tr>
82</tbody> 82</tbody>
83</table> 83</table>
84<h2><span class="mw-headline">&nbsp;</span></h2> 84<h2>&nbsp;</h2>
85<h2><span class="mw-headline"><span class="mw-headline">animation override</span></span></h2> 85<h2>animation override</h2>
86<table border="1"><caption>&nbsp;</caption> 86<table border="1"><caption>&nbsp;</caption>
87<tbody> 87<tbody>
88<tr><th><span style="color: #ffffff;">LSL function</span></th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 88<tr><th><span style="color: #ffffff;">LSL function</span></th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -106,8 +106,8 @@
106</tr> 106</tr>
107</tbody> 107</tbody>
108</table> 108</table>
109<h2><span class="mw-headline">&nbsp;</span></h2> 109<h2>&nbsp;</h2>
110<h2><span class="mw-headline"><span class="mw-headline">avatar </span></span></h2> 110<h2>avatar </h2>
111<table border="1"><caption>&nbsp;</caption> 111<table border="1"><caption>&nbsp;</caption>
112<tbody> 112<tbody>
113<tr><th><span style="color: #ffffff;">LSL function</span></th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 113<tr><th><span style="color: #ffffff;">LSL function</span></th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -342,7 +342,7 @@
342</tbody> 342</tbody>
343</table> 343</table>
344<p>&nbsp;</p> 344<p>&nbsp;</p>
345<h2><span class="mw-headline"> collision / detect / sensor </span></h2> 345<h2> collision / detect / sensor </h2>
346<table border="1"><caption>&nbsp;</caption> 346<table border="1"><caption>&nbsp;</caption>
347<tbody> 347<tbody>
348<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 348<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -499,7 +499,7 @@
499</tbody> 499</tbody>
500</table> 500</table>
501<p>&nbsp;</p> 501<p>&nbsp;</p>
502<h2><span class="mw-headline"> communications </span></h2> 502<h2> communications </h2>
503<table border="1"><caption>&nbsp;</caption> 503<table border="1"><caption>&nbsp;</caption>
504<tbody> 504<tbody>
505<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 505<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -596,7 +596,7 @@
596</tbody> 596</tbody>
597</table> 597</table>
598<p>&nbsp;</p> 598<p>&nbsp;</p>
599<h2><span class="mw-headline"> inventory </span></h2> 599<h2> inventory </h2>
600<table border="1"><caption>&nbsp;</caption> 600<table border="1"><caption>&nbsp;</caption>
601<tbody> 601<tbody>
602<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 602<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -704,8 +704,8 @@
704</tr> 704</tr>
705</tbody> 705</tbody>
706</table> 706</table>
707<h2><span class="mw-headline">&nbsp;</span></h2> 707<h2>&nbsp;</h2>
708<h2><span class="mw-headline"><span class="mw-headline">JSON<br /></span></span></h2> 708<h2>JSON<br /></h2>
709<table border="1"><caption>&nbsp;</caption> 709<table border="1"><caption>&nbsp;</caption>
710<tbody> 710<tbody>
711<tr><th><span style="color: #ffffff;">LSL function</span></th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 711<tr><th><span style="color: #ffffff;">LSL function</span></th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -742,7 +742,7 @@
742</tbody> 742</tbody>
743</table> 743</table>
744<p>&nbsp;</p> 744<p>&nbsp;</p>
745<h2><span class="mw-headline"> land </span></h2> 745<h2> land </h2>
746<table border="1"><caption>&nbsp;</caption> 746<table border="1"><caption>&nbsp;</caption>
747<tbody> 747<tbody>
748<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 748<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -911,7 +911,7 @@
911</tbody> 911</tbody>
912</table> 912</table>
913<p>&nbsp;</p> 913<p>&nbsp;</p>
914<h2><span class="mw-headline"> list </span></h2> 914<h2> list </h2>
915<table border="1"><caption>&nbsp;</caption> 915<table border="1"><caption>&nbsp;</caption>
916<tbody> 916<tbody>
917<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 917<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -1050,7 +1050,7 @@
1050</tbody> 1050</tbody>
1051</table> 1051</table>
1052<p>&nbsp;</p> 1052<p>&nbsp;</p>
1053<h2><span class="mw-headline"> math </span></h2> 1053<h2> math </h2>
1054<table border="1"><caption>&nbsp;</caption> 1054<table border="1"><caption>&nbsp;</caption>
1055<tbody> 1055<tbody>
1056<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 1056<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -1243,7 +1243,7 @@
1243</tbody> 1243</tbody>
1244</table> 1244</table>
1245<p>&nbsp;</p> 1245<p>&nbsp;</p>
1246<h2><span class="mw-headline"> media </span></h2> 1246<h2> media </h2>
1247<table border="1"><caption>&nbsp;</caption> 1247<table border="1"><caption>&nbsp;</caption>
1248<tbody> 1248<tbody>
1249<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 1249<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -1387,8 +1387,8 @@
1387</tr> 1387</tr>
1388</tbody> 1388</tbody>
1389</table> 1389</table>
1390<h2><span class="mw-headline">&nbsp;</span></h2> 1390<h2>&nbsp;</h2>
1391<h2><span class="mw-headline"><span class="mw-headline">path finding<br /></span></span></h2> 1391<h2>path finding<br /></h2>
1392<table border="1"><caption>&nbsp;</caption> 1392<table border="1"><caption>&nbsp;</caption>
1393<tbody> 1393<tbody>
1394<tr><th><span style="color: #ffffff;">LSL function</span></th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 1394<tr><th><span style="color: #ffffff;">LSL function</span></th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -1467,8 +1467,8 @@
1467</tbody> 1467</tbody>
1468</table> 1468</table>
1469<h2></h2> 1469<h2></h2>
1470<h2><span class="mw-headline">&nbsp;</span></h2> 1470<h2>&nbsp;</h2>
1471<h2><span class="mw-headline">physics </span></h2> 1471<h2>physics </h2>
1472<table border="1"><caption>&nbsp;</caption> 1472<table border="1"><caption>&nbsp;</caption>
1473<tbody> 1473<tbody>
1474<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 1474<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -1601,7 +1601,7 @@
1601</tbody> 1601</tbody>
1602</table> 1602</table>
1603<p>&nbsp;</p> 1603<p>&nbsp;</p>
1604<h2><span class="mw-headline"> object / prim / link </span></h2> 1604<h2> object / prim / link </h2>
1605<table border="1"><caption>&nbsp;</caption> 1605<table border="1"><caption>&nbsp;</caption>
1606<tbody> 1606<tbody>
1607<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 1607<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -1672,7 +1672,7 @@
1672<td>D</td> 1672<td>D</td>
1673</tr> 1673</tr>
1674<tr> 1674<tr>
1675<td><span style="color: #ff00ff;"></span><span style="color: #ff00ff;"><span style="color: #ff00ff;">llGetLinkNumberOfSides</span></span></td> 1675<td><span style="color: #ff00ff;">llGetLinkNumberOfSides</span></td>
1676<td>&nbsp;</td> 1676<td>&nbsp;</td>
1677<td>&nbsp;</td> 1677<td>&nbsp;</td>
1678<td>D</td> 1678<td>D</td>
@@ -1684,7 +1684,7 @@
1684<td>&nbsp;</td> 1684<td>&nbsp;</td>
1685</tr> 1685</tr>
1686<tr> 1686<tr>
1687<td><span style="color: #ff00ff;"><span style="color: #ff00ff;"></span></span><span style="color: #ff00ff;">llGetMinScaleFactor</span></td> 1687<td><span style="color: #ff00ff;">llGetMinScaleFactor</span></td>
1688<td>&nbsp;</td> 1688<td>&nbsp;</td>
1689<td>&nbsp;</td> 1689<td>&nbsp;</td>
1690<td>&nbsp;</td> 1690<td>&nbsp;</td>
@@ -1920,7 +1920,7 @@
1920</tbody> 1920</tbody>
1921</table> 1921</table>
1922<p>&nbsp;</p> 1922<p>&nbsp;</p>
1923<h2><span class="mw-headline"> rotation / scaling / translation </span></h2> 1923<h2> rotation / scaling / translation </h2>
1924<table border="1"><caption>&nbsp;</caption> 1924<table border="1"><caption>&nbsp;</caption>
1925<tbody> 1925<tbody>
1926<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 1926<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -2029,7 +2029,7 @@
2029</tbody> 2029</tbody>
2030</table> 2030</table>
2031<p>&nbsp;</p> 2031<p>&nbsp;</p>
2032<h2><span class="mw-headline"> script </span></h2> 2032<h2> script </h2>
2033<table border="1"><caption>&nbsp;</caption> 2033<table border="1"><caption>&nbsp;</caption>
2034<tbody> 2034<tbody>
2035<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 2035<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -2132,7 +2132,7 @@
2132</tbody> 2132</tbody>
2133</table> 2133</table>
2134<p>&nbsp;</p> 2134<p>&nbsp;</p>
2135<h2><span class="mw-headline"> simulator </span></h2> 2135<h2> simulator </h2>
2136<table border="1"><caption>&nbsp;</caption> 2136<table border="1"><caption>&nbsp;</caption>
2137<tbody> 2137<tbody>
2138<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 2138<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -2229,7 +2229,7 @@
2229</tbody> 2229</tbody>
2230</table> 2230</table>
2231<p>&nbsp;</p> 2231<p>&nbsp;</p>
2232<h2><span class="mw-headline"> string </span></h2> 2232<h2> string </h2>
2233<table border="1"><caption>&nbsp;</caption> 2233<table border="1"><caption>&nbsp;</caption>
2234<tbody> 2234<tbody>
2235<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 2235<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -2326,7 +2326,7 @@
2326</tbody> 2326</tbody>
2327</table> 2327</table>
2328<p>&nbsp;</p> 2328<p>&nbsp;</p>
2329<h2><span class="mw-headline"> texture </span></h2> 2329<h2> texture </h2>
2330<table border="1"><caption>&nbsp;</caption> 2330<table border="1"><caption>&nbsp;</caption>
2331<tbody> 2331<tbody>
2332<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 2332<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -2441,7 +2441,7 @@
2441</tbody> 2441</tbody>
2442</table> 2442</table>
2443<p>&nbsp;</p> 2443<p>&nbsp;</p>
2444<h2><span class="mw-headline"> time </span></h2> 2444<h2> time </h2>
2445<table border="1"><caption>&nbsp;</caption> 2445<table border="1"><caption>&nbsp;</caption>
2446<tbody> 2446<tbody>
2447<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 2447<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -2520,7 +2520,7 @@
2520</tbody> 2520</tbody>
2521</table> 2521</table>
2522<p>&nbsp;</p> 2522<p>&nbsp;</p>
2523<h2><span class="mw-headline"> vehicle </span></h2> 2523<h2> vehicle </h2>
2524<table border="1"><caption>&nbsp;</caption> 2524<table border="1"><caption>&nbsp;</caption>
2525<tbody> 2525<tbody>
2526<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 2526<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -2563,7 +2563,7 @@
2563</tbody> 2563</tbody>
2564</table> 2564</table>
2565<p>&nbsp;</p> 2565<p>&nbsp;</p>
2566<h2><span class="mw-headline"> XML-RPC and HTTP </span></h2> 2566<h2> XML-RPC and HTTP </h2>
2567<table border="1"><caption>&nbsp;</caption> 2567<table border="1"><caption>&nbsp;</caption>
2568<tbody> 2568<tbody>
2569<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr> 2569<tr><th>LSL function</th><th>SL notes</th><th>OpenSim notes</th><th>Codes</th></tr>
@@ -2658,12 +2658,13 @@
2658<td>&nbsp;</td> 2658<td>&nbsp;</td>
2659</tr> 2659</tr>
2660<tr> 2660<tr>
2661<td><span style="color: #ff00ff;">llUnescapeURL</span></td> 2661<td><span style="color: #ff00ff;">llUnescapeURLs</span></td>
2662<td>&nbsp;</td> 2662<td>&nbsp;</td>
2663<td>&nbsp;</td> 2663<td>&nbsp;</td>
2664<td>&nbsp;</td> 2664<td>&nbsp;</td>
2665</tr> 2665</tr>
2666</tbody> 2666</tbody>
2667</table> 2667</table>
2668<p><br /> This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p>
2668</body> 2669</body>
2669</html> 2670</html>
diff --git a/docs/LuaSL-New-scripting-engine.html b/docs/LuaSL-New-scripting-engine.html
new file mode 100644
index 0000000..1bbe264
--- /dev/null
+++ b/docs/LuaSL-New-scripting-engine.html
@@ -0,0 +1,796 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<h1> write our own </h1>
6<p>I had considered in the <a href="SledjHamr.html">SledjHamr</a> document writing a new script engine from scratch in Lua. This is what I wrote -</p>
7<p>"I'd love to write a Lua implementation of LSL, I'm sure Alice would want to write a Scheme one."</p>
8<p>"I've been thinking of trying out Lua as a backend for LSL, and trying some micro threading style experiments."</p>
9<p>That's about the sum total of my plans and thoughts though. lol</p>
10<p>Here are some more random thoughts.</p>
11<p>Writing an entire scripting engine in a new language is a big job.</p>
12<p>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.</p>
13<p>My own personal plan was to cut my teeth on Lua by using <a href="http://www.enlightenment.org/">EFL</a> 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 <a href="index.html">OMG</a> 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.</p>
14<p>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.</p>
15<p>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.</p>
16<p>&nbsp;</p>
17<h2> Lua to .NET bindings. </h2>
18<p>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.</p>
19<p><a href="http://www.lua.inf.puc-rio.br/post/9">Some details about Lua.NET, also mentions some others, but with broken links.</a></p>
20<p><a href="http://www.gamedev.net/page/resources/_/technical/game-programming/using-lua-with-c-r2275">LuaInterface</a></p>
21<p><a href="http://ttuxen.wordpress.com/2009/11/03/embedding-lua-in-dotnet/">Details how to integrate the two from Visual Studio, so really only useful for Windows.</a></p>
22<p><a href="http://luaforge.net/projects/luanet/">Lua.NET</a></p>
23<p><a href="http://www.codeproject.com/KB/mcpp/luanetwrapper.aspx">Another roll your own example.</a></p>
24<p>&nbsp;</p>
25<h2> Interfacing to the virtual world </h2>
26<p>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.</p>
27<p>&nbsp;</p>
28<h2> Compiler </h2>
29<p>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.</p>
30<p>&nbsp;</p>
31<h2> Language </h2>
32<p>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.</p>
33<p>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.</p>
34<p>&nbsp;</p>
35<h2> Design </h2>
36<p>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?</p>
37<p>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.</p>
38<p>&nbsp;</p>
39<h1> onefangs implementation ideas </h1>
40<p>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 <a href="https://github.com/onefang/SledjHamr">https://github.com/onefang/SledjHamr</a> on the experimental branch.</p>
41<p>&nbsp;</p>
42<h2> You’re in a maze of twisty little quirks, all different. </h2>
43<p>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.</p>
44<p>&nbsp;</p>
45<h2> Making Lua look like LSL </h2>
46<p>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.</p>
47<p>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.</p>
48<p>A test harness could be constructed using EFL Edje Lua to provide some push buttons that can trigger LSL events, provide dialogs, 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.</p>
49<p>For reference, here is <a href="http://www.lua.org/manual">Lua reference manual</a>, <a href="http://www.lua.org/pil/">Lua PIL (for Lua 5.0)</a>, <a href="http://luajit.org/index.html">LuaJIT</a>, <a href="http://lslwiki.net/lslwiki/wakka.php?wakka=HomePage">LSL Wiki</a>, and <a href="http://wiki.secondlife.com/wiki/LSL_Portal">SL LSL portal</a>.</p>
50<p>&nbsp;</p>
51<h3> comments and line endings </h3>
52<p>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.</p>
53<p>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.</p>
54<p>&nbsp;</p>
55<h3> types </h3>
56<p>LSL has fixed type per variable. Lua is dynamically typed, and variables can have any type at any given time.</p>
57<p>The basic LSL types are -</p>
58<table border="1"><caption>&nbsp;</caption>
59<tbody>
60<tr><th>LSL type</th><th>LSL details</th><th>Lua type</th><th>Notes</th></tr>
61<tr>
62<td>integer</td>
63<td>A signed 32 bit integer, can use hex (integer hex = 0xff;).</td>
64<td>number</td>
65<td>Lua 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.</td>
66</tr>
67<tr>
68<td>float</td>
69<td>An IEEE-754 32-bit floating point value.</td>
70<td>number</td>
71<td>Perfect match, if Lua is compiled as default.</td>
72</tr>
73<tr>
74<td>vector</td>
75<td>Three floats in the form &lt; x , y , z &gt;. Usually a position, color, or Euler rotation.</td>
76<td>&nbsp;</td>
77<td>Use a table and metatable, or a userdata.</td>
78</tr>
79<tr>
80<td>rotation</td>
81<td>A quaternion rotation, made up of 4 floats, &lt; x , y , z , s &gt;.</td>
82<td>&nbsp;</td>
83<td>Use a table and metatable, or a usedata.</td>
84</tr>
85<tr>
86<td>key</td>
87<td>A UUID, specialized string in the same format as UUIDs everywhere.</td>
88<td>&nbsp;</td>
89<td>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.</td>
90</tr>
91<tr>
92<td>string</td>
93<td>A sequence of UTF-8 characters. They support a few backslash escapes at compile time.</td>
94<td>string</td>
95<td>Lua string represents an immutable sequences of bytes. Lua is 8-bit clean: strings can contain any 8-bit value, including embedded zeros ('\0').</td>
96</tr>
97<tr>
98<td>list</td>
99<td>A heterogeneous list of the other data types.</td>
100<td>&nbsp;</td>
101<td>Use a table with number keys.</td>
102</tr>
103</tbody>
104</table>
105<p>&nbsp;</p>
106<h3> bit operations </h3>
107<p>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.</p>
108<p>&nbsp;</p>
109<h3> scope </h3>
110<p>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-)</p>
111<p>&nbsp;</p>
112<h3> Brackets, parenthesis, and braces; oh my. </h3>
113<p>LSL uses -</p>
114<table border="1"><caption>&nbsp;</caption>
115<tbody>
116<tr><th>LSL</th><th>Meaning</th><th>Lua</th><th>Notes</th></tr>
117</tbody>
118<caption>&nbsp;</caption>
119<tbody>
120<tr>
121<td>()</td>
122<td>Expression re-odering.</td>
123<td>()</td>
124<td>Exact match.</td>
125</tr>
126</tbody>
127<caption>&nbsp;</caption>
128<tbody>
129<tr>
130<td>{}</td>
131<td>Code block.</td>
132<td>do statements end</td>
133<td>See the flow control section for other uses.</td>
134</tr>
135</tbody>
136<caption>&nbsp;</caption>
137<tbody>
138<tr>
139<td>[]</td>
140<td>List creation.</td>
141<td>someList = { "a", varB, 3, functionF(foo) }</td>
142<td>&nbsp;</td>
143</tr>
144</tbody>
145<caption>&nbsp;</caption>
146<tbody>
147<tr>
148<td>&lt;&gt;</td>
149<td>Vector and rotation creation.</td>
150<td>&nbsp;</td>
151<td>Well, since we are doing these as a table, we can use table creating functions.</td>
152</tr>
153</tbody>
154</table>
155<p>&nbsp;</p>
156<h3> flow control </h3>
157<p>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.</p>
158<table border="1"><caption>&nbsp;</caption>
159<tbody>
160<tr><th>LSL</th><th>Lua</th><th>Notes</th></tr>
161</tbody>
162<caption>&nbsp;</caption>
163<tbody>
164<tr>
165<td>
166<pre>do
167 {
168 statements;
169 } while (condition);
170</pre>
171</td>
172<td>
173<pre>repeat
174 statements
175until condition
176
177</pre>
178</td>
179<td>&nbsp;</td>
180</tr>
181</tbody>
182<caption>&nbsp;</caption>
183<tbody>
184<tr>
185<td>
186<pre>for (initialization; condition; update)
187{
188 statements;
189}
190</pre>
191</td>
192<td>
193<pre>for variable = e1, e2, e3 do
194 statements
195end
196</pre>
197<pre>for variableList in explist do
198 statements
199end
200
201</pre>
202</td>
203<td>In the first Lua form, variable starts from e1, gets e3 added through each loop, and stops at e2.
204<p>The second form is complicated, see the lua reference manual. It can be rewritten as -</p>
205<pre>do
206 local f, s, var = explist
207 while true do
208 local var_1, ···, var_n = f(s, var)
209 if var_1 == nil then break end
210 var = var_1
211 statements
212 end
213end
214
215</pre>
216<p>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.</p>
217<p>A LSL for loop could be rewritten as -</p>
218<pre>initialization
219while (condition)
220{
221 statements;
222 update;
223}
224</pre>
225<p>Which can be implemented by a Lua while statement.</p>
226</td>
227</tr>
228</tbody>
229<caption>&nbsp;</caption>
230<tbody>
231<tr>
232<td>
233<pre>if (condition)
234{
235 statements;
236}
237else if (condition)
238{
239 statements;
240}
241else
242{
243 statements;
244}
245</pre>
246</td>
247<td>
248<pre>if condition then
249 statements
250elseif condition then
251 statements
252else
253 statements
254end
255
256</pre>
257</td>
258<td>&nbsp;</td>
259</tr>
260</tbody>
261<caption>&nbsp;</caption>
262<tbody>
263<tr>
264<td>
265<pre>jump Label;
266statements;
267@Label;
268</pre>
269</td>
270<td>
271<pre>goto Label
272statements
273::Label::
274
275</pre>
276</td>
277<td>
278<p>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. <a href="http://lua-users.org/lists/lua-l/2009-11/msg00061.html">http://lua-users.org/lists/lua-l/2009-11/msg00061.html</a> might help to explain why.</p>
279</td>
280</tr>
281</tbody>
282<caption>&nbsp;</caption>
283<tbody>
284<tr>
285<td>
286<pre>while (condition)
287{
288 statements;
289}
290</pre>
291</td>
292<td>
293<pre>while condition do
294 statements
295end
296
297</pre>
298</td>
299<td>&nbsp;</td>
300</tr>
301</tbody>
302</table>
303<p>&nbsp;</p>
304<h3> count from 0 / 1 </h3>
305<p>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))</p>
306<p>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().</p>
307<p>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.</p>
308<p>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.</p>
309<p>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"].</p>
310<p>&nbsp;</p>
311<h3> functions </h3>
312<p>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.</p>
313<p>LSL passes function parameters by value. Lua passes by value as well, I think. Tables may be passed by reference.</p>
314<p>&nbsp;</p>
315<h3> states </h3>
316<p>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.</p>
317<p>&nbsp;</p>
318<h2> Efficiently running thousands of scripts </h2>
319<p>(As a data point, Anarchadia has 3315 scripts running.)</p>
320<p>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 serialize Lua, so running Lua states can be stopped, sent to some other computer, then restarted (good for attachment scripts when TPing).</p>
321<p>"luaproc is a concurrent programming library for Lua. It implements an approach, geared torwards massive concurrency support, which uses multiple indepedent 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. <a href="https://github.com/askyrme/luaproc">https://github.com/askyrme/luaproc</a></p>
322<p>Lua has cooperative multitasking, but not preemptive. 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.</p>
323<ul>
324<li>Just let them run, continuing to keep that thread busy.</li>
325<li>Use a watchdog thread.
326<ul>
327<li>Reduce that threads priority.</li>
328<li>Kill the run away thread with fire.</li>
329<li>Force it to yield.
330<ul>
331<li>Requires a change to the Lua source code.</li>
332</ul>
333</li>
334<li>Force it to yield, then recompile that bad boy with a yield() call at the end of every loop.</li>
335<li>All of the above. Make them pay for their bad coding, not every one else.</li>
336</ul>
337</li>
338</ul>
339<p>I just had a thought. It might be worthwhile doing some typical compiler optimizations. 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.</p>
340<p>&nbsp;</p>
341<h2> hacking up Lua source </h2>
342<p>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.</p>
343<p>Things we should hack up Lua source for -</p>
344<ul>
345<li>32 bit signed integers AND 32 bit floats.
346<ul>
347<li>The <a href="http://lua-users.org/wiki/LuaPowerPatches">power patch</a> "LNUM - number mode patch ("integer patch"), revised to Lua 5.1.3" may help</li>
348<li><a href="http://lua-users.org/wiki/FloatingPoint">http://lua-users.org/wiki/FloatingPoint</a>says that the solution to the problem is to use 64 bit floats, since they can safely be used to represent 32 bit integers. I still think that would use up too much space, but buy the rest of the arguments ONLY if we are considering 64 bit servers.
349<ul>
350<li>Either way STILL means compiling our own lua, so still should hack it up while we are at it.</li>
351</ul>
352</li>
353<li><a href="http://stackoverflow.com/questions/4484437/lua-integer-type">http://stackoverflow.com/questions/4484437/lua-integer-type</a> is pointing in the right direction.</li>
354</ul>
355</li>
356<li>Forcing a yield in run away event processing.
357<ul>
358<li>The <a href="http://lua-users.org/wiki/LuaPowerPatches">power patch</a> "Interpreter Bailout Flag for Lua 5.1.3" might do the trick.</li>
359</ul>
360</li>
361<li>Start counting at 0 dammit!
362<ul>
363<li><a href="http://lua-users.org/wiki/GeneralizedPairsAndIpairs">http://lua-users.org/wiki/GeneralizedPairsAndIpairs</a> may be useful. Parts of this made it into Lua 5.2.</li>
364</ul>
365</li>
366<li>UTF-8 strings.
367<ul>
368<li><a href="http://lua-users.org/wiki/LuaUnicode">http://lua-users.org/wiki/LuaUnicode</a> and <a href="http://lua-users.org/lists/lua-l/2005-05/msg00317.html">http://lua-users.org/lists/lua-l/2005-05/msg00317.html</a> look like good starting points for research</li>
369<li>The <a href="http://lua-users.org/wiki/LuaPowerPatches">power patch</a> "Literals (hex, UTF-8) patch, revised to Lua 5.1 (beta)" may help.</li>
370</ul>
371</li>
372</ul>
373<p><br /> Things we could hack up the Lua source for if we are gonna do it anyway -</p>
374<ul>
375<li>Script state persistence might be more efficient if we add stuff to support that to Lua.</li>
376</ul>
377<p>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 - <a href="http://osdir.com/ml/general/2011-02/msg23395.html">http://osdir.com/ml/general/2011-02/msg23395.html</a></p>
378<p>&nbsp;</p>
379<h2> Hooking it up to OpenSim </h2>
380<p>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 existant script engine. Some examples of existing supported first lines -</p>
381<ul>
382<li>//XEngine:</li>
383<li>//XEngine:lsl</li>
384<li>//XEngine:c#</li>
385<li>//XEngine:vb</li>
386<li>//DotNetEngine:</li>
387</ul>
388<p>If no language is added after the colon, LSL is assumed. We will use that, and add -</p>
389<ul>
390<li>//LuaSL:</li>
391<li>//LuaSL:LSL</li>
392<li>//LuaSL:Lua</li>
393<li>//LuaSL:LuaSL</li>
394</ul>
395<p>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.</p>
396<p>//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.</p>
397<p>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.</p>
398<p>&nbsp;</p>
399<h3> non world interfacing functions </h3>
400<p>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.</p>
401<p>&nbsp;</p>
402<h3> stepping outside the world </h3>
403<p>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.</p>
404<p>&nbsp;</p>
405<h3> getting world events </h3>
406<p>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.</p>
407<p>&nbsp;</p>
408<h3> changing the world </h3>
409<p>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.</p>
410<p>For the functions that get and set prim properties, we should use wrappers around llSetPrimitiveParams() and friends. The <a href="Nails.html">Nails</a> protocol is partly based on those functions, so this will work out well for the future, when we move to a Nails command pump.</p>
411<p>&nbsp;</p>
412<h3> Lifestyles of the rich and infamous... er I mean life cycle of a script, and communications with the engine. </h3>
413<p>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.</p>
414<p>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.</p>
415<p>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.</p>
416<table border="1"><caption>&nbsp;</caption>
417<tbody>
418<tr><th>Life stage</th><th>OpenSim</th><th>LuaSL script engine</th></tr>
419</tbody>
420<caption>&nbsp;</caption>
421<tbody>
422<tr>
423<td>save script</td>
424<td>
425<pre>SID.save([=[
426default
427{
428 state_entry()
429 {
430 llSay(0, "Saluton Mondon.");
431 }
432}
433]=])
434</pre>
435<p>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.</p>
436</td>
437<td>&nbsp;</td>
438</tr>
439</tbody>
440<caption>&nbsp;</caption>
441<tbody>
442<tr>
443<td>compile script</td>
444<td>
445<pre>SID.compile(/path/to/script/source)
446</pre>
447<p>The filename can be a URL, or a FILE:// URL, or just a file name.</p>
448</td>
449<td>&nbsp;</td>
450</tr>
451</tbody>
452<caption>&nbsp;</caption>
453<tbody>
454<tr>
455<td>&nbsp;</td>
456<td>&nbsp;</td>
457<td>Compiles the script.
458<pre>SID.compilerError(42,10,"Something icky here!")
459SID.compilerWarning(123,38,"Eww, you did not mean that, surely?")
460SID.compiled(false)
461
462</pre>
463<p>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.</p>
464</td>
465</tr>
466</tbody>
467<caption>&nbsp;</caption>
468<tbody>
469<tr>
470<td>start script</td>
471<td>
472<pre>SID.start()
473</pre>
474</td>
475<td>&nbsp;</td>
476</tr>
477</tbody>
478<caption>&nbsp;</caption>
479<tbody>
480<tr>
481<td>&nbsp;</td>
482<td>&nbsp;</td>
483<td>Starts / resumes the script.</td>
484</tr>
485</tbody>
486<caption>&nbsp;</caption>
487<tbody>
488<tr>
489<td>script calls in world ll*() function</td>
490<td>&nbsp;</td>
491<td>
492<pre>SID.llSay(0,"Hello World")
493</pre>
494</td>
495</tr>
496</tbody>
497<caption>&nbsp;</caption>
498<tbody>
499<tr>
500<td>&nbsp;</td>
501<td>Sends the text to channel 0.</td>
502<td>&nbsp;</td>
503</tr>
504</tbody>
505<caption>&nbsp;</caption>
506<tbody>
507<tr>
508<td>&nbsp;</td>
509<td>&nbsp;</td>
510<td>
511<pre>SID.llUnsit("66864f3c-e095-d9c8-058d-d6575e6ed1b8")
512</pre>
513</td>
514</tr>
515</tbody>
516<caption>&nbsp;</caption>
517<tbody>
518<tr>
519<td>&nbsp;</td>
520<td>Avatar stands up.</td>
521<td>&nbsp;</td>
522</tr>
523</tbody>
524<caption>&nbsp;</caption>
525<tbody>
526<tr>
527<td>&nbsp;</td>
528<td>&nbsp;</td>
529<td>
530<pre>SID.llGetAgentSize("66864f3c-e095-d9c8-058d-d6575e6ed1b8")
531</pre>
532</td>
533</tr>
534</tbody>
535<caption>&nbsp;</caption>
536<tbody>
537<tr>
538<td>&nbsp;</td>
539<td>
540<pre>SID.return {x=0.45, y=0.6, z=1.8}
541</pre>
542<p>OpenSim sends back a vector.</p>
543</td>
544<td>&nbsp;</td>
545</tr>
546</tbody>
547<caption>&nbsp;</caption>
548<tbody>
549<tr>
550<td>in world event</td>
551<td>
552<pre>SID.events.detectedNames(
553{
554 "kelly rocket",
555 "onefang rejected",
556})
557SID.events.detectedKeys(
558{
559 "01234567-89ab-cdef-0123-456789abcdef",
560 "66864f3c-e095-d9c8-058d-d6575e6ed1b8",
561})
562SID.events.touch_start(2)
563
564</pre>
565<p>Sent as three separate lines, one per function call.</p>
566</td>
567<td>&nbsp;</td>
568</tr>
569</tbody>
570<caption>&nbsp;</caption>
571<tbody>
572<tr>
573<td>&nbsp;</td>
574<td>&nbsp;</td>
575<td>Calls that event handler in the current state, making sure that calls to llDetected*() return the proper results.</td>
576</tr>
577</tbody>
578<caption>&nbsp;</caption>
579<tbody>
580<tr>
581<td>stop script</td>
582<td>
583<pre>SID.stop()
584</pre>
585</td>
586<td>&nbsp;</td>
587</tr>
588</tbody>
589<caption>&nbsp;</caption>
590<tbody>
591<tr>
592<td>&nbsp;</td>
593<td>&nbsp;</td>
594<td>Pauses (yeilds) the script</td>
595</tr>
596</tbody>
597<caption>&nbsp;</caption>
598<tbody>
599<tr>
600<td>delete script</td>
601<td>
602<pre>SID.delete()
603</pre>
604</td>
605<td>&nbsp;</td>
606</tr>
607</tbody>
608<caption>&nbsp;</caption>
609<tbody>
610<tr>
611<td>&nbsp;</td>
612<td>&nbsp;</td>
613<td>Deletes it's local copy of the script, and it's compiled version.</td>
614</tr>
615</tbody>
616</table>
617<p>&nbsp;</p>
618<h2> XMRE? </h2>
619<p>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.</p>
620<p>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.</p>
621<p>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.</p>
622<p>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.</p>
623<p>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 miniscule. 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.</p>
624<p>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.</p>
625<p>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.</p>
626<p>&nbsp;</p>
627<h3> flow control - break, case, constant, continue, default, switch </h3>
628<p>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 - <a href="http://lua-users.org/wiki/SwitchStatement">http://lua-users.org/wiki/SwitchStatement</a></p>
629<p>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.</p>
630<p>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. <a href="http://lua-users.org/lists/lua-l/2009-11/msg00061.html">http://lua-users.org/lists/lua-l/2009-11/msg00061.html</a> might help to explain why.</p>
631<p><a href="http://lua-users.org/wiki/ContinueProposa">http://lua-users.org/wiki/ContinueProposa</a> would be of interest.</p>
632<p>&nbsp;</p>
633<h3> arrays </h3>
634<p>Lua tables have similar functionality to XMRE arrays, but I think are more powerful. So might as well just use them.</p>
635<p>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 -</p>
636<pre>myList[42] = "Life, the universe, and everything";
637llOwnerSay(myList[42]);
638myList[foo + bar] = 42;
639myOtherList["foo"] = myList;
640myOtherList[myList] = 42.0; // Using a Lua table as an index.
641
642</pre>
643<p>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.</p>
644<p>Since they are Lua tables, we can do this sort of thing to -</p>
645<pre>myOtherList["myFunc"] = someFunction; // Yes, this is storing the function, not the return value of the function.
646myOtherList["myFunc"](x, y); // Calling the function we just stored.
647myOtherList.myFunc(x, y); // Same as the last one.
648
649</pre>
650<p>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.</p>
651<p>Lua table initialization is a little different, but the LSL parser can handle that -</p>
652<pre>a = {[f(1)] = g; "x", "y"; x = 1, f(x), [30] = 23; 45}
653
654</pre>
655<p>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</p>
656<p>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 initializers.</p>
657<p>&nbsp;</p>
658<h3> exception handling </h3>
659<p>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.</p>
660<p>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. <a href="http://lua-users.org/wiki/ErrorHandling">http://lua-users.org/wiki/ErrorHandling</a> might be of some interest.</p>
661<p>&nbsp;</p>
662<h3> event handling </h3>
663<p>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.</p>
664<p>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.</p>
665<pre>float timeout = 4.2;
666myEvents = 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.
667myDetects = events.copyDetects();
668default.link_message(LINK_ROOT, 42, "So long, and thanks for all the fish.", llGetOwner());
669events.detects(myDetects);
670events.queue(myEvents);
671
672</pre>
673<p>Or something like that might be feasible.</p>
674<p>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 -</p>
675<pre>list waitEvents = [link_message, listen];
676list backgroundEvents = [touch_start, touch_end];
677myEvents = events.wait(timeout, waitEvents, backgroundEvents);
678
679</pre>
680<p>&nbsp;</p>
681<h2> an example </h2>
682<p>This is the current result of compiling the MLP ~pos script (white space adjusted for better readability) -</p>
683<pre>--// Generated code goes here.
684
685local _bit = require("bit")
686local _LSL = require("LSL")
687
688--[[integer]] MAX_BALLS = 6;
689--[[integer]] ch = 0;
690--[[integer]] swap = 0;
691--[[integer]] BallCount = 0;
692--[[string]] pr1 = "";
693--[[string]] pr2 = "";
694--[[integer]] Zoffset = 0;
695--[[vector]] RefPos = _LSL.ZERO_VECTOR;
696--[[rotation]] RefRot = _LSL.ZERO_ROTATION;
697.
698
699function getRefPos()
700 RefPos=_LSL.llGetPos();
701 RefRot=_LSL.llGetRot();
702 Zoffset= _LSL.integerTypecast(_LSL.llGetObjectDesc());
703 RefPos.z --[[+=]] = RefPos.z + --[[float]] Zoffset / 100.;
704end
705
706--[[list]] Pdata = {};
707
708function getPosNew( --[[string]] pdata)
709 Pdata = _LSL.llParseString2List(pdata, {" ", }, {});
710end
711
712function setPos()
713 pr1 = --[[string]] ( --[[vector]] _LSL.llList2String(Pdata, 0) * RefRot + RefPos);
714 pr2 = --[[string]] ( --[[vector]] _LSL.llList2String(Pdata, 2) * RefRot + RefPos);
715 pr1 --[[+=]] = pr1 + --[[string]] (_LSL.llEuler2Rot( --[[vector]] _LSL.llList2String(Pdata, 1) * _LSL.DEG_TO_RAD) * RefRot);
716 pr2 --[[+=]] = pr2 + --[[string]] (_LSL.llEuler2Rot( --[[vector]] _LSL.llList2String(Pdata, 3) * _LSL.DEG_TO_RAD) * RefRot);
717 if (BallCount&gt;1) then
718 _LSL.llSay(ch + swap, pr1);
719 _LSL.llSay(ch + not swap, pr2);
720 else
721 _LSL.llSay(ch, pr1);
722 end
723 local --[[integer]] ix = 0;
724 local function _preIncrement_ix() ix = ix + 1; return ix; end
725 ix = 2;
726 while (ix&lt;BallCount) do
727 _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));
728 _preIncrement_ix();
729 end
730end
731
732function getChan()
733 ch= _LSL.integerTypecast(("0x" .. _LSL.llGetSubString( --[[string]] _LSL.llGetKey(), -4, -1)));
734end.
735
736--[[state]] _defaultState = {};.
737
738_defaultState.state_entry = function()
739 getRefPos();
740 getChan();
741end
742
743_defaultState.on_rez = function( --[[integer]] arg)
744 getRefPos();
745 getChan();
746end
747
748_defaultState.link_message = function( --[[integer]] from, --[[integer]] num, --[[string]] cmd, --[[key]] pkey)
749 if (cmd == "PRIMTOUCH") then
750 return;
751 end
752 if (num == 1 and cmd == "STOP") then
753 swap = 0;
754 return;
755 end
756 if (num) then
757 return;
758 end
759 if (cmd == "POSE") then
760 local --[[list]] parms=_LSL.llCSV2List( --[[string]] pkey);
761 BallCount=_LSL.llList2Integer(parms, 1);
762 return;
763 elseif (cmd == "POSEPOS") then
764 getPosNew( --[[string]] pkey);
765 setPos();
766 elseif (cmd == "SWAP") then
767 swap= _bit.band( _LSL.integerTypecast(( --[[string]] pkey)) , 1) ;
768 _LSL.llSay(ch + swap, pr1);
769 _LSL.llSay(ch + not swap, pr2);
770 elseif (cmd == "REPOS") then
771 getRefPos();
772 elseif (_LSL.llGetSubString(cmd, 0, 0) == "Z") then
773 local --[[integer]] change = 0;
774 if (_LSL.llGetSubString(cmd, 1, 1) == "+") then
775 change = _LSL.integerTypecast(_LSL.llGetSubString(cmd, 2, 10)) ;
776 else
777 change = _LSL.integerTypecast(_LSL.llGetSubString(cmd, 1, 10)) ;
778 end
779 Zoffset --[[+=]] = Zoffset + change;
780 RefPos.z --[[+=]] = RefPos.z + --[[float]] change / 100.;
781 setPos();
782 _LSL.llOwnerSay("Height Adjustment: change by " .. --[[string]] change .. "cm, new offset: " .. --[[string]] Zoffset .. "cm");
783 _LSL.llSetObjectDesc( --[[string]] Zoffset);
784 elseif (cmd == "GETREFPOS") then
785 _LSL.llMessageLinked(_LSL.LINK_THIS, 8, --[[string]] RefPos, --[[string]] RefRot);
786 end
787end.
788
789_LSL.stateChange(_defaultState)
790
791--// End of generated code.
792
793</pre>
794<p><br /> This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p>
795</body>
796</html>
diff --git a/docs/NGIW.Commands.html b/docs/NGIW.Commands.html
new file mode 100644
index 0000000..310c176
--- /dev/null
+++ b/docs/NGIW.Commands.html
@@ -0,0 +1,45 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<p>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.</p>
6<p>&nbsp;</p>
7<h2> Proposal </h2>
8<p>If <a href="http://sim.ulat.or/obj/">http://sim.ulat.or/obj/</a><strong>oid</strong> is the url to some object with id <strong>oid</strong>, and we have a http connection to <a href="http://sim.ulat.or">http://sim.ulat.or</a> then</p>
9<ul>
10<li>PUT /obj/<strong>oid</strong>/eq -- adds a new event to the queue (at the end)</li>
11<li>PUT /obj/<strong>oid</strong>/eq/0 -- adds a new event to the queue at the <strong>beginning</strong></li>
12<li>PUT /obj/<strong>oid</strong>/eq/9 -- same behavior as PUT /obj/<strong>oid</strong>/eq</li>
13<li>GET /obj/<strong>oid</strong>/eq -- returns the full event queue</li>
14<li>PUT /obj/<strong>oid</strong>/eq/<strong>eventid</strong> -- changes the event (or adds one) with id <strong>eventid</strong></li>
15<li>GET /obj/<strong>oid</strong>/eq/<strong>eventid</strong> -- returns the event with id <strong>eventid</strong> or an error</li>
16<li>GET /obj/<strong>oid</strong>/eq/0 -- returns the first event from the queue or an error</li>
17<li>GET /obj/<strong>oid</strong>/eq/9 -- returns the <strong>last</strong> event in the queue</li>
18<li>DELETE /obj/<strong>oid</strong>/eq/<strong>eventid</strong> -- removes an event from the queue and returns it</li>
19<li>DELETE /obj/<strong>oid</strong>/eq/0 -- removes the first event from the queue and returns it, or returns an error</li>
20</ul>
21<p>And maybe</p>
22<ul>
23<li>PUT /obj/<strong>oid</strong>/eq -- add a bunch of events to a queue</li>
24<li>PUT /eq -- add a bunch of events to a bunch of objects?</li>
25</ul>
26<p>&nbsp;</p>
27<h2> What a PUT really sends to the server </h2>
28<p>Supose we are telling the server about the avy touching an object. The actual text that gets sent might look like:</p>
29<pre> PUT /obj/<strong>oid</strong>/eq HTTP/1.1
30 Host: sim.ulat.or
31 Content-Type: application/json
32 Content-Length: xxxx
33
34 {"touch_start":{"force":13,"avy":"uuid","time":1311663233}}
35</pre>
36<p>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 amortized across many commands by using the last two forms of request. The last would look like:</p>
37<pre> PUT /eq HTTP/1.1
38 Host: sim.ulat.or
39 Content-Type: application/json
40 Content-Length: xxxx
41
42 [{command1...},{command2...},...]
43</pre>
44</body>
45</html>
diff --git a/docs/NGIW.html b/docs/NGIW.html
new file mode 100644
index 0000000..07ccc63
--- /dev/null
+++ b/docs/NGIW.html
@@ -0,0 +1,49 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<p>See also <a href="SledjHamr.html">SledjHamr</a></p>
6<p>Random thoughts about Next Generation Immersive Web, or whatever we call it.</p>
7<p>Here I want to indicate a possible design direction. The buzzword compliant summary is HTTP 1.1, REST and JSON.</p>
8<p>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.</p>
9<p>Suppose the simulator is at <a href="http://simulat.or/sim01">http://simulat.or/sim01</a> .</p>
10<p>Then, per usual REST design, to ask about box 104, the client would "GET /sim01/object/b104". Similar to opening <a href="http://simulat.or/sim01/object/b104">http://simulat.or/sim01/object/b104</a> in a web browser.</p>
11<p>The sample response might be</p>
12<pre> { "at":1000,
13 "id":"b104",
14 "p":[1,1,1],
15 "r":[0,0,0,0],
16 "s":[0.5,0.5,0.5],
17 "t":"/sim01/texture/t104" }
18</pre>
19<p>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 miliseconds 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.</p>
20<p>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 "<a href="http://simulat.or/sim01/texture/t104">http://simulat.or/sim01/texture/t104</a>". If the client needs the texture it can do a GET of "<a href="http://simulat.or/sim01/texture/t104">http://simulat.or/sim01/texture/t104</a>". There are ways to further compress this information, but let's not fix what isn't broken.</p>
21<p>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</p>
22<pre> { "at":1001,
23 "id":"b104",
24 "p":[1,1,2],
25 "r":[0,0,0,0],
26 "s":[0.5,0.5,0.5],
27 "t":"/sim01/texture/t104" }
28</pre>
29<p>Always transfering the full representation of an object could be wastefull 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</p>
30<pre> { "at":1001,
31 "id":"b104",
32 "p":[1,1,2] }
33</pre>
34<p>would cause the same change in the simulator state.</p>
35<p>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:</p>
36<pre> [ {"at":999,"id":...}, {"at":999,...} ... ]
37</pre>
38<p>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</p>
39<pre> [ {"at":999,"id":...}, {"at":999,...},
40</pre>
41<p>in the first chunk, and more</p>
42<pre> {"at":1000,...}, {"at":1001,...}, ...
43</pre>
44<p>in the second chunk. And so forth. Again, sending all the fields of all the objects, even for just the changed objects is wastefull. I see a few ways to go.</p>
45<p>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.</p>
46<p>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 recognize, is opens a second connection and requests "GET /sim01/object/b999" for example to get the full description.</p>
47<p>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.</p>
48</body>
49</html>
diff --git a/docs/Nails.html b/docs/Nails.html
new file mode 100644
index 0000000..9795ab8
--- /dev/null
+++ b/docs/Nails.html
@@ -0,0 +1,2514 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<h1> Putting it all together </h1>
6<p>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.</p>
7<p>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,&lt;1.2.3&gt;,"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".</p>
8<p>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.</p>
9<p>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.</p>
10<p>&nbsp;</p>
11<h2> command pump </h2>
12<p>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.</p>
13<p>&nbsp;</p>
14<h2> inventory data store (we should call this "hammerspace") </h2>
15<p>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.</p>
16<p>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.</p>
17<p>&nbsp;</p>
18<h2> sim data store </h2>
19<p>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 authorization, 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.</p>
20<p>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.</p>
21<p>&nbsp;</p>
22<h2> physics engine </h2>
23<p>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.</p>
24<p>&nbsp;</p>
25<h2> script engine </h2>
26<p>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.</p>
27<p>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.</p>
28<p>&nbsp;</p>
29<h2> viewer </h2>
30<p>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.</p>
31<p>&nbsp;</p>
32<h1> <a name="command_pump">command pump</a> </h1>
33<p>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.</p>
34<p>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.</p>
35<p>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.</p>
36<p>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.</p>
37<p>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.</p>
38<p>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.</p>
39<p>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.</p>
40<p>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.</p>
41<p>&nbsp;</p>
42<h2> command channels and language </h2>
43<p>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() <a href="http://lslwiki.net/lslwiki/wakka.php?wakka=llSetLinkPrimitiveParams&amp;show_comments=1#comments">http://lslwiki.net/lslwiki/wakka.php?wakka=llSetLinkPrimitiveParams&amp;show_comments=1#comments</a></p>
44<p>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.</p>
45<p>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.</p>
46<p>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.</p>
47<p>&nbsp;</p>
48<h3> propagating language changes </h3>
49<p>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.</p>
50<ol>
51<li><dl><dd>client -&gt; I speak Version 1 checksum</dd><dd>server -&gt; I speak Version 1 checksum</dd><dd></dd></dl></li>
52<li><dl><dd>client -&gt; I speak Version 1 checksum</dd><dd>server -&gt; I speak Version 2 checksum signed<dl><dd>Version 2 is -<dl><dd>A=int,int,float</dd><dd>B=vector,string</dd></dl></dd></dl></dd><dd>client -&gt; I speak Version 2 checksum</dd><dd>server -&gt; I speak Version 2 checksum</dd><dd></dd></dl></li>
53<li><dl><dd>client I speak Version 1 checksum +<dl><dd>which adds -<dl><dd>C=rotation,int</dd><dd>D=string,float,vector</dd></dl></dd></dl></dd><dd>server I speak Version 1 checksum + (only to this client)</dd><dd></dd></dl></li>
54<li><dl><dd>client I speak Version 2 checksum</dd><dd>server I speak Version 2 checksum (which is different) signed<dl><dd>Version 2 really is -<dl><dd>A=int,int,float</dd><dd>B=vector,string</dd></dl></dd></dl></dd><dd>client I speak Version 2 checksum</dd><dd>server I speak Version 2 checksum</dd><dd></dd></dl></li>
55<li><dl><dd>client I speak Version 2 checksum</dd><dd>server I speak Version 1 checksum</dd><dd>client I speak Version 2 checksum signed<dl><dd>Version 2 is -<dl><dd>A=int,int,float</dd><dd>B=vector,string</dd></dl></dd></dl></dd><dd>server I speak Version 2 checksum</dd><dd></dd></dl></li>
56<li><dl><dd>client I speak Version 1 checksum</dd><dd>server I speak Version 1 checksum +<dl><dd>which adds -<dl><dd>C=rotation,int</dd><dd>D=string,float,vector</dd></dl></dd></dl></dd><dd>client I speak Version 1 checksum + (only to this server)</dd></dl></li>
57</ol>
58<p>1) all is good, hopefully the usual thing.</p>
59<p>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.</p>
60<p>3) server only uses that version of the language for talking to that client.</p>
61<p>5) a way to push up an official new protocol version.</p>
62<p>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.</p>
63<p>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.</p>
64<p>1) 2) 4) 5) both ends just use the same language.</p>
65<p>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.</p>
66<p>&nbsp;</p>
67<h1> Command language </h1>
68<p><a href="http://lslwiki.net/lslwiki/wakka.php?wakka=llSetPrimitiveParams">llSetPrimitiveParams()</a> is the model I want to follow.</p>
69<p>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.</p>
70<p>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.</p>
71<p>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.</p>
72<p>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.</p>
73<p>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).</p>
74<p>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.</p>
75<p>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.</p>
76<p>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.</p>
77<p>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.</p>
78<p>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.</p>
79<p>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-)</p>
80<p>Prim properties can change quickly, by the physics engine, scripts, or users editing them in world in real time.</p>
81<p>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.</p>
82<p>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.</p>
83<p>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.</p>
84<p>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.</p>
85<p>The environment is not changed quickly.</p>
86<p>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?</p>
87<p>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).</p>
88<p>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.</p>
89<p>The other issues to deal with are when and how to do the filtering; and how to handle "old" data.</p>
90<p>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.</p>
91<p>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.</p>
92<p>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.</p>
93<p>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.</p>
94<p>&nbsp;</p>
95<h2> Prim commands. </h2>
96<p>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 -</p>
97<p>llSetPrimMediaParams(face, list)</p>
98<p>Can probably combine most of these. Width and height SHOULD be combined per the LL specs.</p>
99<ul>
100<li>PRIM_MEDIA_ALT_IMAGE_ENABLE boolean</li>
101<li>PRIM_MEDIA_CONTROLS integer:1</li>
102<li>PRIM_MEDIA_CURRENT_URL string</li>
103<li>PRIM_MEDIA_HOME_URL string</li>
104<li>PRIM_MEDIA_AUTO_LOOP boolean</li>
105<li>PRIM_MEDIA_AUTO_PLAY boolean</li>
106<li>PRIM_MEDIA_AUTO_SCALE boolean</li>
107<li>PRIM_MEDIA_AUTO_ZOOM boolean</li>
108<li>PRIM_MEDIA_FIRST_CLICK_INTERACT boolean</li>
109<li>PRIM_MEDIA_WIDTH_PIXELS integer</li>
110<li>PRIM_MEDIA_HEIGHT_PIXELS integer</li>
111<li>PRIM_MEDIA_WHITELIST_ENABLE boolean</li>
112<li>PRIM_MEDIA_WHITELIST string/CSV</li>
113<li>PRIM_MEDIA_PERMS_INTERACT integer:2</li>
114<li>PRIM_MEDIA_PERMS_CONTROL integer:2</li>
115</ul>
116<p>llParticleSystem(list)</p>
117<p>These could be combined a bit, some of them should be.</p>
118<ul>
119<li>PSYS_PART_FLAGS integer (seems to use all 32 bits, but really only 9 bits, plus 6 legacy bits, only 3 of the later defined)</li>
120<li>PSYS_SRC_PATTERN integer:5 (specified as a bit mask, but it's really just one of 5 values)</li>
121<li>PSYS_SRC_BURST_RADIUS float</li>
122<li>PSYS_SRC_ANGLE_BEGIN float</li>
123<li>PSYS_SRC_ANGLE_END float</li>
124<li>PSYS_SRC_INNERANGLE float (deprecated)</li>
125<li>PSYS_SRC_OUTERANGLE float (deprecated)</li>
126<li>PSYS_SRC_TARGET_KEY key</li>
127<li>PSYS_PART_START_COLOR (vector)=colour</li>
128<li>PSYS_PART_END_COLOR (vector)=colour</li>
129<li>PSYS_PART_START_ALPHA float</li>
130<li>PSYS_PART_END_ALPHA float</li>
131<li>PSYS_PART_START_SCALE vector</li>
132<li>PSYS_PART_END_SCALE vector</li>
133<li>PSYS_SRC_TEXTURE string/key</li>
134<li>PSYS_SRC_MAX_AGE float</li>
135<li>PSYS_PART_MAX_AGE float</li>
136<li>PSYS_SRC_BURST_RATE float</li>
137<li>PSYS_SRC_BURST_PART_COUNT integer</li>
138<li>PSYS_SRC_ACCEL vector</li>
139<li>PSYS_SRC_OMEGA vector</li>
140<li>PSYS_SRC_BURST_SPEED_MIN float</li>
141<li>PSYS_SRC_BURST_SPEED_MAX float</li>
142</ul>
143<p><br /> llCreateLink(key boolean)</p>
144<p>llSetTextureAnim(integer:7 face integer integer float float float)</p>
145<p>Stuff to do with the playing of sound clips.</p>
146<p>&nbsp;</p>
147<h2> Parcel commands. </h2>
148<p>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.</p>
149<p>&nbsp;</p>
150<h2> Sim commands. </h2>
151<p>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.</p>
152<p>A sim has the following properties, which will need commands to change them -</p>
153<p>Name, description, owner, group.</p>
154<p>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.</p>
155<p>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.</p>
156<p>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-)</p>
157<p>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.</p>
158<p>No damage is irrelevant really, if they want combat on their sims, they can provide a proper combat system. No pushing is likely similar.</p>
159<p>Showing places in search is really now up to the search engines to cope with this new form of data.</p>
160<p>A snapshot is good. Teleport landing spot and routing should have more options, but we can start with just supporting the usual LL stuff.</p>
161<p>Audio and media are now handled differently anyway.</p>
162<p>Access is now controlled by the usual web methods.</p>
163<p>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.</p>
164<p>Will still need to send broadcast messages to people in sims.</p>
165<p>Restarting sims, disabling scripts, collisions, and physics.</p>
166<p>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.</p>
167<p>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.</p>
168<p>Sim sun stuff should be handled by the windlight commands.</p>
169<p>Allowing voice chat becomes a matter of whether the sim owner bothered to set that up.</p>
170<p>Allow direct teleport is now part of access controls.</p>
171<p>Covenant is just the sites ToS.</p>
172<p>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.</p>
173<p>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.</p>
174<p>&nbsp;</p>
175<h2> Windlight commands. </h2>
176<p>&nbsp;</p>
177<h2> Avatar commands. </h2>
178<p>Some of this could be dealt with by treating the avatar as a prim. In fact, Alices proposed animation system deals with animating avatars and prims the same way.</p>
179<p>&nbsp;</p>
180<h2> Animation commands. </h2>
181<p>Alice is working on that over at the <a href="BVJ.html">BVJ</a> page.</p>
182<p>&nbsp;</p>
183<h2> Meta commands. </h2>
184<p>0 SELECT_OBJECT key</p>
185<p>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-)</p>
186<p>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.</p>
187<ul>
188<li>BSON - switch to BSON mode.</li>
189<li>EWWW - switch to XML mode (as used in IAR and OAR files from OpenSim).</li>
190<li>FUCK - for future proofing, in case I got my estimates all wrong and the protocol evolves beyond the built in limits. This command means switch up to a two byte command structure, and four byte object IDs. This two byte command structure should include a similar command to change up again, etc. all the way to four byte commands.</li>
191<li>JSON - switch to JSON mode.</li>
192<li>LUA - switch to Lua mode, sending valid Lua statements back and forth.&nbsp; This has been useful during very early development.</li>
193<li>MTRX - switch to matrix-RAD mode</li>
194<li>TITE - switch back to the tight binary, one byte command mode.</li>
195</ul>
196<p>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.</p>
197<p>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.</p>
198<p>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...</p>
199<p>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.</p>
200<p>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.</p>
201<p>&nbsp;</p>
202<h2> The big arsed command table </h2>
203<table style="border-width: 1px; border-color: #ffffff; border-style: solid;" border="1">
204<tbody>
205<tr><th>decimal</th><th>hex</th><th>binary</th><th>ASCII</th><th>command</th><th>arguments</th><th>comments</th></tr>
206<tr>
207<td>0</td>
208<td>00</td>
209<td>0000 0000</td>
210<td>NULL</td>
211<td>SELECT</td>
212<td>key</td>
213<td>Next commands refer to this object.</td>
214</tr>
215<tr>
216<td>1</td>
217<td>01</td>
218<td>0000 0001</td>
219<td>SOH</td>
220<td>PRIM_TYPE_LEGACY BOX</td>
221<td>vector float float vector vector</td>
222<td>&nbsp;</td>
223</tr>
224<tr>
225<td>2</td>
226<td>02</td>
227<td>0000 0010</td>
228<td>STX</td>
229<td>PRIM_MATERIAL (STONE)</td>
230<td>integer:3</td>
231<td>OK, the cleanest way to deal with this conflicting with the BSON commands is to have it as just one command. sigh</td>
232</tr>
233<tr>
234<td>3</td>
235<td>03</td>
236<td>0000 0011</td>
237<td>ETX</td>
238<td>PRIM_PHYSICS off</td>
239<td>&nbsp;</td>
240<td>&nbsp;</td>
241</tr>
242<tr>
243<td>4</td>
244<td>04</td>
245<td>0000 0100</td>
246<td>EOT</td>
247<td>PRIM_TEMP_ON_REZ off</td>
248<td>&nbsp;</td>
249<td>&nbsp;</td>
250</tr>
251<tr>
252<td>5</td>
253<td>05</td>
254<td>0000 0101</td>
255<td>ENQ</td>
256<td>PRIM_PHANTOM off</td>
257<td>&nbsp;</td>
258<td>&nbsp;</td>
259</tr>
260<tr>
261<td>6</td>
262<td>06</td>
263<td>0000 0110</td>
264<td>ACK</td>
265<td>PRIM_POSITION</td>
266<td>vector</td>
267<td>&nbsp;</td>
268</tr>
269<tr>
270<td>7</td>
271<td>07</td>
272<td>0000 0111</td>
273<td>BEL</td>
274<td>PRIM_SIZE</td>
275<td>vector</td>
276<td>&nbsp;</td>
277</tr>
278<tr>
279<td>8</td>
280<td>08</td>
281<td>0000 1000</td>
282<td>BS</td>
283<td>PRIM_ROTATION</td>
284<td>rotation</td>
285<td>&nbsp;</td>
286</tr>
287<tr>
288<td>9</td>
289<td>09</td>
290<td>0000 1001</td>
291<td>TAB</td>
292<td>PRIM_TYPE BOX</td>
293<td>integer:2 vector float vector vector vector</td>
294<td>&nbsp;</td>
295</tr>
296<tr>
297<td>10</td>
298<td>0A</td>
299<td>0000 1010</td>
300<td>LF</td>
301<td>&nbsp;</td>
302<td>&nbsp;</td>
303<td>&nbsp;</td>
304</tr>
305<tr>
306<td>11</td>
307<td>0B</td>
308<td>0000 1011</td>
309<td>VT</td>
310<td>&nbsp;</td>
311<td>&nbsp;</td>
312<td>&nbsp;</td>
313</tr>
314<tr>
315<td>12</td>
316<td>0C</td>
317<td>0000 1100</td>
318<td>FF</td>
319<td>&nbsp;</td>
320<td>&nbsp;</td>
321<td>&nbsp;</td>
322</tr>
323<tr>
324<td>13</td>
325<td>0D</td>
326<td>0000 1101</td>
327<td>CR</td>
328<td>&nbsp;</td>
329<td>&nbsp;</td>
330<td>&nbsp;</td>
331</tr>
332<tr>
333<td>14</td>
334<td>0E</td>
335<td>0000 1110</td>
336<td>SO</td>
337<td>&nbsp;</td>
338<td>&nbsp;</td>
339<td>&nbsp;</td>
340</tr>
341<tr>
342<td>15</td>
343<td>0F</td>
344<td>0000 1111</td>
345<td>SI</td>
346<td>&nbsp;</td>
347<td>&nbsp;</td>
348<td>&nbsp;</td>
349</tr>
350<tr>
351<td>16</td>
352<td>10</td>
353<td>0001 0000</td>
354<td>DLE</td>
355<td>&nbsp;</td>
356<td>&nbsp;</td>
357<td>&nbsp;</td>
358</tr>
359<tr>
360<td>17</td>
361<td>11</td>
362<td>0001 0001</td>
363<td>DC1</td>
364<td>PRIM_TEXTURE</td>
365<td>face string/key vector vector float</td>
366<td>&nbsp;</td>
367</tr>
368<tr>
369<td>18</td>
370<td>12</td>
371<td>0001 0010</td>
372<td>DC2</td>
373<td>PRIM_COLOUR</td>
374<td>face (vector float)=colour</td>
375<td>&nbsp;</td>
376</tr>
377<tr>
378<td>19</td>
379<td>13</td>
380<td>0001 0011</td>
381<td>DC3</td>
382<td>PRIM_BUMP_SHINY PRIM_SHINY_NONE</td>
383<td>face integer:5</td>
384<td>&nbsp;</td>
385</tr>
386<tr>
387<td>20</td>
388<td>14</td>
389<td>0001 0100</td>
390<td>DC4</td>
391<td>PRIM_FULLBRIGHT off</td>
392<td>face</td>
393<td>&nbsp;</td>
394</tr>
395<tr>
396<td>21</td>
397<td>15</td>
398<td>0001 0101</td>
399<td>NAK</td>
400<td>PRIM_FLEXIBLE off</td>
401<td>&nbsp;</td>
402<td>&nbsp;</td>
403</tr>
404<tr>
405<td>22</td>
406<td>16</td>
407<td>0001 0110</td>
408<td>SYN</td>
409<td>PRIM_TEXGEN PRIM_TEXGEN_DEFAULT</td>
410<td>face</td>
411<td>&nbsp;</td>
412</tr>
413<tr>
414<td>23</td>
415<td>17</td>
416<td>0001 0111</td>
417<td>ETB</td>
418<td>PRIM_POINT_LIGHT off</td>
419<td>&nbsp;</td>
420<td>&nbsp;</td>
421</tr>
422<tr>
423<td>24</td>
424<td>18</td>
425<td>0001 1000</td>
426<td>CAN</td>
427<td>PRIM_CAST_SHADOWS off</td>
428<td>&nbsp;</td>
429<td>&nbsp;</td>
430</tr>
431<tr>
432<td>25</td>
433<td>19</td>
434<td>0001 1001</td>
435<td>EM</td>
436<td>PRIM_GLOW</td>
437<td>face float</td>
438<td>&nbsp;</td>
439</tr>
440<tr>
441<td>26</td>
442<td>1A</td>
443<td>0001 1010</td>
444<td>SUB</td>
445<td>PRIM_TEXT</td>
446<td>string (vector float)=colour</td>
447<td>&nbsp;</td>
448</tr>
449<tr>
450<td>27</td>
451<td>1B</td>
452<td>0001 1011</td>
453<td>ESC</td>
454<td>PRIM_NAME</td>
455<td>string</td>
456<td>&nbsp;</td>
457</tr>
458<tr>
459<td>28</td>
460<td>1C</td>
461<td>0001 1100</td>
462<td>FS</td>
463<td>PRIM_DESC</td>
464<td>string</td>
465<td>&nbsp;</td>
466</tr>
467<tr>
468<td>29</td>
469<td>1D</td>
470<td>0001 1101</td>
471<td>GS</td>
472<td>PRIM_ROT_LOCAL</td>
473<td>rotation</td>
474<td>&nbsp;</td>
475</tr>
476<tr>
477<td>30</td>
478<td>1E</td>
479<td>0001 1110</td>
480<td>RS</td>
481<td>PRIM_POS_LOCAL</td>
482<td>vector</td>
483<td>This is just my guess about where LL will put it.</td>
484</tr>
485<tr>
486<td>31</td>
487<td>1F</td>
488<td>0001 1111</td>
489<td>US</td>
490<td>&nbsp;</td>
491<td>&nbsp;</td>
492<td>&nbsp;</td>
493</tr>
494<tr>
495<td>32</td>
496<td>20</td>
497<td>0010 0000</td>
498<td>SPACE</td>
499<td>PRIM_OMEGA</td>
500<td>vector float float</td>
501<td>&nbsp;</td>
502</tr>
503<tr>
504<td>33</td>
505<td>21</td>
506<td>0010 0001</td>
507<td>&nbsp;!</td>
508<td>PRIM_TYPE_LEGACY CYLINDER</td>
509<td>vector float float vector vector</td>
510<td>&nbsp;</td>
511</tr>
512<tr>
513<td>34</td>
514<td>22</td>
515<td>0010 0010</td>
516<td>"</td>
517<td>(PRIM_MATERIAL METAL)</td>
518<td>&nbsp;</td>
519<td>&nbsp;</td>
520</tr>
521<tr>
522<td>35</td>
523<td>23</td>
524<td>0010 0011</td>
525<td>#</td>
526<td>&nbsp;</td>
527<td>&nbsp;</td>
528<td>&nbsp;</td>
529</tr>
530<tr>
531<td>36</td>
532<td>24</td>
533<td>0010 0100</td>
534<td>$</td>
535<td>&nbsp;</td>
536<td>&nbsp;</td>
537<td>&nbsp;</td>
538</tr>
539<tr>
540<td>37</td>
541<td>25</td>
542<td>0010 0101</td>
543<td>&nbsp;%</td>
544<td>&nbsp;</td>
545<td>&nbsp;</td>
546<td>&nbsp;</td>
547</tr>
548<tr>
549<td>38</td>
550<td>26</td>
551<td>0010 0110</td>
552<td>&amp;</td>
553<td>&nbsp;</td>
554<td>&nbsp;</td>
555<td>&nbsp;</td>
556</tr>
557<tr>
558<td>39</td>
559<td>27</td>
560<td>0010 0111</td>
561<td>'</td>
562<td>&nbsp;</td>
563<td>&nbsp;</td>
564<td>&nbsp;</td>
565</tr>
566<tr>
567<td>40</td>
568<td>28</td>
569<td>0010 1000</td>
570<td>(</td>
571<td>&nbsp;</td>
572<td>&nbsp;</td>
573<td>&nbsp;</td>
574</tr>
575<tr>
576<td>41</td>
577<td>29</td>
578<td>0010 1001</td>
579<td>)</td>
580<td>PRIM_TYPE CYLINDER</td>
581<td>integer:2 vector float vector vector vector</td>
582<td>&nbsp;</td>
583</tr>
584<tr>
585<td>42</td>
586<td>2A</td>
587<td>0010 1010</td>
588<td>*</td>
589<td>&nbsp;</td>
590<td>&nbsp;</td>
591<td>&nbsp;</td>
592</tr>
593<tr>
594<td>43</td>
595<td>2B</td>
596<td>0010 1011</td>
597<td>+</td>
598<td>&nbsp;</td>
599<td>&nbsp;</td>
600<td>&nbsp;</td>
601</tr>
602<tr>
603<td>44</td>
604<td>2C</td>
605<td>0010 1100</td>
606<td>,</td>
607<td>&nbsp;</td>
608<td>&nbsp;</td>
609<td>&nbsp;</td>
610</tr>
611<tr>
612<td>45</td>
613<td>2D</td>
614<td>0010 1101</td>
615<td>-</td>
616<td>&nbsp;</td>
617<td>&nbsp;</td>
618<td>&nbsp;</td>
619</tr>
620<tr>
621<td>46</td>
622<td>2E</td>
623<td>0010 1110</td>
624<td>.</td>
625<td>&nbsp;</td>
626<td>&nbsp;</td>
627<td>&nbsp;</td>
628</tr>
629<tr>
630<td>47</td>
631<td>2F</td>
632<td>0010 1111</td>
633<td>/</td>
634<td>&nbsp;</td>
635<td>&nbsp;</td>
636<td>&nbsp;</td>
637</tr>
638<tr>
639<td>48</td>
640<td>30</td>
641<td>0011 0000</td>
642<td>0</td>
643<td>&nbsp;</td>
644<td>&nbsp;</td>
645<td>&nbsp;</td>
646</tr>
647<tr>
648<td>49</td>
649<td>31</td>
650<td>0011 0001</td>
651<td>1</td>
652<td>&nbsp;</td>
653<td>&nbsp;</td>
654<td>&nbsp;</td>
655</tr>
656<tr>
657<td>50</td>
658<td>32</td>
659<td>0011 0010</td>
660<td>2</td>
661<td>&nbsp;</td>
662<td>&nbsp;</td>
663<td>&nbsp;</td>
664</tr>
665<tr>
666<td>51</td>
667<td>33</td>
668<td>0011 0011</td>
669<td>3</td>
670<td>&nbsp;</td>
671<td>&nbsp;</td>
672<td>&nbsp;</td>
673</tr>
674<tr>
675<td>52</td>
676<td>34</td>
677<td>0011 0100</td>
678<td>4</td>
679<td>&nbsp;</td>
680<td>&nbsp;</td>
681<td>&nbsp;</td>
682</tr>
683<tr>
684<td>53</td>
685<td>35</td>
686<td>0011 0101</td>
687<td>5</td>
688<td>&nbsp;</td>
689<td>&nbsp;</td>
690<td>&nbsp;</td>
691</tr>
692<tr>
693<td>54</td>
694<td>36</td>
695<td>0011 0110</td>
696<td>6</td>
697<td>&nbsp;</td>
698<td>&nbsp;</td>
699<td>&nbsp;</td>
700</tr>
701<tr>
702<td>55</td>
703<td>37</td>
704<td>0011 0111</td>
705<td>7</td>
706<td>&nbsp;</td>
707<td>&nbsp;</td>
708<td>&nbsp;</td>
709</tr>
710<tr>
711<td>56</td>
712<td>38</td>
713<td>0011 1000</td>
714<td>8</td>
715<td>&nbsp;</td>
716<td>&nbsp;</td>
717<td>&nbsp;</td>
718</tr>
719<tr>
720<td>57</td>
721<td>39</td>
722<td>0011 1001</td>
723<td>9</td>
724<td>&nbsp;</td>
725<td>&nbsp;</td>
726<td>&nbsp;</td>
727</tr>
728<tr>
729<td>58</td>
730<td>3A</td>
731<td>0011 1010</td>
732<td>&nbsp;:</td>
733<td>&nbsp;</td>
734<td>&nbsp;</td>
735<td>&nbsp;</td>
736</tr>
737<tr>
738<td>59</td>
739<td>3B</td>
740<td>0011 1011</td>
741<td>&nbsp;;</td>
742<td>&nbsp;</td>
743<td>&nbsp;</td>
744<td>&nbsp;</td>
745</tr>
746<tr>
747<td>60</td>
748<td>3C</td>
749<td>0011 1100</td>
750<td>&lt;</td>
751<td>&nbsp;</td>
752<td>&nbsp;</td>
753<td>&nbsp;</td>
754</tr>
755<tr>
756<td>61</td>
757<td>3D</td>
758<td>0011 1101</td>
759<td>=</td>
760<td>&nbsp;</td>
761<td>&nbsp;</td>
762<td>&nbsp;</td>
763</tr>
764<tr>
765<td>62</td>
766<td>3E</td>
767<td>0011 1110</td>
768<td>&gt;</td>
769<td>&nbsp;</td>
770<td>&nbsp;</td>
771<td>&nbsp;</td>
772</tr>
773<tr>
774<td>63</td>
775<td>3F</td>
776<td>0011 1111</td>
777<td>&nbsp;?</td>
778<td>&nbsp;</td>
779<td>&nbsp;</td>
780<td>&nbsp;</td>
781</tr>
782<tr>
783<td>64</td>
784<td>40</td>
785<td>0100 0000</td>
786<td>@</td>
787<td>&nbsp;</td>
788<td>&nbsp;</td>
789<td>&nbsp;</td>
790</tr>
791<tr>
792<td>65</td>
793<td>41</td>
794<td>0100 0001</td>
795<td>A</td>
796<td>PRIM_TYPE_LEGACY PRISM</td>
797<td>vector float float vector vector</td>
798<td>&nbsp;</td>
799</tr>
800<tr>
801<td>66</td>
802<td>42</td>
803<td>0100 0010</td>
804<td>B</td>
805<td>BSON</td>
806<td>&nbsp;</td>
807<td>Switch to BSON mode. (Conflicts with PRIM_MATERIAL GLASS)</td>
808</tr>
809<tr>
810<td>67</td>
811<td>43</td>
812<td>0100 0011</td>
813<td>C</td>
814<td>&nbsp;</td>
815<td>&nbsp;</td>
816<td>&nbsp;</td>
817</tr>
818<tr>
819<td>68</td>
820<td>44</td>
821<td>0100 0100</td>
822<td>D</td>
823<td>&nbsp;</td>
824<td>&nbsp;</td>
825<td>&nbsp;</td>
826</tr>
827<tr>
828<td>69</td>
829<td>45</td>
830<td>0100 0101</td>
831<td>E</td>
832<td>EWWW</td>
833<td>&nbsp;</td>
834<td>Switch to XML mode, as used by OpenSim in IAR and OAR backup files.</td>
835</tr>
836<tr>
837<td>70</td>
838<td>46</td>
839<td>0100 0110</td>
840<td>F</td>
841<td>FUCK</td>
842<td>&nbsp;</td>
843<td>Switch to two, four byte command mode; with three, four bytes of object ID.</td>
844</tr>
845<tr>
846<td>71</td>
847<td>47</td>
848<td>0100 0111</td>
849<td>G</td>
850<td>&nbsp;</td>
851<td>&nbsp;</td>
852<td>&nbsp;</td>
853</tr>
854<tr>
855<td>72</td>
856<td>48</td>
857<td>0100 1000</td>
858<td>H</td>
859<td>&nbsp;</td>
860<td>&nbsp;</td>
861<td>&nbsp;</td>
862</tr>
863<tr>
864<td>73</td>
865<td>49</td>
866<td>0100 1001</td>
867<td>I</td>
868<td>PRIM_TYPE PRISM</td>
869<td>integer:2 vector float vector vector vector</td>
870<td>&nbsp;</td>
871</tr>
872<tr>
873<td>74</td>
874<td>4A</td>
875<td>0100 1010</td>
876<td>J</td>
877<td>JSON</td>
878<td>&nbsp;</td>
879<td>Switch to JSON mode.</td>
880</tr>
881<tr>
882<td>75</td>
883<td>4B</td>
884<td>0100 1011</td>
885<td>K</td>
886<td>&nbsp;</td>
887<td>&nbsp;</td>
888<td>&nbsp;</td>
889</tr>
890<tr>
891<td>76</td>
892<td>4C</td>
893<td>0100 1100</td>
894<td>L</td>
895<td>&nbsp;LUA</td>
896<td>&nbsp;</td>
897<td>&nbsp;Switch to Lua mode.</td>
898</tr>
899<tr>
900<td>77</td>
901<td>4D</td>
902<td>0100 1101</td>
903<td>M</td>
904<td>MRTX</td>
905<td>&nbsp;</td>
906<td>Switch to matrix-RAD mode.</td>
907</tr>
908<tr>
909<td>78</td>
910<td>4E</td>
911<td>0100 1110</td>
912<td>N</td>
913<td>&nbsp;</td>
914<td>&nbsp;</td>
915<td>&nbsp;</td>
916</tr>
917<tr>
918<td>79</td>
919<td>4F</td>
920<td>0100 1111</td>
921<td>O</td>
922<td>&nbsp;</td>
923<td>&nbsp;</td>
924<td>&nbsp;</td>
925</tr>
926<tr>
927<td>80</td>
928<td>50</td>
929<td>0101 0000</td>
930<td>P</td>
931<td>&nbsp;</td>
932<td>&nbsp;</td>
933<td>&nbsp;</td>
934</tr>
935<tr>
936<td>81</td>
937<td>51</td>
938<td>0101 0001</td>
939<td>Q</td>
940<td>&nbsp;</td>
941<td>&nbsp;</td>
942<td>&nbsp;</td>
943</tr>
944<tr>
945<td>82</td>
946<td>52</td>
947<td>0101 0010</td>
948<td>R</td>
949<td>&nbsp;</td>
950<td>&nbsp;</td>
951<td>&nbsp;</td>
952</tr>
953<tr>
954<td>83</td>
955<td>53</td>
956<td>0101 0011</td>
957<td>S</td>
958<td>PRIM_BUMP_SHINY PRIM_SHINY_LOW</td>
959<td>face integer:5</td>
960<td>&nbsp;</td>
961</tr>
962<tr>
963<td>84</td>
964<td>54</td>
965<td>0101 0100</td>
966<td>T</td>
967<td>TITE</td>
968<td>&nbsp;</td>
969<td>Switch back to the tight binary mode that is the sane default. B-)</td>
970</tr>
971<tr>
972<td>85</td>
973<td>55</td>
974<td>0101 0101</td>
975<td>U</td>
976<td>&nbsp;</td>
977<td>&nbsp;</td>
978<td>&nbsp;</td>
979</tr>
980<tr>
981<td>86</td>
982<td>56</td>
983<td>0101 0110</td>
984<td>V</td>
985<td>&nbsp;</td>
986<td>&nbsp;</td>
987<td>&nbsp;</td>
988</tr>
989<tr>
990<td>87</td>
991<td>57</td>
992<td>0101 0111</td>
993<td>W</td>
994<td>&nbsp;</td>
995<td>&nbsp;</td>
996<td>&nbsp;</td>
997</tr>
998<tr>
999<td>88</td>
1000<td>58</td>
1001<td>0101 1000</td>
1002<td>X</td>
1003<td>&nbsp;</td>
1004<td>&nbsp;</td>
1005<td>&nbsp;</td>
1006</tr>
1007<tr>
1008<td>89</td>
1009<td>59</td>
1010<td>0101 1001</td>
1011<td>Y</td>
1012<td>&nbsp;</td>
1013<td>&nbsp;</td>
1014<td>&nbsp;</td>
1015</tr>
1016<tr>
1017<td>90</td>
1018<td>5A</td>
1019<td>0101 1010</td>
1020<td>Z</td>
1021<td>&nbsp;</td>
1022<td>&nbsp;</td>
1023<td>&nbsp;</td>
1024</tr>
1025<tr>
1026<td>91</td>
1027<td>5B</td>
1028<td>0101 1011</td>
1029<td>[</td>
1030<td>&nbsp;</td>
1031<td>&nbsp;</td>
1032<td>&nbsp;</td>
1033</tr>
1034<tr>
1035<td>92</td>
1036<td>5C</td>
1037<td>0101 1100</td>
1038<td>\</td>
1039<td>&nbsp;</td>
1040<td>&nbsp;</td>
1041<td>&nbsp;</td>
1042</tr>
1043<tr>
1044<td>93</td>
1045<td>5D</td>
1046<td>0101 1101</td>
1047<td>]</td>
1048<td>&nbsp;</td>
1049<td>&nbsp;</td>
1050<td>&nbsp;</td>
1051</tr>
1052<tr>
1053<td>94</td>
1054<td>5E</td>
1055<td>0101 1110</td>
1056<td>^</td>
1057<td>&nbsp;</td>
1058<td>&nbsp;</td>
1059<td>&nbsp;</td>
1060</tr>
1061<tr>
1062<td>95</td>
1063<td>5F</td>
1064<td>0101 1111</td>
1065<td>_</td>
1066<td>&nbsp;</td>
1067<td>&nbsp;</td>
1068<td>&nbsp;</td>
1069</tr>
1070<tr>
1071<td>96</td>
1072<td>60</td>
1073<td>0110 0000</td>
1074<td>`</td>
1075<td>&nbsp;</td>
1076<td>&nbsp;</td>
1077<td>&nbsp;</td>
1078</tr>
1079<tr>
1080<td>97</td>
1081<td>61</td>
1082<td>0110 0001</td>
1083<td>a</td>
1084<td>PRIM_TYPE_LEGACY SPHERE</td>
1085<td>vector float vector</td>
1086<td>&nbsp;</td>
1087</tr>
1088<tr>
1089<td>98</td>
1090<td>62</td>
1091<td>0110 0010</td>
1092<td>b</td>
1093<td>bson</td>
1094<td>&nbsp;</td>
1095<td>Switch to BSON mode. (Conflicts with PRIM_MATERIAL WOOD)</td>
1096</tr>
1097<tr>
1098<td>99</td>
1099<td>63</td>
1100<td>0110 0011</td>
1101<td>c</td>
1102<td>&nbsp;</td>
1103<td>&nbsp;</td>
1104<td>&nbsp;</td>
1105</tr>
1106<tr>
1107<td>100</td>
1108<td>64</td>
1109<td>0110 0100</td>
1110<td>d</td>
1111<td>&nbsp;</td>
1112<td>&nbsp;</td>
1113<td>&nbsp;</td>
1114</tr>
1115<tr>
1116<td>101</td>
1117<td>65</td>
1118<td>0110 0101</td>
1119<td>e</td>
1120<td>ewww</td>
1121<td>&nbsp;</td>
1122<td>Switch to XML mode, as used by OpenSim in IAR and OAR backup files.</td>
1123</tr>
1124<tr>
1125<td>102</td>
1126<td>66</td>
1127<td>0110 0110</td>
1128<td>f</td>
1129<td>fuck</td>
1130<td>&nbsp;</td>
1131<td>Switch to two, four byte command mode; with three, four bytes of object ID.</td>
1132</tr>
1133<tr>
1134<td>103</td>
1135<td>67</td>
1136<td>0110 0111</td>
1137<td>g</td>
1138<td>&nbsp;</td>
1139<td>&nbsp;</td>
1140<td>&nbsp;</td>
1141</tr>
1142<tr>
1143<td>104</td>
1144<td>68</td>
1145<td>0110 1000</td>
1146<td>h</td>
1147<td>&nbsp;</td>
1148<td>&nbsp;</td>
1149<td>&nbsp;</td>
1150</tr>
1151<tr>
1152<td>105</td>
1153<td>69</td>
1154<td>0110 1001</td>
1155<td>i</td>
1156<td>PRIM_TYPE SPHERE</td>
1157<td>integer:2 vector float vector vector</td>
1158<td>&nbsp;</td>
1159</tr>
1160<tr>
1161<td>106</td>
1162<td>6A</td>
1163<td>0110 1010</td>
1164<td>j</td>
1165<td>json</td>
1166<td>&nbsp;</td>
1167<td>Switch to JSON mode.</td>
1168</tr>
1169<tr>
1170<td>107</td>
1171<td>6B</td>
1172<td>0110 1011</td>
1173<td>k</td>
1174<td>&nbsp;</td>
1175<td>&nbsp;</td>
1176<td>&nbsp;</td>
1177</tr>
1178<tr>
1179<td>108</td>
1180<td>6C</td>
1181<td>0110 1100</td>
1182<td>l</td>
1183<td>&nbsp;lua</td>
1184<td>&nbsp;</td>
1185<td>&nbsp;Switch to Lua mode.</td>
1186</tr>
1187<tr>
1188<td>109</td>
1189<td>6D</td>
1190<td>0110 1101</td>
1191<td>m</td>
1192<td>mrtx</td>
1193<td>&nbsp;</td>
1194<td>Switch to matrix-RAD mode.</td>
1195</tr>
1196<tr>
1197<td>110</td>
1198<td>6E</td>
1199<td>0110 1110</td>
1200<td>n</td>
1201<td>&nbsp;</td>
1202<td>&nbsp;</td>
1203<td>&nbsp;</td>
1204</tr>
1205<tr>
1206<td>111</td>
1207<td>6F</td>
1208<td>0110 1111</td>
1209<td>o</td>
1210<td>&nbsp;</td>
1211<td>&nbsp;</td>
1212<td>&nbsp;</td>
1213</tr>
1214<tr>
1215<td>112</td>
1216<td>70</td>
1217<td>0111 0000</td>
1218<td>p</td>
1219<td>&nbsp;</td>
1220<td>&nbsp;</td>
1221<td>&nbsp;</td>
1222</tr>
1223<tr>
1224<td>113</td>
1225<td>71</td>
1226<td>0111 0001</td>
1227<td>q</td>
1228<td>&nbsp;</td>
1229<td>&nbsp;</td>
1230<td>&nbsp;</td>
1231</tr>
1232<tr>
1233<td>114</td>
1234<td>72</td>
1235<td>0111 0010</td>
1236<td>r</td>
1237<td>&nbsp;</td>
1238<td>&nbsp;</td>
1239<td>&nbsp;</td>
1240</tr>
1241<tr>
1242<td>115</td>
1243<td>73</td>
1244<td>0111 0011</td>
1245<td>s</td>
1246<td>&nbsp;</td>
1247<td>&nbsp;</td>
1248<td>&nbsp;</td>
1249</tr>
1250<tr>
1251<td>116</td>
1252<td>74</td>
1253<td>0111 0100</td>
1254<td>t</td>
1255<td>tite</td>
1256<td>&nbsp;</td>
1257<td>Switch back to the tight binary mode that is the sane default. B-)</td>
1258</tr>
1259<tr>
1260<td>117</td>
1261<td>75</td>
1262<td>0111 0101</td>
1263<td>u</td>
1264<td>&nbsp;</td>
1265<td>&nbsp;</td>
1266<td>&nbsp;</td>
1267</tr>
1268<tr>
1269<td>118</td>
1270<td>76</td>
1271<td>0111 0110</td>
1272<td>v</td>
1273<td>&nbsp;</td>
1274<td>&nbsp;</td>
1275<td>&nbsp;</td>
1276</tr>
1277<tr>
1278<td>119</td>
1279<td>77</td>
1280<td>0111 0111</td>
1281<td>w</td>
1282<td>&nbsp;</td>
1283<td>&nbsp;</td>
1284<td>&nbsp;</td>
1285</tr>
1286<tr>
1287<td>120</td>
1288<td>78</td>
1289<td>0111 1000</td>
1290<td>x</td>
1291<td>&nbsp;</td>
1292<td>&nbsp;</td>
1293<td>&nbsp;</td>
1294</tr>
1295<tr>
1296<td>121</td>
1297<td>79</td>
1298<td>0111 1001</td>
1299<td>y</td>
1300<td>&nbsp;</td>
1301<td>&nbsp;</td>
1302<td>&nbsp;</td>
1303</tr>
1304<tr>
1305<td>122</td>
1306<td>7A</td>
1307<td>0111 1010</td>
1308<td>z</td>
1309<td>&nbsp;</td>
1310<td>&nbsp;</td>
1311<td>&nbsp;</td>
1312</tr>
1313<tr>
1314<td>123</td>
1315<td>7B</td>
1316<td>0111 1011</td>
1317<td>{</td>
1318<td>&nbsp;</td>
1319<td>&nbsp;</td>
1320<td>&nbsp;</td>
1321</tr>
1322<tr>
1323<td>124</td>
1324<td>7C</td>
1325<td>0111 1100</td>
1326<td>|</td>
1327<td>&nbsp;</td>
1328<td>&nbsp;</td>
1329<td>&nbsp;</td>
1330</tr>
1331<tr>
1332<td>125</td>
1333<td>7D</td>
1334<td>0111 1101</td>
1335<td>}</td>
1336<td>&nbsp;</td>
1337<td>&nbsp;</td>
1338<td>&nbsp;</td>
1339</tr>
1340<tr>
1341<td>126</td>
1342<td>7E</td>
1343<td>0111 1110</td>
1344<td>~</td>
1345<td>&nbsp;</td>
1346<td>&nbsp;</td>
1347<td>&nbsp;</td>
1348</tr>
1349<tr>
1350<td>127</td>
1351<td>7F</td>
1352<td>0111 1111</td>
1353<td>DEL</td>
1354<td>&nbsp;</td>
1355<td>&nbsp;</td>
1356<td>&nbsp;</td>
1357</tr>
1358<tr>
1359<td>128</td>
1360<td>80</td>
1361<td>1000 0000</td>
1362<td>€</td>
1363<td>&nbsp;</td>
1364<td>&nbsp;</td>
1365<td>&nbsp;</td>
1366</tr>
1367<tr>
1368<td>129</td>
1369<td>81</td>
1370<td>1000 0001</td>
1371<td></td>
1372<td>PRIM_TYPE_LEGACY TORUS</td>
1373<td>vector float float float vector vector</td>
1374<td>&nbsp;</td>
1375</tr>
1376<tr>
1377<td>130</td>
1378<td>82</td>
1379<td>1000 0010</td>
1380<td>‚</td>
1381<td>(PRIM_MATERIAL FLESH)</td>
1382<td>&nbsp;</td>
1383<td>&nbsp;</td>
1384</tr>
1385<tr>
1386<td>131</td>
1387<td>83</td>
1388<td>1000 0011</td>
1389<td>ƒ</td>
1390<td>PRIM_PHYSICS on</td>
1391<td>&nbsp;</td>
1392<td>&nbsp;</td>
1393</tr>
1394<tr>
1395<td>132</td>
1396<td>84</td>
1397<td>1000 0100</td>
1398<td>„</td>
1399<td>PRIM_TEMP_ON_REZ on</td>
1400<td>&nbsp;</td>
1401<td>&nbsp;</td>
1402</tr>
1403<tr>
1404<td>133</td>
1405<td>85</td>
1406<td>1000 0101</td>
1407<td>…</td>
1408<td>PRIM_PHANTOM on</td>
1409<td>&nbsp;</td>
1410<td>&nbsp;</td>
1411</tr>
1412<tr>
1413<td>134</td>
1414<td>86</td>
1415<td>1000 0110</td>
1416<td>†</td>
1417<td>PRIM_TEXGEN PRIM_TEXGEN_PLANAR</td>
1418<td>face</td>
1419<td>&nbsp;</td>
1420</tr>
1421<tr>
1422<td>135</td>
1423<td>87</td>
1424<td>1000 0111</td>
1425<td>‡</td>
1426<td>&nbsp;</td>
1427<td>&nbsp;</td>
1428<td>&nbsp;</td>
1429</tr>
1430<tr>
1431<td>136</td>
1432<td>88</td>
1433<td>1000 1000</td>
1434<td>ˆ</td>
1435<td>&nbsp;</td>
1436<td>&nbsp;</td>
1437<td>&nbsp;</td>
1438</tr>
1439<tr>
1440<td>137</td>
1441<td>89</td>
1442<td>1000 1001</td>
1443<td>‰</td>
1444<td>PRIM_TYPE TORUS</td>
1445<td>integer:2 vector float vector vector vector vector vector float float float</td>
1446<td>&nbsp;</td>
1447</tr>
1448<tr>
1449<td>138</td>
1450<td>8A</td>
1451<td>1000 1010</td>
1452<td>Š</td>
1453<td>&nbsp;</td>
1454<td>&nbsp;</td>
1455<td>&nbsp;</td>
1456</tr>
1457<tr>
1458<td>139</td>
1459<td>8B</td>
1460<td>1000 1011</td>
1461<td>‹</td>
1462<td>&nbsp;</td>
1463<td>&nbsp;</td>
1464<td>&nbsp;</td>
1465</tr>
1466<tr>
1467<td>140</td>
1468<td>8C</td>
1469<td>1000 1100</td>
1470<td>Œ</td>
1471<td>&nbsp;</td>
1472<td>&nbsp;</td>
1473<td>&nbsp;</td>
1474</tr>
1475<tr>
1476<td>141</td>
1477<td>8D</td>
1478<td>1000 1101</td>
1479<td></td>
1480<td>&nbsp;</td>
1481<td>&nbsp;</td>
1482<td>&nbsp;</td>
1483</tr>
1484<tr>
1485<td>142</td>
1486<td>8E</td>
1487<td>1000 1110</td>
1488<td>Ž</td>
1489<td>&nbsp;</td>
1490<td>&nbsp;</td>
1491<td>&nbsp;</td>
1492</tr>
1493<tr>
1494<td>143</td>
1495<td>8F</td>
1496<td>1000 1111</td>
1497<td></td>
1498<td>&nbsp;</td>
1499<td>&nbsp;</td>
1500<td>&nbsp;</td>
1501</tr>
1502<tr>
1503<td>144</td>
1504<td>90</td>
1505<td>1001 0000</td>
1506<td></td>
1507<td>&nbsp;</td>
1508<td>&nbsp;</td>
1509<td>&nbsp;</td>
1510</tr>
1511<tr>
1512<td>145</td>
1513<td>91</td>
1514<td>1001 0001</td>
1515<td>‘</td>
1516<td>&nbsp;</td>
1517<td>&nbsp;</td>
1518<td>&nbsp;</td>
1519</tr>
1520<tr>
1521<td>146</td>
1522<td>92</td>
1523<td>1001 0010</td>
1524<td>’</td>
1525<td>&nbsp;</td>
1526<td>&nbsp;</td>
1527<td>&nbsp;</td>
1528</tr>
1529<tr>
1530<td>147</td>
1531<td>93</td>
1532<td>1001 0011</td>
1533<td>“</td>
1534<td>PRIM_BUMP_SHINY PRIM_SHINY_MEDIUM</td>
1535<td>face integer:5</td>
1536<td>&nbsp;</td>
1537</tr>
1538<tr>
1539<td>148</td>
1540<td>94</td>
1541<td>1001 0100</td>
1542<td>”</td>
1543<td>PRIM_FULLBRIGHT on</td>
1544<td>face</td>
1545<td>&nbsp;</td>
1546</tr>
1547<tr>
1548<td>149</td>
1549<td>95</td>
1550<td>1001 0101</td>
1551<td>•</td>
1552<td>PRIM_FLEXIBLE on</td>
1553<td>integer float float float float vector</td>
1554<td>&nbsp;</td>
1555</tr>
1556<tr>
1557<td>150</td>
1558<td>96</td>
1559<td>1001 0110</td>
1560<td>–</td>
1561<td>&nbsp;</td>
1562<td>&nbsp;</td>
1563<td>&nbsp;</td>
1564</tr>
1565<tr>
1566<td>151</td>
1567<td>97</td>
1568<td>1001 0111</td>
1569<td>&nbsp;</td>
1570<td>PRIM_POINT_LIGHT on</td>
1571<td>(vector)=colour float float float</td>
1572<td>&nbsp;</td>
1573</tr>
1574<tr>
1575<td>152</td>
1576<td>98</td>
1577<td>1001 1000</td>
1578<td>&nbsp;</td>
1579<td>PRIM_CAST_SHADOWS on</td>
1580<td>&nbsp;</td>
1581<td>&nbsp;</td>
1582</tr>
1583<tr>
1584<td>153</td>
1585<td>99</td>
1586<td>1001 1001</td>
1587<td>&nbsp;</td>
1588<td>&nbsp;</td>
1589<td>&nbsp;</td>
1590<td>&nbsp;</td>
1591</tr>
1592<tr>
1593<td>154</td>
1594<td>9A</td>
1595<td>1001 1010</td>
1596<td>&nbsp;</td>
1597<td>&nbsp;</td>
1598<td>&nbsp;</td>
1599<td>&nbsp;</td>
1600</tr>
1601<tr>
1602<td>155</td>
1603<td>9B</td>
1604<td>1001 1011</td>
1605<td>&nbsp;</td>
1606<td>&nbsp;</td>
1607<td>&nbsp;</td>
1608<td>&nbsp;</td>
1609</tr>
1610<tr>
1611<td>156</td>
1612<td>9C</td>
1613<td>1001 1100</td>
1614<td>&nbsp;</td>
1615<td>&nbsp;</td>
1616<td>&nbsp;</td>
1617<td>&nbsp;</td>
1618</tr>
1619<tr>
1620<td>157</td>
1621<td>9D</td>
1622<td>1001 1101</td>
1623<td>&nbsp;</td>
1624<td>&nbsp;</td>
1625<td>&nbsp;</td>
1626<td>&nbsp;</td>
1627</tr>
1628<tr>
1629<td>158</td>
1630<td>9E</td>
1631<td>1001 1110</td>
1632<td>&nbsp;</td>
1633<td>&nbsp;</td>
1634<td>&nbsp;</td>
1635<td>&nbsp;</td>
1636</tr>
1637<tr>
1638<td>159</td>
1639<td>9F</td>
1640<td>1001 1111</td>
1641<td>&nbsp;</td>
1642<td>&nbsp;</td>
1643<td>&nbsp;</td>
1644<td>&nbsp;</td>
1645</tr>
1646<tr>
1647<td>160</td>
1648<td>A0</td>
1649<td>1010 0000</td>
1650<td>&nbsp;</td>
1651<td>&nbsp;</td>
1652<td>&nbsp;</td>
1653<td>&nbsp;</td>
1654</tr>
1655<tr>
1656<td>161</td>
1657<td>A1</td>
1658<td>1010 0001</td>
1659<td>&nbsp;</td>
1660<td>PRIM_TYPE_LEGACY TUBE</td>
1661<td>vector float float float</td>
1662<td>&nbsp;</td>
1663</tr>
1664<tr>
1665<td>162</td>
1666<td>A2</td>
1667<td>1010 0010</td>
1668<td>&nbsp;</td>
1669<td>(PRIM_MATERIAL PLASTIC)</td>
1670<td>&nbsp;</td>
1671<td>&nbsp;</td>
1672</tr>
1673<tr>
1674<td>163</td>
1675<td>A3</td>
1676<td>1010 0011</td>
1677<td>&nbsp;</td>
1678<td>&nbsp;</td>
1679<td>&nbsp;</td>
1680<td>&nbsp;</td>
1681</tr>
1682<tr>
1683<td>164</td>
1684<td>A4</td>
1685<td>1010 0100</td>
1686<td>&nbsp;</td>
1687<td>&nbsp;</td>
1688<td>&nbsp;</td>
1689<td>&nbsp;</td>
1690</tr>
1691<tr>
1692<td>165</td>
1693<td>A5</td>
1694<td>1010 0101</td>
1695<td>&nbsp;</td>
1696<td>&nbsp;</td>
1697<td>&nbsp;</td>
1698<td>&nbsp;</td>
1699</tr>
1700<tr>
1701<td>166</td>
1702<td>A6</td>
1703<td>1010 0110</td>
1704<td>&nbsp;</td>
1705<td>&nbsp;</td>
1706<td>&nbsp;</td>
1707<td>&nbsp;</td>
1708</tr>
1709<tr>
1710<td>167</td>
1711<td>A7</td>
1712<td>1010 0111</td>
1713<td>&nbsp;</td>
1714<td>&nbsp;</td>
1715<td>&nbsp;</td>
1716<td>&nbsp;</td>
1717</tr>
1718<tr>
1719<td>168</td>
1720<td>A8</td>
1721<td>1010 1000</td>
1722<td>&nbsp;</td>
1723<td>&nbsp;</td>
1724<td>&nbsp;</td>
1725<td>&nbsp;</td>
1726</tr>
1727<tr>
1728<td>169</td>
1729<td>A9</td>
1730<td>1010 1001</td>
1731<td>&nbsp;</td>
1732<td>PRIM_TYPE TUBE</td>
1733<td>integer:2 vector float vector vector vector vector vector float float float</td>
1734<td>&nbsp;</td>
1735</tr>
1736<tr>
1737<td>170</td>
1738<td>AA</td>
1739<td>1010 1010</td>
1740<td>&nbsp;</td>
1741<td>&nbsp;</td>
1742<td>&nbsp;</td>
1743<td>&nbsp;</td>
1744</tr>
1745<tr>
1746<td>171</td>
1747<td>AB</td>
1748<td>1010 1011</td>
1749<td>&nbsp;</td>
1750<td>&nbsp;</td>
1751<td>&nbsp;</td>
1752<td>&nbsp;</td>
1753</tr>
1754<tr>
1755<td>172</td>
1756<td>AC</td>
1757<td>1010 1100</td>
1758<td>&nbsp;</td>
1759<td>&nbsp;</td>
1760<td>&nbsp;</td>
1761<td>&nbsp;</td>
1762</tr>
1763<tr>
1764<td>173</td>
1765<td>AD</td>
1766<td>1010 1101</td>
1767<td>&nbsp;</td>
1768<td>&nbsp;</td>
1769<td>&nbsp;</td>
1770<td>&nbsp;</td>
1771</tr>
1772<tr>
1773<td>174</td>
1774<td>AE</td>
1775<td>1010 1110</td>
1776<td>&nbsp;</td>
1777<td>&nbsp;</td>
1778<td>&nbsp;</td>
1779<td>&nbsp;</td>
1780</tr>
1781<tr>
1782<td>175</td>
1783<td>AF</td>
1784<td>1010 1111</td>
1785<td>&nbsp;</td>
1786<td>&nbsp;</td>
1787<td>&nbsp;</td>
1788<td>&nbsp;</td>
1789</tr>
1790<tr>
1791<td>176</td>
1792<td>B0</td>
1793<td>1011 0000</td>
1794<td>&nbsp;</td>
1795<td>&nbsp;</td>
1796<td>&nbsp;</td>
1797<td>&nbsp;</td>
1798</tr>
1799<tr>
1800<td>177</td>
1801<td>B1</td>
1802<td>1011 0001</td>
1803<td>&nbsp;</td>
1804<td>&nbsp;</td>
1805<td>&nbsp;</td>
1806<td>&nbsp;</td>
1807</tr>
1808<tr>
1809<td>178</td>
1810<td>B2</td>
1811<td>1011 0010</td>
1812<td>&nbsp;</td>
1813<td>&nbsp;</td>
1814<td>&nbsp;</td>
1815<td>&nbsp;</td>
1816</tr>
1817<tr>
1818<td>179</td>
1819<td>B3</td>
1820<td>1011 0011</td>
1821<td>&nbsp;</td>
1822<td>&nbsp;</td>
1823<td>&nbsp;</td>
1824<td>&nbsp;</td>
1825</tr>
1826<tr>
1827<td>180</td>
1828<td>B4</td>
1829<td>1011 0100</td>
1830<td>&nbsp;</td>
1831<td>&nbsp;</td>
1832<td>&nbsp;</td>
1833<td>&nbsp;</td>
1834</tr>
1835<tr>
1836<td>181</td>
1837<td>B5</td>
1838<td>1011 0101</td>
1839<td>&nbsp;</td>
1840<td>&nbsp;</td>
1841<td>&nbsp;</td>
1842<td>&nbsp;</td>
1843</tr>
1844<tr>
1845<td>182</td>
1846<td>B6</td>
1847<td>1011 0110</td>
1848<td>&nbsp;</td>
1849<td>&nbsp;</td>
1850<td>&nbsp;</td>
1851<td>&nbsp;</td>
1852</tr>
1853<tr>
1854<td>183</td>
1855<td>B7</td>
1856<td>1011 0111</td>
1857<td>&nbsp;</td>
1858<td>&nbsp;</td>
1859<td>&nbsp;</td>
1860<td>&nbsp;</td>
1861</tr>
1862<tr>
1863<td>184</td>
1864<td>B8</td>
1865<td>1011 1000</td>
1866<td>&nbsp;</td>
1867<td>&nbsp;</td>
1868<td>&nbsp;</td>
1869<td>&nbsp;</td>
1870</tr>
1871<tr>
1872<td>185</td>
1873<td>B9</td>
1874<td>1011 1001</td>
1875<td>&nbsp;</td>
1876<td>&nbsp;</td>
1877<td>&nbsp;</td>
1878<td>&nbsp;</td>
1879</tr>
1880<tr>
1881<td>186</td>
1882<td>BA</td>
1883<td>1011 1010</td>
1884<td>&nbsp;</td>
1885<td>&nbsp;</td>
1886<td>&nbsp;</td>
1887<td>&nbsp;</td>
1888</tr>
1889<tr>
1890<td>187</td>
1891<td>BB</td>
1892<td>1011 1011</td>
1893<td>&nbsp;</td>
1894<td>&nbsp;</td>
1895<td>&nbsp;</td>
1896<td>&nbsp;</td>
1897</tr>
1898<tr>
1899<td>188</td>
1900<td>BC</td>
1901<td>1011 1100</td>
1902<td>&nbsp;</td>
1903<td>&nbsp;</td>
1904<td>&nbsp;</td>
1905<td>&nbsp;</td>
1906</tr>
1907<tr>
1908<td>189</td>
1909<td>BD</td>
1910<td>1011 1101</td>
1911<td>&nbsp;</td>
1912<td>&nbsp;</td>
1913<td>&nbsp;</td>
1914<td>&nbsp;</td>
1915</tr>
1916<tr>
1917<td>190</td>
1918<td>BE</td>
1919<td>1011 1110</td>
1920<td>&nbsp;</td>
1921<td>&nbsp;</td>
1922<td>&nbsp;</td>
1923<td>&nbsp;</td>
1924</tr>
1925<tr>
1926<td>191</td>
1927<td>BF</td>
1928<td>1011 1111</td>
1929<td>&nbsp;</td>
1930<td>&nbsp;</td>
1931<td>&nbsp;</td>
1932<td>&nbsp;</td>
1933</tr>
1934<tr>
1935<td>192</td>
1936<td>C0</td>
1937<td>1100 0000</td>
1938<td>&nbsp;</td>
1939<td>&nbsp;</td>
1940<td>&nbsp;</td>
1941<td>&nbsp;</td>
1942</tr>
1943<tr>
1944<td>193</td>
1945<td>C1</td>
1946<td>1100 0001</td>
1947<td>&nbsp;</td>
1948<td>&nbsp;</td>
1949<td>&nbsp;</td>
1950<td>&nbsp;</td>
1951</tr>
1952<tr>
1953<td>194</td>
1954<td>C2</td>
1955<td>1100 0010</td>
1956<td>&nbsp;</td>
1957<td>(PRIM_MATERIAL RUBBER)</td>
1958<td>&nbsp;</td>
1959<td>&nbsp;</td>
1960</tr>
1961<tr>
1962<td>195</td>
1963<td>C3</td>
1964<td>1100 0011</td>
1965<td>&nbsp;</td>
1966<td>&nbsp;</td>
1967<td>&nbsp;</td>
1968<td>&nbsp;</td>
1969</tr>
1970<tr>
1971<td>196</td>
1972<td>C4</td>
1973<td>1100 0100</td>
1974<td>&nbsp;</td>
1975<td>&nbsp;</td>
1976<td>&nbsp;</td>
1977<td>&nbsp;</td>
1978</tr>
1979<tr>
1980<td>197</td>
1981<td>C5</td>
1982<td>1100 0101</td>
1983<td>&nbsp;</td>
1984<td>&nbsp;</td>
1985<td>&nbsp;</td>
1986<td>&nbsp;</td>
1987</tr>
1988<tr>
1989<td>198</td>
1990<td>C6</td>
1991<td>1100 0110</td>
1992<td>&nbsp;</td>
1993<td>&nbsp;</td>
1994<td>&nbsp;</td>
1995<td>&nbsp;</td>
1996</tr>
1997<tr>
1998<td>199</td>
1999<td>C7</td>
2000<td>1100 0111</td>
2001<td>&nbsp;</td>
2002<td>&nbsp;</td>
2003<td>&nbsp;</td>
2004<td>&nbsp;</td>
2005</tr>
2006<tr>
2007<td>200</td>
2008<td>C8</td>
2009<td>1100 1000</td>
2010<td>&nbsp;</td>
2011<td>&nbsp;</td>
2012<td>&nbsp;</td>
2013<td>&nbsp;</td>
2014</tr>
2015<tr>
2016<td>201</td>
2017<td>C9</td>
2018<td>1100 1001</td>
2019<td>&nbsp;</td>
2020<td>PRIM_TYPE RING</td>
2021<td>integer:2 vector float vector vector vector vector vector float float float</td>
2022<td>&nbsp;</td>
2023</tr>
2024<tr>
2025<td>202</td>
2026<td>CA</td>
2027<td>1100 1010</td>
2028<td>&nbsp;</td>
2029<td>&nbsp;</td>
2030<td>&nbsp;</td>
2031<td>&nbsp;</td>
2032</tr>
2033<tr>
2034<td>203</td>
2035<td>CB</td>
2036<td>1100 1011</td>
2037<td>&nbsp;</td>
2038<td>&nbsp;</td>
2039<td>&nbsp;</td>
2040<td>&nbsp;</td>
2041</tr>
2042<tr>
2043<td>204</td>
2044<td>CC</td>
2045<td>1100 1100</td>
2046<td>&nbsp;</td>
2047<td>&nbsp;</td>
2048<td>&nbsp;</td>
2049<td>&nbsp;</td>
2050</tr>
2051<tr>
2052<td>205</td>
2053<td>CD</td>
2054<td>1100 1101</td>
2055<td>&nbsp;</td>
2056<td>&nbsp;</td>
2057<td>&nbsp;</td>
2058<td>&nbsp;</td>
2059</tr>
2060<tr>
2061<td>206</td>
2062<td>CE</td>
2063<td>1100 1110</td>
2064<td>&nbsp;</td>
2065<td>&nbsp;</td>
2066<td>&nbsp;</td>
2067<td>&nbsp;</td>
2068</tr>
2069<tr>
2070<td>207</td>
2071<td>CF</td>
2072<td>1100 1111</td>
2073<td>&nbsp;</td>
2074<td>&nbsp;</td>
2075<td>&nbsp;</td>
2076<td>&nbsp;</td>
2077</tr>
2078<tr>
2079<td>208</td>
2080<td>D0</td>
2081<td>1101 0000</td>
2082<td>&nbsp;</td>
2083<td>&nbsp;</td>
2084<td>&nbsp;</td>
2085<td>&nbsp;</td>
2086</tr>
2087<tr>
2088<td>209</td>
2089<td>D1</td>
2090<td>1101 0001</td>
2091<td>&nbsp;</td>
2092<td>&nbsp;</td>
2093<td>&nbsp;</td>
2094<td>&nbsp;</td>
2095</tr>
2096<tr>
2097<td>210</td>
2098<td>D2</td>
2099<td>1101 0010</td>
2100<td>&nbsp;</td>
2101<td>&nbsp;</td>
2102<td>&nbsp;</td>
2103<td>&nbsp;</td>
2104</tr>
2105<tr>
2106<td>211</td>
2107<td>D3</td>
2108<td>1101 0011</td>
2109<td>&nbsp;</td>
2110<td>PRIM_BUMP_SHINY PRIM_SHINY_HIGH</td>
2111<td>face integer:5</td>
2112<td>&nbsp;</td>
2113</tr>
2114<tr>
2115<td>212</td>
2116<td>D4</td>
2117<td>1101 0100</td>
2118<td>&nbsp;</td>
2119<td>&nbsp;</td>
2120<td>&nbsp;</td>
2121<td>&nbsp;</td>
2122</tr>
2123<tr>
2124<td>213</td>
2125<td>D5</td>
2126<td>1101 0101</td>
2127<td>&nbsp;</td>
2128<td>&nbsp;</td>
2129<td>&nbsp;</td>
2130<td>&nbsp;</td>
2131</tr>
2132<tr>
2133<td>214</td>
2134<td>D6</td>
2135<td>1101 0110</td>
2136<td>&nbsp;</td>
2137<td>&nbsp;</td>
2138<td>&nbsp;</td>
2139<td>&nbsp;</td>
2140</tr>
2141<tr>
2142<td>215</td>
2143<td>D7</td>
2144<td>1101 0111</td>
2145<td>&nbsp;</td>
2146<td>&nbsp;</td>
2147<td>&nbsp;</td>
2148<td>&nbsp;</td>
2149</tr>
2150<tr>
2151<td>216</td>
2152<td>D8</td>
2153<td>1101 1000</td>
2154<td>&nbsp;</td>
2155<td>&nbsp;</td>
2156<td>&nbsp;</td>
2157<td>&nbsp;</td>
2158</tr>
2159<tr>
2160<td>217</td>
2161<td>D9</td>
2162<td>1101 1001</td>
2163<td>&nbsp;</td>
2164<td>&nbsp;</td>
2165<td>&nbsp;</td>
2166<td>&nbsp;</td>
2167</tr>
2168<tr>
2169<td>218</td>
2170<td>DA</td>
2171<td>1101 1010</td>
2172<td>&nbsp;</td>
2173<td>&nbsp;</td>
2174<td>&nbsp;</td>
2175<td>&nbsp;</td>
2176</tr>
2177<tr>
2178<td>219</td>
2179<td>DB</td>
2180<td>1101 1011</td>
2181<td>&nbsp;</td>
2182<td>&nbsp;</td>
2183<td>&nbsp;</td>
2184<td>&nbsp;</td>
2185</tr>
2186<tr>
2187<td>220</td>
2188<td>DC</td>
2189<td>1101 1100</td>
2190<td>&nbsp;</td>
2191<td>&nbsp;</td>
2192<td>&nbsp;</td>
2193<td>&nbsp;</td>
2194</tr>
2195<tr>
2196<td>221</td>
2197<td>DD</td>
2198<td>1101 1101</td>
2199<td>&nbsp;</td>
2200<td>&nbsp;</td>
2201<td>&nbsp;</td>
2202<td>&nbsp;</td>
2203</tr>
2204<tr>
2205<td>222</td>
2206<td>DE</td>
2207<td>1101 1110</td>
2208<td>&nbsp;</td>
2209<td>&nbsp;</td>
2210<td>&nbsp;</td>
2211<td>&nbsp;</td>
2212</tr>
2213<tr>
2214<td>223</td>
2215<td>DF</td>
2216<td>1101 1111</td>
2217<td>&nbsp;</td>
2218<td>&nbsp;</td>
2219<td>&nbsp;</td>
2220<td>&nbsp;</td>
2221</tr>
2222<tr>
2223<td>224</td>
2224<td>E0</td>
2225<td>1110 0000</td>
2226<td>&nbsp;</td>
2227<td>&nbsp;</td>
2228<td>&nbsp;</td>
2229<td>&nbsp;</td>
2230</tr>
2231<tr>
2232<td>225</td>
2233<td>E1</td>
2234<td>1110 0001</td>
2235<td>&nbsp;</td>
2236<td>&nbsp;</td>
2237<td>&nbsp;</td>
2238<td>&nbsp;</td>
2239</tr>
2240<tr>
2241<td>226</td>
2242<td>E2</td>
2243<td>1110 0010</td>
2244<td>&nbsp;</td>
2245<td>(PRIM_MATERIAL LIGHT)</td>
2246<td>&nbsp;</td>
2247<td>Deprecated: Looks the same as [ PRIM_FULLBRIGHT, ALL_SIDES, TRUE ]</td>
2248</tr>
2249<tr>
2250<td>227</td>
2251<td>E3</td>
2252<td>1110 0011</td>
2253<td>&nbsp;</td>
2254<td>&nbsp;</td>
2255<td>&nbsp;</td>
2256<td>&nbsp;</td>
2257</tr>
2258<tr>
2259<td>228</td>
2260<td>E4</td>
2261<td>1110 0100</td>
2262<td>&nbsp;</td>
2263<td>&nbsp;</td>
2264<td>&nbsp;</td>
2265<td>&nbsp;</td>
2266</tr>
2267<tr>
2268<td>229</td>
2269<td>E5</td>
2270<td>1110 0101</td>
2271<td>&nbsp;</td>
2272<td>&nbsp;</td>
2273<td>&nbsp;</td>
2274<td>&nbsp;</td>
2275</tr>
2276<tr>
2277<td>230</td>
2278<td>E6</td>
2279<td>1110 0110</td>
2280<td>&nbsp;</td>
2281<td>&nbsp;</td>
2282<td>&nbsp;</td>
2283<td>&nbsp;</td>
2284</tr>
2285<tr>
2286<td>231</td>
2287<td>E7</td>
2288<td>1110 0111</td>
2289<td>&nbsp;</td>
2290<td>&nbsp;</td>
2291<td>&nbsp;</td>
2292<td>&nbsp;</td>
2293</tr>
2294<tr>
2295<td>232</td>
2296<td>E8</td>
2297<td>1110 1000</td>
2298<td>&nbsp;</td>
2299<td>&nbsp;</td>
2300<td>&nbsp;</td>
2301<td>&nbsp;</td>
2302</tr>
2303<tr>
2304<td>233</td>
2305<td>E9</td>
2306<td>1110 1001</td>
2307<td>&nbsp;</td>
2308<td>PRIM_TYPE SCULPT</td>
2309<td>string/key integer:8</td>
2310<td>&nbsp;</td>
2311</tr>
2312<tr>
2313<td>234</td>
2314<td>EA</td>
2315<td>1110 1010</td>
2316<td>&nbsp;</td>
2317<td>&nbsp;</td>
2318<td>&nbsp;</td>
2319<td>&nbsp;</td>
2320</tr>
2321<tr>
2322<td>235</td>
2323<td>EB</td>
2324<td>1110 1011</td>
2325<td>&nbsp;</td>
2326<td>&nbsp;</td>
2327<td>&nbsp;</td>
2328<td>&nbsp;</td>
2329</tr>
2330<tr>
2331<td>236</td>
2332<td>EC</td>
2333<td>1110 1100</td>
2334<td>&nbsp;</td>
2335<td>&nbsp;</td>
2336<td>&nbsp;</td>
2337<td>&nbsp;</td>
2338</tr>
2339<tr>
2340<td>237</td>
2341<td>ED</td>
2342<td>1110 1101</td>
2343<td>&nbsp;</td>
2344<td>&nbsp;</td>
2345<td>&nbsp;</td>
2346<td>&nbsp;</td>
2347</tr>
2348<tr>
2349<td>238</td>
2350<td>EE</td>
2351<td>1110 1110</td>
2352<td>&nbsp;</td>
2353<td>&nbsp;</td>
2354<td>&nbsp;</td>
2355<td>&nbsp;</td>
2356</tr>
2357<tr>
2358<td>239</td>
2359<td>EF</td>
2360<td>1110 1111</td>
2361<td>&nbsp;</td>
2362<td>&nbsp;</td>
2363<td>&nbsp;</td>
2364<td>&nbsp;</td>
2365</tr>
2366<tr>
2367<td>240</td>
2368<td>F0</td>
2369<td>1111 0000</td>
2370<td>&nbsp;</td>
2371<td>&nbsp;</td>
2372<td>&nbsp;</td>
2373<td>&nbsp;</td>
2374</tr>
2375<tr>
2376<td>241</td>
2377<td>F1</td>
2378<td>1111 0001</td>
2379<td>&nbsp;</td>
2380<td>&nbsp;</td>
2381<td>&nbsp;</td>
2382<td>&nbsp;</td>
2383</tr>
2384<tr>
2385<td>242</td>
2386<td>F2</td>
2387<td>1111 0010</td>
2388<td>&nbsp;</td>
2389<td>&nbsp;</td>
2390<td>&nbsp;</td>
2391<td>&nbsp;</td>
2392</tr>
2393<tr>
2394<td>243</td>
2395<td>F3</td>
2396<td>1111 0011</td>
2397<td>&nbsp;</td>
2398<td>&nbsp;</td>
2399<td>&nbsp;</td>
2400<td>&nbsp;</td>
2401</tr>
2402<tr>
2403<td>244</td>
2404<td>F4</td>
2405<td>1111 0100</td>
2406<td>&nbsp;</td>
2407<td>&nbsp;</td>
2408<td>&nbsp;</td>
2409<td>&nbsp;</td>
2410</tr>
2411<tr>
2412<td>245</td>
2413<td>F5</td>
2414<td>1111 0101</td>
2415<td>&nbsp;</td>
2416<td>&nbsp;</td>
2417<td>&nbsp;</td>
2418<td>&nbsp;</td>
2419</tr>
2420<tr>
2421<td>246</td>
2422<td>F6</td>
2423<td>1111 0110</td>
2424<td>&nbsp;</td>
2425<td>&nbsp;</td>
2426<td>&nbsp;</td>
2427<td>&nbsp;</td>
2428</tr>
2429<tr>
2430<td>247</td>
2431<td>F7</td>
2432<td>1111 0111</td>
2433<td>&nbsp;</td>
2434<td>&nbsp;</td>
2435<td>&nbsp;</td>
2436<td>&nbsp;</td>
2437</tr>
2438<tr>
2439<td>248</td>
2440<td>F8</td>
2441<td>1111 1000</td>
2442<td>&nbsp;</td>
2443<td>&nbsp;</td>
2444<td>&nbsp;</td>
2445<td>&nbsp;</td>
2446</tr>
2447<tr>
2448<td>249</td>
2449<td>F9</td>
2450<td>1111 1001</td>
2451<td>&nbsp;</td>
2452<td>&nbsp;</td>
2453<td>&nbsp;</td>
2454<td>&nbsp;</td>
2455</tr>
2456<tr>
2457<td>250</td>
2458<td>FA</td>
2459<td>1111 1010</td>
2460<td>&nbsp;</td>
2461<td>&nbsp;</td>
2462<td>&nbsp;</td>
2463<td>&nbsp;</td>
2464</tr>
2465<tr>
2466<td>251</td>
2467<td>FB</td>
2468<td>1111 1011</td>
2469<td>&nbsp;</td>
2470<td>&nbsp;</td>
2471<td>&nbsp;</td>
2472<td>&nbsp;</td>
2473</tr>
2474<tr>
2475<td>252</td>
2476<td>FC</td>
2477<td>1111 1100</td>
2478<td>&nbsp;</td>
2479<td>&nbsp;</td>
2480<td>&nbsp;</td>
2481<td>&nbsp;</td>
2482</tr>
2483<tr>
2484<td>253</td>
2485<td>FD</td>
2486<td>1111 1101</td>
2487<td>&nbsp;</td>
2488<td>&nbsp;</td>
2489<td>&nbsp;</td>
2490<td>&nbsp;</td>
2491</tr>
2492<tr>
2493<td>254</td>
2494<td>FE</td>
2495<td>1111 1110</td>
2496<td>&nbsp;</td>
2497<td>&nbsp;</td>
2498<td>&nbsp;</td>
2499<td>&nbsp;</td>
2500</tr>
2501<tr>
2502<td>255</td>
2503<td>FF</td>
2504<td>1111 1111</td>
2505<td>&nbsp;</td>
2506<td>&nbsp;</td>
2507<td>&nbsp;</td>
2508<td>&nbsp;</td>
2509</tr>
2510</tbody>
2511</table>
2512<p><br /> This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p>
2513</body>
2514</html>
diff --git a/docs/OMG-WTF-BBQ.html b/docs/OMG-WTF-BBQ.html
new file mode 100644
index 0000000..d5e2928
--- /dev/null
+++ b/docs/OMG-WTF-BBQ.html
@@ -0,0 +1,54 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<p>The rationale</p>
6<p>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.</p>
7<p>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.</p>
8<p>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.</p>
9<p>OMG Node</p>
10<p>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.</p>
11<p>WTF -- Where's The File</p>
12<p>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.</p>
13<p>BBQ -- Big, Broad Query</p>
14<p>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.</p>
15<p>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.</p>
16<p>COW -- Copy On Write.</p>
17<p>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?</p>
18<p>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.</p>
19<p>Where does the COW come in? If it's got horns, any where it wants to. Er...</p>
20<p>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.</p>
21<p>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.</p>
22<p>To quote a famous local sporting hero "Where's the cheese?". Ah, that's another story...</p>
23<p>&nbsp;</p>
24<h2>Late night realization about multiple asset servers and Censorship and such</h2>
25<p>(04:33:43 AM) alice_crush: Oh!</p>
26<p>(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!"</p>
27<p>(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.</p>
28<p>(04:39:07 AM) alice_crush: have to get to like phase 2 or whatever, not the stop gap quick fix proxying feature</p>
29<p>(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.</p>
30<p>(04:40:53 AM) onefang: "You are not authorized to see this t-shirt.".</p>
31<p>(04:41:04 AM) alice_crush: though would need some special client side controls/subscriptions something like that.</p>
32<p>(04:41:26 AM) onefang: "Knomes stole this skirt, quick get hippos."</p>
33<p>(04:41:34 AM) alice_crush: "This texture above your security grade" lol</p>
34<p>(04:43:07 AM) onefang: "These are not the clothes you are searching for."</p>
35<p>(04:43:10 AM) alice_crush: minor issue of when uploading a texture specifying which asset server it goes to...</p>
36<p>(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</p>
37<p>(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..</p>
38<p>(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.</p>
39<p>(04:46:20 AM) alice_crush: Lol, theres always a clever policy choice that makes the thought police un necessary.</p>
40<p>(04:46:47 AM) alice_crush: LL will hate it (Breaks the shared experience rule)</p>
41<p>(04:47:00 AM) alice_crush: OS will probably hate it too</p>
42<p>(04:48:08 AM) onefang: I'm not particularly worried about pissing off those two groups.</p>
43<p>(04:48:37 AM) alice_crush: I would rather make thought police optional, then market forces will eliminate them.</p>
44<p>(04:48:02 AM) alice_crush: some day could have certificates for asset servers, collect them in classes "PG servers", "IP Clean servers" lol</p>
45<p>&nbsp;</p>
46<h2>More linear description of above</h2>
47<p>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.</p>
48<p>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.</p>
49<p>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.</p>
50<p>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.</p>
51<p>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.</p>
52<p>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.</p>
53</body>
54</html>
diff --git a/docs/SledjHamr.html b/docs/SledjHamr.html
new file mode 100644
index 0000000..9aade32
--- /dev/null
+++ b/docs/SledjHamr.html
@@ -0,0 +1,134 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5<h1> New virtual world architecture (by onefang, some ideas nutted out with Alice and others) </h1>
6<p>(This may look like a half polished design document, but it's really just a brain dump. I just write well. Starting to turn it into a half polished design document though.)</p>
7<p>This might sometimes be referred to as SledjHamr, SldjHmr, NGIW,or the term that currently has favour - Open Magic Garden (OMG).</p>
8<p>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.</p>
9<p>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.</p>
10<p>See <a href="NGIW.html">NGIW</a> for more ideas from Alice. Interestingly enough, some of my ideas are basically the conclusion of one of the OpenSim developers Masters degree dissertation <a href="http://justincc.org/blog/2010/10/25/my-masters-dissertation-on-internet-scale-virtual-environment-architectures/">http://justincc.org/blog/2010/10/25/my-masters-dissertation-on-internet-scale-virtual-environment-architectures/</a> . Note, I read that after I came up with these ideas.</p>
11<p>&nbsp;</p>
12<h2> boxen </h2>
13<p>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.</p>
14<p>Might even have client side scripting that just acts like a script engine (using the same engine code). Not sure how well client side physics would work, but Kitto seems to think it's possible, and I trust his wisdom on physics. At the very least, the client could be responsible for it's own avatar physics, with just some quick sanity checks by the server physics engine.</p>
15<p>In fact, we could even fully distribute the workload of physics (or scripting). Imagine a system vaguely like DNS. Each object has one unique authoritative simulator, and any number of non-authoritative ones. One non-authoritative physics engine is my client simulating your object. An authoritative one would be you simulating your object. I could usually simulate most objects myself in the client. An obvious exception could be your avatar. Then periodically I check the authoritative server for results for some of the objects I'm simulating. When I find an authoritative server is frequently giving different results from non-authoritative servers, I have found a cheater, and should stop playing with them. (Or maybe I found a bug, or an avatar, or maybe an object with some kind of secret (scripted?) behaviour that hasn't been communicated to me and my client. Obviously would need to handle this detail in a real system.) Combat oriented folks could literally do this, "You have been ejected from the region for cheating". Social oriented people might just refuse updates from a 'cheating' server, and elect other servers to become authoritative wrt some objects. Adding protocols to (re)elect the authoritative simulator for an object could result in systems with no central server smarter than jabber or a webDAV type store. The system might well have bandwidths an order of magnitude less that are currently consumed.</p>
16<p>Note, this leaves the way for physics and script engines to just be generic stand alone servers, not specifically attached to any one sim. Swapping about to service any given sim data server at any given moment. Possibly splitting up the load on a busy sim if needed. Clever load management should be used.</p>
17<p>Would be preferable to have any one sim data server being serviced by the same physics or script engine/s over time, as then they only have to exchange changes to the sim data when needed, instead of constantly reloading the entire sim state. Script engines in particular need to transfer script state around if they are swapping scripts.</p>
18<p>So in the end, command channels between the servers, engines, and clients swap all changes around, all talking to the sim data server, which stores persistent sim state, and passes changes onto every one else.</p>
19<p>&nbsp;</p>
20<h2> protocols </h2>
21<p>One could argue that it's the LL created protocol that is the real reason why things are so crap. OpenSim had to reverse engineer these protocols, and then implement them as well as they could so that existing viewers worked. In general the existing protocols are UDP based. This I feel is the reason for the general unreliability of the entire system, UDP just is not reliable, it's not meant to be reliable. LL have tried to build reliability around UDP, but they are really just playing catchup with TCP, which has been reliable by design since the early 1970's. <a href="http://www.cyberciti.biz/faq/key-differences-between-tcp-and-udp-protocols/">http://www.cyberciti.biz/faq/key-differences-between-tcp-and-udp-protocols/</a></p>
22<p>For transferring of assets at least, I think a fully HTTP based system is a much better idea. HTTP is a well understood and simple protocol created in the early 1990's, it's very mature, with many technologies to solve general problems that plague SL style virtual worlds. For example, web caches just work, with no need to clear them at the first sign of trouble, like we have to do with LL inspired asset caches.</p>
23<p>The general idea is for a sim server to have a file that describes the sim. This file will have a .omg extension, and will be referred to as index.omg in this document. Like an index.html file, there can be several files at the same level with other names and the same extension. usually for other sims. This index.omg file will include URLs to the various objects in the sim, their position, and rotation. Perhaps their size as well. Mesh support is being added, and they will have URLs stored in world somehow, as well as a URLs to the index.omg files.</p>
24<p>At least during an interim period, when we have to deal with standard OpenSim and SL servers, we will need a way to stash URLs into places the standard servers will keep for us, and not disrupt things too much. Initially I was using transparent hover text on prims to hold the mesh URLs. This is not a long term solution. What we can do instead is use land and prim media URLs. By URL encoding a URL to a sims index.omg file, or a mesh file, then tacking it on the end of a land or prim media URL after a # character, I think that would do the trick. In theory, the parts after # of a URL are not sent to the server, since the server sends back the entire page, leaving it up to the browser to sort out what to do with the # part.</p>
25<p>When this has matured enough that we have our own server side code that deals with index.omg files (generally by keeping them up to date when people change things in the client), then we can just have index.omg URLs in world, and add the displaced media URL to the index.omg file. The land media URL points to the servers index.omg, and the server (having already established that it's not an OMG aware client) can then redirect the client to the proper media URL. If the client is OMG aware, it just pulls the displaced media URL out of the index.omg file. Note that this would only really be needed if the two combined URLs end up being too long (255 bytes seems to be the limit). Actual mesh objects that are not part of an index.omg file could perhaps be dealt with in a similar way, but the mesh files would have to be on the OMG aware sim server, so it knows they are being requested by non OMG aware clients to do the suitable redirect magic.</p>
26<p>&nbsp;</p>
27<h2> the world </h2>
28<p>&nbsp;</p>
29<h3> in world asset server </h3>
30<p>Unpack an OAR into a web server. An OAR file is supposed to be a complete copy of everything in the sim, including meta data like access lists. In reality, they do seem to miss prim description and prim sit position data at least. We can always add what is missing. Existing OpenSim versions can create these OAR files from the console. My experience with meta 7 is that A) OAR file creation can be automated. B) OAR file creation is not a noticeable load on a busy server. I say these things since I had written a simple script to make OAR file backups of every meta 7 sim four times a day. No one noticed any extra lag.</p>
31<p>The contents of an OAR file are basically a bunch of XML files to describe the objects in the sim, and the actual assets used to make up those objects. The example OAR files I looked at followed the 80/20 rule fairly well, the assets being 80% of the data, the descriptions being 20%. There are also a few tiny XML files containing the other sim meta data, and one file containing raw terrain data. The assets are just ordinary files, jpeg200, ogg, bvh, lsl, etc. Though the notecard files have some extra header info at the beginning for some odd reason. One thing that is absent is a central description of what goes where. Each objects XML description includes it's position info though.</p>
32<p>When a user arrives at a sim, they could start by downloading those object description XML files, and the terrain file. Those XML files could compress well 20:1 if all done at once as a tarball. The terrain file is more 2:1 if compressed. This is gz compression, which is supported by typical web servers and web browsers on the fly. Once the user has downloaded the description XML files, they can start to rez things within their draw distance, requesting the textures from the assets part of the unpacked OAR file as needed. Rezzing terrain would be - download the terrain raw data (giving the terrain shape), download the sims settings XML file (giving the texture UUIDs and parameters for the terrain textures), dowload the four terrain textures, then generate the terrain randomly as usual. Note that on first arrival, generally only texture assets would be downloaded. Things like sounds and animations would only need to be downloaded when the sims scripts say they are needed. Notecards and scripts embedded in objects would only need to be downloaded when an authorised user opens them for editing.</p>
33<p>The alternative that I mentioned above, would be to start with some central description of the sim. Basically the equivalent of a web page, index.omg maybe. This would be a text (or binary) file that only includes the list of object names, their X,Y,Z location, and rotation. Perhaps some small amount of meta data to, like the terrain meta data mentioned above. Then the user would only have to download the object description XML (or binary command list) files for those objects within their draw distance. This is a good idea I think. It maps well to the web that everyone is familiar with, and allows a lot of flexibility. For example, this file and all other data could be generated on the fly by PHP code. Typical CMS systems could be used to manage this content just like all the other web content they manage. This means we just supply protocol and data structures, plus a simple implementation, then step out of the way and let people implement their own variations using tools they are long familiar with. An IETF RFC could be in the works.</p>
34<p>All of this leaves out the LL inspired DRM system. Our objective to smash the garden walls means that such a system is of no value, there is no central server to control that. On the other hand, we replace it with the mature and well understood web site content protection systems already in existence. In particular, the only real way on the web to protect IP is to keep it on the server, once the client has it, they can copy things no matter what you do. This already applies to all web content. The only thing you can protect from copying is the web back end code, coz you never transmit that to clients. The same level of protection is thus now given to LSL code. Unless it's being edited, it's never sent across the 'net, only executed by servers. When unpacking the OARs, we can leave out the LSL files.</p>
35<p>To get there from here, we can start simple. Server side really is just a matter of creating OARs and unpacking them into a web server. The web server can be very simple (I've written a suitable one in one page of Java many years ago). At this stage just dealing with static data, with a last modified header support, would be a great start for experimentation. Client code can be modified to check the web server first, then fall back to the usual methods. Simple things we can do to start with, adding the more interesting stuff later. To start with, OpenSim would still be dealing with this stuff, the first step is to run side by side, so we have a small first step, and can use OpenSim as a crutch. The next step might be to generate this central description index.omg file from the existing data in the OAR, then the client can check for that file first. Meshes are new to the old systems, and I already am working on code for those, they will likely be the first things served via an index.omg file.</p>
36<p>Someone did wonder if this would be a major change to the client. My mesh experiments say it would not be. My mesh system uses an existing modular library that knows many different mesh file formats, and can download these files given an ordinary URL (it even understands file:// URLs). I wrote a tiny bit of shim code that basically calls this library with a URL that came from the sim server, then feeds the resulting vertex data into the right spots of the client rendering pipeline. The library itself was easy to understand, the really hard part was figuring out the horrid LL rendering pipeline so I knew where to stick my one or two line shims. It was always my plan to simply create modules for this library that understood SL style prims. These prims could be fed via URLs to the sort of sim server I'm describing here, or fed from the usual client sources.</p>
37<p>I should also mention that since we are starting from ordinary OAR files, these do include UUIDs for assets, encoded into the file name. So, for instance, a texture URL of http://grid.example.org/sims/Welcome/assets/00484839-3e9d-4fdb-8512-bd381f7d0737_texture.jp2 could map directly to an unpacked OAR, could be generated from a known UUID, or could have the UUID extracted from it. Not too hard to work in either direction between new and legacy code.</p>
38<p>In the end, the simulator software can access the in world assets via the same web server. On the other hand, if the assets are stored in a database and managed by a CMS system, the simulator could access it directly. That database could even be the same as the existing OpenSim one, with the web server accessing that. Lots of possibilities here.</p>
39<p>Alice just reminded me of something I forgot to write down. Amongst the other meta data in index.omg would be URL like links to other sims. They could specify basic type links, like "to the west", or more complex links "300 meters up, 20 meters to the north". No need for them to always be bidirectional, sometimes you can't get there from here. These links are for the sims you can see and get to from this sim. Sim size should also be in the meta data. Perhaps the basic terrain could include an alpha layer if you don't want a rectangular sim? Certainly extending the terrain with a single high rez texture that just paints the terrain should be part of the plan.</p>
40<p>&nbsp;</p>
41<h3> inventory asset server </h3>
42<p>Unpack on IAR into a web server, could even be a web server built into the client, or just the users hard drive. Very similar to the ideas for in world asset server, only in this case, the user that owns the inventory is the only one that gets access to it. They can choose where to store their inventory, or even have multiple inventories in several places. Pretty much like email, the user can choose to store it on their local hard drive, on some web server somewhere (that may or may not also serve their home sim or other sims), store it in googles or amazons cloud, etc.</p>
43<p>An IAR is very similar to an OAR, only without all that extra land meta data and terrain raw data. It does organise the description XML files into a folder tree, just like it appears in the client. Extra asset types are stored, notably non prim clothing and non prim body parts.</p>
44<p>Giving an inventory item to someone then just becomes a file transfer, using any available file transfer method. Though the XML and assets should be packaged up, perhaps into a small IAR. Which could include entire folder trees, but without any of the limits imposed by the SL system.</p>
45<p>When a user is in a sim, their inventory should be presented to the sim as a web server. The user gets to choose what is presented in this way though, they can keep things private until they need to transfer some thing somewhere.</p>
46<p>Nothing in this design stops people from directly editing stuff in their various inventories as if it was rezzed in world or worn. Except for legacy inventories, and somehow displaying the object so they can see what they are doing.</p>
47<p>&nbsp;</p>
48<h3> rezzing objects and avatars, editing things </h3>
49<p>This is where the in world assets systems and inventory assets systems come together. There are a number of interactions that need to be taken care of. As a general principle, the sim server's web server should also be acting as a caching proxy for the users web server that is built into the client.</p>
50<p>&nbsp;</p>
51<h4> User to user inventory transfer. </h4>
52<p>Alice picks some thing from one of her widely scattered inventories, and hands it to Dave. They could use any method available to them to do this as a file transfer. However, the client should include a built in method.</p>
53<p>The object (or objects, including a possible folder tree) would be packed up into an IAR file at Alice's end. This file would be put into her clients web server, probably with some authorisation in the web server. The sim server would be informed of this, and that it is for Dave. If Dave is not in the sim, or not online, then something else might happen (we'll figure those out later lol). If he is in the sim, then he gets a notification, his client offers him a choice of his currently active inventories, he picks one, and tells the sim server to go get it. The sim server downloads the IAR file from Alice's client web server, acting as an authenticating proxy, and transfers it to Dave's client. Dave's client then pushes the file to his chosen inventories web server. Some short circuiting of these steps may be possible. For example, some end to end encrypted tunnel (like OTR) may already exist between Alice and Dave, and the file can be transferred through that tunnel. Or if Dave wants it on his hard drive inventory, then his client just downloads it through the sim proxy straight to his hard drive.</p>
54<p>&nbsp;</p>
55<h4> User inventory rezzing to sim. </h4>
56<p>Rizzy rezzes something in world from her inventory. The object will consist of the XML description file (or binary command language file), plus whatever assets make up the object, and whatever assets are in the contents, included nested objects. This all gets packaged up in Rizzy's client into an IAR file, then dropped into her clients public web sever. The sim server is informed, and downloads the file from Rizzy's client web server, storing it in it's own web server for all others in the sim to access as normal. The index.omg file will need to be updated, and avatars in the sim will need to be told to download the new object (sans contents). OK, so the sim server will need to unpack and repack the object, keeping the full version around.</p>
57<p>&nbsp;</p>
58<h4> User taking something from (including take copy) sim into inventory. </h4>
59<p>The reverse of the above. Rizzy asks the sim if she can take an object. If she can, the full IAR file version is downloaded from the sims web server to Rizzy's client. She gets to decide which of her inventories it is sent to from there, or just puts it on her hard drive. If it's not "take copy", then once it is confirmed that the object is safely stored at Rizzy's end, the sim can delete it's copy.</p>
60<p>&nbsp;</p>
61<h4> User wearing something from inventory. </h4>
62<p>This is really just a specialisation of a user rezzing something from inventory. The worn object, or worn non prim item, is stored in the users inventory, and has to be distributed to others in the sim so they can see it. It should follow the exact same code path as above.</p>
63<p>&nbsp;</p>
64<h4> User wearing something from sim. </h4>
65<p>In this case, either the object goes into the users inventory first, or it doesn't. Experiments will be useful. In either case, it can be covered by stuff mentioned else where in this design.</p>
66<p>&nbsp;</p>
67<h4> The users avatar. </h4>
68<p>I have been told that avatars are the most resource intensive thing in a sim by OpenSim developers. This is why you can have thousands of prims, almost as many scripts, but less than 50 avatars in a sim. A typical bunch of half a dozen avatars at a small party might have more prims and scripts than the rest of the sim. On top of that, they are all MOVING! Or at least standing still while the animations make them dance.</p>
69<p>On the other hand, they could be dealt with as just another type of in sim object. All movement is driven by animations, most of which have to be downloaded by the client from the server, then used by the client to animate the avatars. As far as the server is concerned though, those animations are just like textures - binary blobs in a file, their contents meaningless to the server. The same applies to the avatar mesh - it's just a small blob of parameters sent to the client to drive the morphing of the standard avatar mesh.</p>
70<p>The first tricky thing is attachments. But again, these are just ordinary opaque objects sent to the client by the server. They have some extra info - the attachment point and the avatar they are attached to (though that last one can be surmised from the objects owner). The position and rotation of the object is relative to the attachment point, but it's still just a position and rotation. It's up to the client to sort all that out, and have the attachment follow the animation.</p>
71<p>The second tricky part is baked skins. At some point, the three textures that make up the actual skin, have to be composited with what ever textures are used for clothing, tattoos, cum stains, etc., to make up an overall texture to be painted over the avatar mesh. LL decided that this compositing should be done in the client, which then sends the result to the sim, so the sim can spread it to others watching. This would usually be done when an avatar TPs to a sim, or logs on. In both cases, the client is at that time getting buffeted with a storm of network data and calculations, and is busy rezzing the entire sim (or at least that part within draw distance). Is it any wonder that slow computers often screw this up. On the other hand, at this time the sim is also a bit busier than usual, figuring out what to send to the newly arrived client, and sending it all.</p>
72<p>Note - in this design, we have moved the burden of figuring out which objects are visible to any particular user from the server to the client, in the form of the index.omg file. Perhaps we can swap the burden of compositing clothing layers and skins to the server? In this design, the server is requesting skin and clothing data from the client, though it's possible that the client has told the server "hey, you can use this inventory over there on some third parties server". Yes, we are juggling the work loads between server and client, plus adding others into the mix. Experimentation and options will be needed. Perhaps letting the client and server work out who should be doing what, based on relative free resources at the time?</p>
73<p>In the existing old design, the server tells the client "you are wearing these things", the client grabs "these things" from the server, composites them together, then sends the result to the server. In this new design, the client might be in control of what is being worn, might already have "these things" on the local hard drive, might even have a cached copy of the composite, then sends it to the server. Or the client has to grab "these things" from a few scattered inventory servers, including possibly the sim server itself, does the compositing, sends it to the server. A possible third choice is the server has to grab "these things" from all over the web, composites them, then sends the result to all watching avatars (including the original avatar). Keep in mind that index.omg might include the positions of avatars, though they are constantly changing, so that might not be such a good idea. Still need to have the server tell the clients where the other avatars are. Taking into account draw distance.</p>
74<p>When the user is TPing from sim to sim, might be best if they have their baked skin cached, and just send it to the new sim on arrival. Changing clothes or rebaking would obviously have to recalculate everything all over again. In all cases, it IS the sim itself that sends this final baked texture to the other avatars, so this would be easy to mess with for PG fallback sims where everyone is an attachment free ruth. Such a sim simply never downloads anything from inventory servers. Except for the sim owner, so they can build stuff.</p>
75<p>The last tricky thing is physics, but that's covered later.</p>
76<p>&nbsp;</p>
77<h4> User changing something in sim, or creating a new object. </h4>
78<p>I have not spoken yet about how to keep everyone informed about changes. In general, the bulk of the heavy lifting (big asset files) in this design has been left to standard HTTP protocols, letting mature technologies like caching proxies make life easier and quicker. This may not be suitable for real time editing and other similar things. One thing that sets this style of virtual world apart from others is in world editing of objects is real time visible to everyone. When I move an object from A to B, every one sees it move as I move it. This is one big source of immersion, and a good thing. Obviously there has to be some sort of command channel for this data to flow through quickly. I say this command channel has to be as reliable as possible, with very low latency. The data that moves through this channel should be limited to meta data, any change of assets should simply be mentioned in this channel, then the usual HTTP stuff used to shift the asset files around. So the commands in this command channel would be things like - "move object A to X,Y,Z"; "change the texture of prim A, on side B, to texture X"; "create a prim at X,Y,Z, of this type"; "change parameter X of prim A, to M".</p>
79<p>The exact form of this command channel I'll leave to debate, flame wars, and experimentation. I would highly recommend these things about it - Move away from XML to something less bloated, preferable a binary command language. The shorter each command is, the less latency. This command language should be common throughout the system where ever in world changes have to be communicated. The command language should be generic, and extensible. The command language should be parseble by a rather naive parse, again to keep complexity, and thus latency, down. I think my 10 years of experiments in a similar sort of command language for GUIs might come in handy here. The channel would benefit from some sort of broadcast mechanism, if possible and it stays within the above mentioned boundaries.</p>
80<p>Note - in this case, the commands would generally be flying about in human time frames. Humans will be driving these commands, so they wont be coming down the channel in bulk at high speed. There's only so quick a human can drag their mouse ...</p>
81<p>On the other hand, since the assets are all on a web server, there is nothing stopping people from using standard web methods of changing content. CMS, FTP uploads, webDav, shell access to the web server contents, what ever works now for managing and editing web content can still work.</p>
82<p>&nbsp;</p>
83<h4> Script changing something in sim. </h4>
84<p>... On the other hand, scripts can drive this exact same command channel to do their work on scripted objects. The exact same methods as used for users changing stuff should be used if it's being done by scripts. No code duplication, just pump it into the same channel with the same methods. In this case, the commands COULD be coming through in bulk and at high speed. There would be multiple sources of commands, being distributed to multiple avatars.</p>
85<p>The commands in both cases would need to be used by the sim to change the otherwise static data on it's web server, so that new avatars arriving will see the objects in their new state. Much fun will be had getting this part right.</p>
86<p>&nbsp;</p>
87<h4> Whatever the hell I forgot. lol </h4>
88<p>I'm sure I did. I'm only human. B-)</p>
89<p>Two things I forgot are in world text chatter and sounds. Yes, they are mentioned elsewhere as completely separate entities, but the thing I forgot was their positional nature. Local chat uses three "volume" settings, that are just treated like ranges. Whisper, say and shouted text is only "heard" by people that are close enough to the avatar or object doing the chatting. There is also LLRegionSay(), plus object chat channels. Sound clips played by objects, as well as voice from avatars, is attenuated by how far you are listening from them. Both could be treated as similar things, where the distance from one to the other is important. Though as usual, LL has been inconstant. Sounds depend on where your camera is, text on where your avatar is.</p>
90<p>The point is that they do need this position information from the sim server, to be able to sort out who or what can see / hear which utterances. Later more sophisticated systems might take the surroundings into account to provide muffling by walls, echos, and other various affects on the sound. Even going as far as partially muting text by fading it into obscurity, or even "echoing" it in extreme cases.</p>
91<p>&nbsp;</p>
92<h3> physics </h3>
93<p>Physics is a whole other ball game, it does need access to the in world asset data though. Keep it in the simulator? Hand it out to clients? Kitto is way more experienced in this stuff than me, and I think he is working on something in that field. He did not like my "crutch" concept when it applied to OpenSim though, even though he thought it was OK for client software. Certainly the physics engine should get it's data from the sim server the same way clients do, and change things back on the server the same way to. Physics engines should be able to deal with just a portion of the data on a sim. That way we can carve up the work amongst a few physics engines, maybe even send some of it to clients.</p>
94<p>&nbsp;</p>
95<h3> scripts </h3>
96<p>Just in case you missed it - with this web based system, ANY web backend programming language can be used instead of LSL. Sure there will need to be reasonably efficient libraries for the various LL functions in LSL so that all those programming languages can do the same things LSL can. You could look at it the other way, this pushes LSL onto the web server, running as just another web scripting language. I'd love to write a Lua implementation of LSL, I'm sure Alice would want to write a Scheme one.</p>
97<p>There would still be need of a really efficient script engine though. Simply coz there are sooo many LSL scripts that would be running on any given sim. This should be a later step, not included in the first small step mentioned in the in world asset server section above. I've been thinking of trying out Lua as a backend for LSL, and trying some micro threading style experiments.</p>
98<p>&nbsp;</p>
99<h2> other services </h2>
100<p>Other services in virtual worlds are generally stand alone, with only minimal ties into the in world stuff. Some of this could be handled by jabber. Note that there is a good argument for having these all as plugins to the client, and even as separate servers.</p>
101<p>&nbsp;</p>
102<h3> login, presence, IM, and more </h3>
103<p>I've always thought that jabber could be used for login, presence, friends lists, IM, group chat, ad hoc multi user chats, and even local chat. It's already a well understood, proven, open standard. It scales well, google uses it for their IM system. It has the concept of out of band data, and is extensible in other ways.</p>
104<p>On the other hand, it IS XML, though that's mostly forgivable as it's only running at human interface speeds, and works as a single XML stream rather than individual XML files per utterance. So the XML overhead is not so bad. Recently I've had my qualms about it's stability. We are using it for the various chat rooms, and they seem to be a bit unreliable at times. The dreaded recurring history spam, people dropping out for odd reasons, etc. It might just be lousy implementations. I don't want to give up on it just yet, so some research is in order.</p>
105<p>The already open jabber stream could be a wrapper around the command channel I have mentioned above. Possibly using out of band data if the command language is binary. It's a good match, though I'm not sure about extra latency.</p>
106<p>&nbsp;</p>
107<h3> groups </h3>
108<p>Group chat can use jabber rooms as mentioned above. It should be noted that OpenSim actually uses IRC protocol for that internally. I don't like that idea, IRC is not good at keeping nicks exclusively for an individual. Net splits are common enough to throw doubts on IRC's scalability. If the users are already logging onto a jabber server for the reasons mentioned above, then jabber chat rooms for groups comes for free.</p>
109<p>The other aspects of groups might be doable with jabber as well, it's got a lot of the pieces in a nicely flexible way.</p>
110<p>&nbsp;</p>
111<h3> in world chat </h3>
112<p>In world chat could use a system similar to what mumble uses, with an extension to jabber. The users position can be included in the jabber stream, or the jabber server could be modified to grab that data from the sim server. Then the jabber server relays any local chat only to those that are near enough.</p>
113<p>&nbsp;</p>
114<h3> voice </h3>
115<p>Use mumble, don't think much more need be said about that. Look it up.</p>
116<p>&nbsp;</p>
117<h3> web browser </h3>
118<p>Webkit seems to be the general king of the heap for embedded web browsers at the moment. Impy already moved to use it, thus meta-impy has it. It's use could be generalised. I'd like to see web based admin stuff that works well from the built in web browser. Then it's way easy to go beyond the the clients existing god tools, most of which are not implemented in OpenSim anyway. This also opens up the admin tools market, some basic protocols to get to the tools, and to get in world info to the tools, but the tools can be anything developers dream up. Could do the same for some user stuff to. Trouble ticket systems built into the world via the web, not built into the client. Combined with web an a prim, user interfaces for HUDs and stuff could be better. Not sure if that sort of thing worked well in SL, but I'd like to "do it right".</p>
119<p>Now usually I'm against virtual world clients built into web browsers, but a lot of this design makes that much easier to do. Mostly the reason why people want it is rather wanky, they want every damn thing in the browser, even if they don't want to use actual open standards, and tend to make them Windows only. There is not really any good sort of match between the web browsing experience and the virtual world using experience. This design however opens up one very good use case - Open Cobalt style TP portals built on web standards. Now THAT's sexy. B-)</p>
120<p>On the other hand, I still think a lot of web stuff is bloated. That's why I started to write my matrix-RAD system 15 years ago. No one was interested in small, fast, and flexible; plus Java fell out of favour for general web work. Java moved to enterprise, where bigger is better; and to mobile phones, where apparently no one is really interested in small, fast, and flexible. So I abandoned it years ago. I'd love to rewrite it in C (or maybe lua), and add a scriptable, network transparent, GUI system to virtual worlds. It would also be a good basis for the command language mentioned above. That's just me though. B-)</p>
121<p>&nbsp;</p>
122<h3> media </h3>
123<p>Media is actually reasonably well taken care of already at the design level, even if there are current growing pains with Imprudence changing things around. There are some ideas I'd like to throw out there though.</p>
124<p>Using mumble for voice means you get in world voices that fade out over distance, like they should, and just like the LL voice does. With an open voice system though, we can generalise that, by attaching a mumble sound source to a prim. Ghetto blasters anyone? Atmospheric sound sources that are not limited to 10 second pre recorded sound clips? Not having to slice up your land for different radio stations? DJs not having to buy streams, but being able to pump music directly into the sim?</p>
125<p>A popular thing to do is have a big TV that shows YouTube videos. The big problem with that is that it bypasses YouTubes advert revenue stream, so YouTube try to discourage that, and often YouTube clips wont work on that sort of setup. Generalised web on a prim could take care of that.</p>
126<p>&nbsp;</p>
127<h2> random notes from my old Web 3.0 document </h2>
128<p>People can run their own copy of a site, and invite others, to take the load off the server. Still talking to the server for server resident objects. These can be private, similar to layers and dimensions in other virtual worlds.</p>
129<p>There is a way for some 3D tools to send updates in real time to other tools, we should definitely support that.</p>
130<p>People could have a little movable sim of their own running from their computer. Like the insides of a car or boat, moving around other peoples sims.</p>
131<p>Touch mode - click on something to touch it, left button for touching with left hand, right button for right hand, dail up the strength of the touch with the mouse wheel. A mouse drag will naturally drag, push, or pull something, with force set by the mouse wheel, and at the speed that the user drags the mouse. Extend this so that any input device can be used to control any limb, digit, or other joint. Professional puppeteers may have open protocols for this sort of thing.</p>
132<p><br /> This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p>
133</body>
134</html>
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 0000000..62f1bb1
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,31 @@
1<html>
2<head>
3</head>
4<body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">
5Welcome to the SledjHamr wiki!
6
7<p>OMG might stand for Open Magic Garden, but we are open to other suggestions.</p>
8<p>Open Management Group have a US registered trade mark of "OMG", and they deal with computer integration standards for "enterprise", in other words, big business, with deep pockets plus scary lawyers, and too close to what we are doing for us to get away with it for long. So, in the interests of having a name so I can just start coding dammit, I'm going with my original name of SledjHamr. It's not very marketing friendly, and even I have to stop and think exactly how it is spelled. lol</p>
9<p>We don't have a great name for it, until recently I liked NGIW (Next Generation Immersive Web) best, but OMG has plenty of appeal. What it is, even if we don't have a clear name for it, is an improved version of OpenSimulator and Imprudence, a vision of better virtual worlds. We have a few pages talking about it. Check out:</p>
10<p>In reverse alphabetical order to enhance your reading pleasure.</p>
11<ul>
12<li><a href="SledjHamr.html">SledjHamr</a> Tearing down the garden walls.</li>
13<li><a href="OMG-WTF-BBQ.html">OMG WTF BBQ</a> A means of making UUIDs location-agnostic.</li>
14<li><a href="NGIW.html">NGIW</a> REST as the simulation data server?</li>
15<li><a href="NGIW.Commands.html">NGIW.Commands</a> In the NGIW/REST world, how do I touch an object, or send it some other kind of message?</li>
16<li><a href="Nails.html">Nails</a> How to put it all together.</li>
17<li><a href="LuaSL-New-scripting-engine.html">LuaSL New scripting engine</a>
18<ul>
19<li><a href="LSL-functions-implemented.html">LSL functions implemented</a></li>
20</ul>
21</li>
22<li><a href="InworldAnimationEditor.html">InworldAnimationEditor</a> I dream of mixing qavimator into the client.</li>
23<li><a href="Grid-data-flow.html">Grid data flow</a> Documenting the flow of data through an OpenSim system, so we can replace it.</li>
24<li><a href="Croquet-integration.html">Croquet integration</a></li>
25<li><a href="ClientHamr.html">ClientHamr</a> How to rip code out of the client and make it better.</li>
26<li><a href="BVJ.html">BVJ</a> New and improved animations, with extra attachment points included.</li>
27<li><a href="BlackListAssetServersTracker.html">BlackListAssetServersTracker</a> Might be cool if you could accept/reject asset servers. For copyright control or to avoid seeing yucky stuff.</li>
28</ul>
29<p>We have a code repo on github now - <a href="https://github.com/onefang/SledjHamr">https://github.com/onefang/SledjHamr</a> with just a small README that points to this page. We can finally start writing code.</p>
30</body>
31</html>