Putting it all together

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

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

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

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

 

command pump

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

 

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

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

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

 

sim data store

Stores objects and their data that are in the sim. Again, it's a web server, but completely public. Though just like ordinary web servers, parts could be private to members only. Most of what was said about inventory data stores applies. There is a change of emphasis though, these would be public in general, with privacy an option, where inventory is private in general, with public being an option. Note that objects and other assets that are contents of a sim object should not be public by default, perhaps they could be handled by inventory data stores. Inventory data stores could be very simple data stores, with 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.

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

 

physics engine

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

 

script engine

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

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

 

viewer

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

 

command pump

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

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

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

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

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

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

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

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

 

command channels and language

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

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

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

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

 

propagating language changes

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

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

1) all is good, hopefully the usual thing.

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

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

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

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

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

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

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

 

Command language

llSetPrimitiveParams() is the model I want to follow.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The environment is not changed quickly.

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

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

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

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

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

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

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

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

 

Prim commands.

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

llSetPrimMediaParams(face, list)

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

llParticleSystem(list)

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


llCreateLink(key boolean)

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

Stuff to do with the playing of sound clips.

 

Parcel commands.

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

 

Sim commands.

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

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

Name, description, owner, group.

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

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

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

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

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

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

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

Audio and media are now handled differently anyway.

Access is now controlled by the usual web methods.

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

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

Restarting sims, disabling scripts, collisions, and physics.

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

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

Sim sun stuff should be handled by the windlight commands.

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

Allow direct teleport is now part of access controls.

Covenant is just the sites ToS.

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

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

 

Windlight commands.

 

Avatar commands.

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

 

Animation commands.

Alice is working on that over at the BVJ page.

 

Meta commands.

0 SELECT_OBJECT key

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

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

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

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

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

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

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

 

The big arsed command table

