NOo00oo! We've begun the top-posting! Must not... submit to conformity... :)
I like the general direction of this line of thought. Although,
container formats are necessarily meta-data, and then it becomes a
concern how to factor things out; whether some attribute belongs in
asset meta-data, inventory, or an intermediate container file.
I would prefer to keep data and meta-data separated, so that you could
choose to reference an asset in the context of it's original
relationship to others, or you could address it's data in isolation. I
think that would handle your proposed drawbacks.
I would prefer to have dependencies outside the container format so
that clients don't need to parse a file of potentially arbitrary
complexity for just deps -- after all, everyone will need dependency
analysis.
The concept of inventory or file systems also comes into play here.
Let me make some definitions and try an example of my thinking in the
context of a whole pipeline:
Asset: dumb, static blob of data that represents a fragment of a whole
work of content
ex: texture, sound
Item: a collection of assets and functional information about how
assets relate to each other, that represents a re-usable, partial or
whole, work of content
ex: ogre material, Metaforik, MyHouse.item
note: Items are not strictly inventory because they contain shader
programs, spatial relationships, etc. -- they are _content_ unto
themselves
World: an arrangement of Items in space, with possibly non-uniform
ownership rights
ex: Joe's Plaza
Inventory: a relationship between Items used by humans to organize
data they have ownership of
ex: ".../my_identity/my_avatar/clothes/saturday_evening_wear/dancing_boots.item"
1. content creator creates WonderWorld locally in a private world.
Items are created by the creation-app and stored on disk. All URIs
within this private world are either of the form
file:///C/Content/WonderWorld/*, or relative to the path
file:///C/Content/WonderWorld/
* in a realXtend-like world, an "item" consists of one prim which acts
as a bounding-box for an ogre mesh (my.mesh), which in turn contains a
some ogre materials (my.material)
2. content creator publishes WonderWorld to his chosen CDN, in this
case the Cable Beach HTTP-based Asset Server at
http://example.com,
and clicks "publish"
3. publisher-app recursively parses all WonderWorld Items:
4. publisher-app creates a content hash of the item or asset, and
corresponding meta-data stub
4.1. publisher-app creates a rebased URI for each asset or sub-item by
prefacing all relative paths with
http://example.com/assets/, or
replacing all occurrences of file:///C/Content/WonderWorld/ with
http://example.com/assets/
4.2. publisher-app computes a dependency graph for each item or asset
based on it's traversal, and adds the fully qualified URIs of ALL
child assets to the meta-data stub for that asset
5. publisher-app computes LoD settings, including any down-sampled
images or meshes
5.1. publisher-app computes content hashes for all LoD assets, and
places the fully qualified URIs of ALL LoD assets to the meta-data
stub for that asset
6. publisher-app walks the list of items or assets and their
respective meta-data, and POSTs the binary, then meta-data to
http://example.com/assets
7. publisher-app "instantiates" the items within a given simulator
* in a realXtend-like world, this would mean the item describes a
target primitive and an associated Ogre mesh. the publisher creates
the prim in the region's primtable and sets it's RexObjectProperies to
point to "
http://example.com/assets/<HASH>" which is "my.mesh", which
depends on "my.material"
8. "instantiated" items within the world enter the "world inventory",
and thus enter the permission model for that world
9. client logs into the simulator and receives notice of an in-world
object and its associated URI-addressed assets
10. client peeks that the scheme is "http" and thus does an HTTP GET
on
http://example.com/assets/<HASH>/metadata
11. client decides an appropriate LoD, and downloads and caches ALL
dependent assets listed in the meta-data for that LoD; firing a
callback as the download progresses
* since dependencies are cumulative, recursive parsing of /metadata(s)
is not strictly required
* in a Ogre-like world, the .mesh file does mesh LoD internally, so
/metadata may not contain separate LoD assets
12. when an asset's MIME-type indicates it is a container file, a
container-parser parses the file in order to build the in-memory
representation required by the engine; including via cache look-ups in
the asset cache (by fully qualified asset URI)
* in a Ogre-like world, .mesh, .material, etc., are all container files
13. the renderer is notified of completed items or assets, which it
looks up in the asset cache by fully qualified URI; the fully decoded,
complete, and ready-to-use in-memory binary representation is returned
14. the user wishes to place a flower from his personal inventory
somewhere within WonderWorld, does a drag-and-drop operation to
accomplish this
15. client copies, using WebDAV, the flower item from
example.com/inventory/<identity>/fun_stuff/flower.item to
example.com/inventory/<WonderWorld>/dropped/
16. simulator receives notification of the new item, parses the
container format, and creates an in-memory object (similarly but less
involved than the client, since servers mostly propagate updates or do
collisions/physics)
...
One could argue that it is excessively rigid to have the publisher-app
hard-code absolute URIs, since it would be difficult for someone to
re-use content by downloading it, as he would have to manually rebase
all URIs when he publishes. However isn't that precisely the behavior
that content creators would want? A kind of low-level copy protection
that makes it easier to make new content (because you have the
un-rebased, unpublished Item files on your local PC) than to copy it
from a public server?
I find this discussion *immensely* productive, and am starting feel
that the way is getting clearer. :)
Cheers,