• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-350
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Unassigned
Reporter: Qarl Linden
Votes: 18
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

create new "extra prim parameter" type for open-source (outside LL) use.

Created: 22/Jun/07 11:17 AM   Updated: 09/Jun/09 05:46 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Issue Links:
Relates
 

Linden Lab Issue ID: SL-46105


 Description  « Hide
various user/open-source modifications to the second life viewer have proposed encoding data in a prim's description field in order to store state on prims. this is clearly a horrible hack, and a better mechanism should be provided.

this jira task requests that a new "extra prim parameter" type be created - one who's use is resident defined.

why?

currently this datablock is used to hold (among other things) the sculptie texture asset id. had this feature been available six months ago, resident developers would have been able to implement sculpties FOR THEMSELVES, had they wished.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Qarl Linden added a comment - 22/Jun/07 11:19 AM
and for an example usage - wouldn't it be cool if residents could apply their own grass texture to the prim grass? daisies or whatnot? (or wheat? heh.)

Qarl Linden added a comment - 22/Jun/07 11:21 AM
proposed implementation details:

datablock to have a 18 byte payload:

2-byte type identifier (with a corresponding registration table, so uses don't overlap.)
16-byte data field (big enough to hold a uuid - small enough to be a negligible bandwidth hit.)


Periapse Linden added a comment - 22/Jun/07 03:50 PM
Imported this feature request into the Linden internal JIRA.

Go ahead and comment on Qarl's proposed implementation, but hurry – I think he's gonna code this up soon.



Argent Stonecutter added a comment - 26/Jun/07 02:29 PM
I don't think it's general enough.

I would really like to see a general key-value attribute scheme for objects in SL. Virtually every one of its precursors - text-based virtual worlds like MUDs and MUCKs - have a mechanism to attach name-value attributes to objects.

The datablock would be a permission byte and two text strings, and would only be sent to the viewer if the viewer requests attributes with matching strings. Scripts would be able to read and write the strings in their own prim and in detected prims.

The permission byte would be composed of the following bits:

1 ANY_READ
2 ANY_WRITE
4 GROUP_READ
8 GROUP_WRITE
16 READ_PROTECT
32 WRITE_PROTECT
64 CLIENT_PROTECT

READ_PROTECT and WRITE_PROTECT mean that scripts outside the prim can not read or write the attribute.
CLIENT_PROTECT means that it isn't sent to the viewer.

This means that the default 0 permission should DTRT in most cases.

Since it would only be sent for attributes the viewer requests, the bandwidth overhead would be minimal.

This would solve so much else. There are so many OTHER places in SL where programs are forced to hide information in prim parameters or in live script data that gets lost on a reset that could be included in prim attributes. If this is going to be done, let it be done once.


Eddy Stryker added a comment - 26/Jun/07 02:58 PM
Qarl your proposal sounds perfect, my vote is to implement the extra 18 byte payload, but make sure it is sent as another block in the ObjectUpdate* family of packets and does not need an additional packet request like the description field.

Qarl Linden added a comment - 26/Jun/07 03:55 PM
Argent - heh. yes, that does sound nice - but i'm looking for something that is easily implementable and won't require 10 months of internal negotiation. (bureaucracy sucks.)

Qarl Linden added a comment - 26/Jun/07 03:56 PM
Eddy - i BELIEVE that's how extra-prim-params are implemented. but i don't have the code open right now.

Qarl Linden added a comment - 26/Jun/07 04:05 PM
Gigs - ah, NICE. yes, very similar, almost exactly the same.

my only comment is that the payload must be MUCH smaller and of fixed size. (size is now enforced on the simulator.)

an LSL interface to the raw data is a good idea... but what should the API look like? can't use a string - you might legitimately want nulls in the data. a list of integers? hm.


Jacek Antonelli added a comment - 26/Jun/07 10:57 PM
The 2+16 scheme sounds like a good start. (If bandwidth and storage weren't an issue, I'd love to see named key-value pairs a la HTML tag attributes. I dream of <prim type="torus" revolutions="3.0" my-custom-var="foo" />... and cascading prim styles... yummy. But I'm getting ahead of myself.)

Qarl: can you expand on your thoughts re: cases where it might be desirable to have nulls in the data? I need help seeing what you're seeing.

P.S. Thoughts on adding a new prim type which has many "extra" prim parameter slots, but no standard parameters? It would allow for testing the case where there are multiple parameters which combine in effect; testing each one individually wouldn't ensure that they work with each other correctly. (I'm thinking for example of the standard prim attributes, where each attribute controls one aspect of the final shape.)


Hypatia Callisto added a comment - 27/Jun/07 04:53 PM
oh, the ability to extend the grass and trees would rock my world

able whitman added a comment - 29/Jun/07 10:30 AM
I love the idea of an extensibility mechanism for prims! However, I think it would be even better if there was no need to maintain a centralized registry of 2-byte parameter identifiers.

To that end, I would suggest that instead of a 2-byte identifier, there be at least a 4-byte identifier, or even just add 2 16-byte fields; one for a UUID for the field identifier and one for the data field. UUIDs have a great advantage that they can be independently generated while still avoiding collisions, but even a 32-bit identifier would help (analagous to how scripts share a 32-bit space for channel numebers already). I know the ObjectUpdate (and related) messages are already rather large, but I think at least the additional 2-byte hit to have at least a 4-byte identifier would be worthwhile.

Also, I definitely agree with Eddy that the extra prim parameter should be included in the ObjectUpdate message, and not something that has to be requested asynchronously.


Qarl Linden added a comment - 29/Jun/07 12:10 PM
Jacek - regarding NULLs - when you use 3 bytes to encode a color, and you want to use black <0,0,0>.

Able - WAY too big of a payload for a UUID. the biggest extra-prim-parameter payload we currently have is 16 bytes, TOTAL. additional 2 bytes doesn't really buy us anything as we'd still need a registry... but perhaps. let me discuss over here. (honestly, if i had to choose, i'd ask for the 2 bytes as additional parameters - that way you can have 1 UUID and 2 byte parameters...)


Eddy Stryker added a comment - 02/Jul/07 12:54 PM
Correction: The biggest extra-prim-parameter is sculptie information at 17 bytes (UUID + type). Unless you are counting particle system data which is huge but also implemented differently. Anyways if this does go through it might be a good idea to elect the first byte as a type identifier and if people plan on using this, collaborate together on a wiki to reserve identifier numbers for different projects.

Gigs Taggart added a comment - 07/Jul/07 11:45 PM
Qarl, for a larger extensible API, it doesn't matter what the data is. Just give us something like 512 bytes variable with a two byte address and a two byte length tag and we'll add our own "application level" stuff on top of those.

Argent Stonecutter added a comment - 09/Jul/07 01:07 PM
sigh

Permanent non-volatile object attributes has been part of virtually EVERY "adventure" or "multi-user dungeon" environment since MDL in the '70s. It's something that LS really needs.

Ah well.

For this:

LSL interface: make it a set of primitive parameters:

PRIM_ATTRIBUTE_BINARY,integer id,string data
PRIM_ATTRIBUTE_STRING,integer id,string data
PRIM_ATTRIBUTE_VECTOR,integer id,vector data
...

The id is in the range -1 to 65535:

-1: conversion error... the attribute can't be represented as the requested type. The data part of the result is undefined.

0-65535: the two-byte ID of the attribute.

Otherwise: the two-byte ID

PRIM_ATTRIBUTE_BINARY would return or expect a URL-encoded string.


Gigs Taggart added a comment - 30/Sep/07 01:08 AM
URLencoding is pretty bloaty, couldn't we use base64?

Argent Stonecutter added a comment - 04/Aug/08 12:25 PM
I don't see any problem using any particular encoding. Make it "PRIM_ATTRIBUTE_BINARY would return or expect an encoded string (eg, base64 or URL-encoded)."

Contagious Republic added a comment - 26/Mar/09 08:57 PM - edited
We already have place we're not using, such as the UUID key spacers.

Normal sculptie: "a822ff2b-ff02-461d-b45d-dcd10a2de0c2"

Scultie flagged for modified clients not to be affected by LOD: "a822ff2b+ff02-461d-b45d-dcd10a2de0c2" (a - is now a +)

Sculptie flagged for modified client to use the otherwise wasted pixels for animation displacement maps, as well as the no-LOD trick too: "a822ff2b-ff02+461d-b45d-dcd10a2de0c2" (another - is a +)

Sculptie flagged for using all pixels as vertex for a plane sculpt map (x4 regular), in a modified client: "a822ff2b#ff02-461d-b45d-dcd10a2de0c2" (first - is a #)

Of course it would require LL to actually accept characters other than - in keys...

Also my favorite trick: Konan the barbarian has 7 healing potions, 3 genocide scrolls, a leather armor and a doomsword of doom: it is stored as a flexi type paremeters, but the prim that stores that info is not flexi so the prim is not deformed or anything. Pro: easy. Stable. Con: player may cheat if data is not somehow encrypted and has some kind of validity check.

Many client plugins/mods could coexist like that and be compatible provided they keep track of other existing plugins/mods thru a wikipage.

As for elaborate game data, you can make a script use a free DNS service such as http://www.everydns.com, or httpdb from w-hat.com for your arbitrary data. But for things like optional rendering settings, the ability to tweak the key without changing where it's pointing is priceless...


Qarl Linden added a comment - 30/Mar/09 01:04 PM
CR - we don't actually store/transmit those characters. a UUID is 128 bits, and every one is useful.

Strife Onizuka added a comment - 31/Mar/09 05:57 AM
Getting off topic...
Qarl:
Back in the days of old, the client included in the UI the ability to modify (and make) plants (trees and grass); course you couldn't do anything with it. Their individual description takes up something like 300 bytes each.

Plants I suspect were always intended to be one of the transferable assets but there was never much push to have them like there was for animations.

This project was probably rolled into the SpeedTree and put on permanent hold.


kimmie Loveless added a comment - 09/Jun/09 01:36 PM - edited
Quarl, instead of 2 bytes and 16bytes. Hw about 2 fields of 16 bytes? The first would actually be a key for identifying the extension, and the second being the data as already planned. You really never know how many 3rd party extensions might crop up. UUIDs are very easy to generate, and for this purpose, a database of the extension keys doesn't need to be maintained, it would be the responsibility of the extension makers to not reuse the same extension keys. As keys probably use a timebase as at least part of their generation. I don't think it's likely that duplicate keys would ever be generated.

Additionally, the extension data should be both writeable AND readable with ll(Set/Get)[Link]PrimitiveParamaters and readable with llGetObjectDetails. Allowing objects to

This layout would lend it self to permanant datastorage as well extensions, and be more easily extended in the future for more robust extension systems.

Could this be added to avatars, and their profiles as well? Separately?One to extend the avatars, one to extend the profiles. Obviously not changeable by script, but still readable by llGetObjectDetails.

Though, i would like to see much larger persistent data/prim parameters than that, i also realize the reason why not to do as such.

As a side note, anyone REALLY needing more persistent data, could store a notecard key as the data, and retrieve a notecard as their extra data. Thus solving most data needs. Even if you do have to make an extra request.