decimalhexbinaryASCIIcommandargumentscomments
0 00 0000 0000 NULL SELECT key Next commands refer to this object.
1 01 0000 0001 SOH PRIM_TYPE_LEGACY BOX vector float float vector vector  
2 02 0000 0010 STX PRIM_MATERIAL (STONE) integer:3 OK, the cleanest way to deal with this conflicting with the BSON commands is to have it as just one command. sigh
3 03 0000 0011 ETX PRIM_PHYSICS off    
4 04 0000 0100 EOT PRIM_TEMP_ON_REZ off    
5 05 0000 0101 ENQ PRIM_PHANTOM off    
6 06 0000 0110 ACK PRIM_POSITION vector  
7 07 0000 0111 BEL PRIM_SIZE vector  
8 08 0000 1000 BS PRIM_ROTATION rotation  
9 09 0000 1001 TAB PRIM_TYPE BOX integer:2 vector float vector vector vector  
10 0A 0000 1010 LF      
11 0B 0000 1011 VT      
12 0C 0000 1100 FF      
13 0D 0000 1101 CR      
14 0E 0000 1110 SO      
15 0F 0000 1111 SI      
16 10 0001 0000 DLE      
17 11 0001 0001 DC1 PRIM_TEXTURE face string/key vector vector float  
18 12 0001 0010 DC2 PRIM_COLOUR face (vector float)=colour  
19 13 0001 0011 DC3 PRIM_BUMP_SHINY PRIM_SHINY_NONE face integer:5  
20 14 0001 0100 DC4 PRIM_FULLBRIGHT off face  
21 15 0001 0101 NAK PRIM_FLEXIBLE off    
22 16 0001 0110 SYN PRIM_TEXGEN PRIM_TEXGEN_DEFAULT face  
23 17 0001 0111 ETB PRIM_POINT_LIGHT off    
24 18 0001 1000 CAN PRIM_CAST_SHADOWS off    
25 19 0001 1001 EM PRIM_GLOW face float  
26 1A 0001 1010 SUB PRIM_TEXT string (vector float)=colour  
27 1B 0001 1011 ESC PRIM_NAME string  
28 1C 0001 1100 FS PRIM_DESC string  
29 1D 0001 1101 GS PRIM_ROT_LOCAL rotation  
30 1E 0001 1110 RS PRIM_POS_LOCAL vector This is just my guess about where LL will put it.
31 1F 0001 1111 US      
32 20 0010 0000 SPACE PRIM_OMEGA vector float float  
33 21 0010 0001  ! PRIM_TYPE_LEGACY CYLINDER vector float float vector vector  
34 22 0010 0010 " (PRIM_MATERIAL METAL)    
35 23 0010 0011 #      
36 24 0010 0100 $      
37 25 0010 0101  %      
38 26 0010 0110 &      
39 27 0010 0111 '      
40 28 0010 1000 (      
41 29 0010 1001 ) PRIM_TYPE CYLINDER integer:2 vector float vector vector vector  
42 2A 0010 1010 *      
43 2B 0010 1011 +      
44 2C 0010 1100 ,      
45 2D 0010 1101 -      
46 2E 0010 1110 .      
47 2F 0010 1111 /      
48 30 0011 0000 0      
49 31 0011 0001 1      
50 32 0011 0010 2      
51 33 0011 0011 3      
52 34 0011 0100 4      
53 35 0011 0101 5      
54 36 0011 0110 6      
55 37 0011 0111 7      
56 38 0011 1000 8      
57 39 0011 1001 9      
58 3A 0011 1010  :      
59 3B 0011 1011  ;      
60 3C 0011 1100 <      
61 3D 0011 1101 =      
62 3E 0011 1110 >      
63 3F 0011 1111  ?      
64 40 0100 0000 @      
65 41 0100 0001 A PRIM_TYPE_LEGACY PRISM vector float float vector vector  
66 42 0100 0010 B BSON   Switch to BSON mode. (Conflicts with PRIM_MATERIAL GLASS)
67 43 0100 0011 C      
68 44 0100 0100 D      
69 45 0100 0101 E EWWW   Switch to XML mode, as used by OpenSim in IAR and OAR backup files.
70 46 0100 0110 F FUCK   Switch to two, four byte command mode; with three, four bytes of object ID.
71 47 0100 0111 G      
72 48 0100 1000 H      
73 49 0100 1001 I PRIM_TYPE PRISM integer:2 vector float vector vector vector  
74 4A 0100 1010 J JSON   Switch to JSON mode.
75 4B 0100 1011 K      
76 4C 0100 1100 L  LUA    Switch to Lua mode.
77 4D 0100 1101 M MRTX   Switch to matrix-RAD mode.
78 4E 0100 1110 N      
79 4F 0100 1111 O      
80 50 0101 0000 P      
81 51 0101 0001 Q      
82 52 0101 0010 R      
83 53 0101 0011 S PRIM_BUMP_SHINY PRIM_SHINY_LOW face integer:5  
84 54 0101 0100 T TITE   Switch back to the tight binary mode that is the sane default. B-)
85 55 0101 0101 U      
86 56 0101 0110 V      
87 57 0101 0111 W      
88 58 0101 1000 X      
89 59 0101 1001 Y      
90 5A 0101 1010 Z      
91 5B 0101 1011 [      
92 5C 0101 1100 \      
93 5D 0101 1101 ]      
94 5E 0101 1110 ^      
95 5F 0101 1111 _      
96 60 0110 0000 `      
97 61 0110 0001 a PRIM_TYPE_LEGACY SPHERE vector float vector  
98 62 0110 0010 b bson   Switch to BSON mode. (Conflicts with PRIM_MATERIAL WOOD)
99 63 0110 0011 c      
100 64 0110 0100 d      
101 65 0110 0101 e ewww   Switch to XML mode, as used by OpenSim in IAR and OAR backup files.
102 66 0110 0110 f fuck   Switch to two, four byte command mode; with three, four bytes of object ID.
103 67 0110 0111 g      
104 68 0110 1000 h      
105 69 0110 1001 i PRIM_TYPE SPHERE integer:2 vector float vector vector  
106 6A 0110 1010 j json   Switch to JSON mode.
107 6B 0110 1011 k      
108 6C 0110 1100 l  lua    Switch to Lua mode.
109 6D 0110 1101 m mrtx   Switch to matrix-RAD mode.
110 6E 0110 1110 n      
111 6F 0110 1111 o      
112 70 0111 0000 p      
113 71 0111 0001 q      
114 72 0111 0010 r      
115 73 0111 0011 s      
116 74 0111 0100 t tite   Switch back to the tight binary mode that is the sane default. B-)
117 75 0111 0101 u      
118 76 0111 0110 v      
119 77 0111 0111 w      
120 78 0111 1000 x      
121 79 0111 1001 y      
122 7A 0111 1010 z      
123 7B 0111 1011 {      
124 7C 0111 1100 |      
125 7D 0111 1101 }      
126 7E 0111 1110 ~      
127 7F 0111 1111 DEL      
128 80 1000 0000      
129 81 1000 0001  PRIM_TYPE_LEGACY TORUS vector float float float vector vector  
130 82 1000 0010 (PRIM_MATERIAL FLESH)    
131 83 1000 0011 ƒ PRIM_PHYSICS on    
132 84 1000 0100 PRIM_TEMP_ON_REZ on    
133 85 1000 0101 PRIM_PHANTOM on    
134 86 1000 0110 PRIM_TEXGEN PRIM_TEXGEN_PLANAR face  
135 87 1000 0111      
136 88 1000 1000 ˆ      
137 89 1000 1001 PRIM_TYPE TORUS integer:2 vector float vector vector vector vector vector float float float  
138 8A 1000 1010 Š      
139 8B 1000 1011      
140 8C 1000 1100 Œ      
141 8D 1000 1101       
142 8E 1000 1110 Ž      
143 8F 1000 1111       
144 90 1001 0000       
145 91 1001 0001      
146 92 1001 0010      
147 93 1001 0011 PRIM_BUMP_SHINY PRIM_SHINY_MEDIUM face integer:5  
148 94 1001 0100 PRIM_FULLBRIGHT on face  
149 95 1001 0101 PRIM_FLEXIBLE on integer float float float float vector  
150 96 1001 0110      
151 97 1001 0111   PRIM_POINT_LIGHT on (vector)=colour float float float  
152 98 1001 1000   PRIM_CAST_SHADOWS on    
153 99 1001 1001        
154 9A 1001 1010        
155 9B 1001 1011        
156 9C 1001 1100        
157 9D 1001 1101        
158 9E 1001 1110        
159 9F 1001 1111        
160 A0 1010 0000        
161 A1 1010 0001   PRIM_TYPE_LEGACY TUBE vector float float float  
162 A2 1010 0010   (PRIM_MATERIAL PLASTIC)    
163 A3 1010 0011        
164 A4 1010 0100        
165 A5 1010 0101        
166 A6 1010 0110        
167 A7 1010 0111        
168 A8 1010 1000        
169 A9 1010 1001   PRIM_TYPE TUBE integer:2 vector float vector vector vector vector vector float float float  
170 AA 1010 1010        
171 AB 1010 1011        
172 AC 1010 1100        
173 AD 1010 1101        
174 AE 1010 1110        
175 AF 1010 1111        
176 B0 1011 0000        
177 B1 1011 0001        
178 B2 1011 0010        
179 B3 1011 0011        
180 B4 1011 0100        
181 B5 1011 0101        
182 B6 1011 0110        
183 B7 1011 0111        
184 B8 1011 1000        
185 B9 1011 1001        
186 BA 1011 1010        
187 BB 1011 1011        
188 BC 1011 1100        
189 BD 1011 1101        
190 BE 1011 1110        
191 BF 1011 1111        
192 C0 1100 0000        
193 C1 1100 0001        
194 C2 1100 0010   (PRIM_MATERIAL RUBBER)    
195 C3 1100 0011        
196 C4 1100 0100        
197 C5 1100 0101        
198 C6 1100 0110        
199 C7 1100 0111        
200 C8 1100 1000        
201 C9 1100 1001   PRIM_TYPE RING integer:2 vector float vector vector vector vector vector float float float  
202 CA 1100 1010        
203 CB 1100 1011        
204 CC 1100 1100        
205 CD 1100 1101        
206 CE 1100 1110        
207 CF 1100 1111        
208 D0 1101 0000        
209 D1 1101 0001        
210 D2 1101 0010        
211 D3 1101 0011   PRIM_BUMP_SHINY PRIM_SHINY_HIGH face integer:5  
212 D4 1101 0100        
213 D5 1101 0101        
214 D6 1101 0110        
215 D7 1101 0111        
216 D8 1101 1000        
217 D9 1101 1001        
218 DA 1101 1010        
219 DB 1101 1011        
220 DC 1101 1100        
221 DD 1101 1101        
222 DE 1101 1110        
223 DF 1101 1111        
224 E0 1110 0000        
225 E1 1110 0001        
226 E2 1110 0010   (PRIM_MATERIAL LIGHT)   Deprecated: Looks the same as [ PRIM_FULLBRIGHT, ALL_SIDES, TRUE ]
227 E3 1110 0011        
228 E4 1110 0100        
229 E5 1110 0101        
230 E6 1110 0110        
231 E7 1110 0111        
232 E8 1110 1000        
233 E9 1110 1001   PRIM_TYPE SCULPT string/key integer:8  
234 EA 1110 1010        
235 EB 1110 1011        
236 EC 1110 1100        
237 ED 1110 1101        
238 EE 1110 1110        
239 EF 1110 1111        
240 F0 1111 0000        
241 F1 1111 0001        
242 F2 1111 0010        
243 F3 1111 0011        
244 F4 1111 0100        
245 F5 1111 0101        
246 F6 1111 0110        
247 F7 1111 0111        
248 F8 1111 1000        
249 F9 1111 1001        
250 FA 1111 1010        
251 FB 1111 1011        
252 FC 1111 1100        
253 FD 1111 1101        
254 FE 1111 1110        
255 FF 1111 1111        


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