<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet href="http://duncan-cragg.org/css/atom.css" type="text/css" ?>
<!-- Copyright (c) 2006 Duncan Cragg -->

<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
    <id>http://duncan-cragg.org/blog/</id>
    <title>What Not How - Posts tagged 'metaverse'</title>
    <subtitle>Duncan Cragg on Declarative Architectures</subtitle>
    <author><name>Duncan Cragg</name></author>
    <logo>/favicon.gif</logo>
    <icon>/favicon.ico</icon>
    <rights>All content including photos and images by Duncan Cragg. Copyright (c) Duncan Cragg, your rights preserved: see /CXL.html</rights>
    <generator uri="http://www.djangoproject.com">A Django Production.</generator>
    <link rel="alternate" type="text/html" href="http://duncan-cragg.org/blog/" title="What Not How" />
    <link rel="self" type="application/atom+xml" href="http://duncan-cragg.org/blog/atom/metaverse/" />

    <updated>2008-07-18T19:49:00Z</updated>


    <entry>
        <id>http://duncan-cragg.org/blog/post/universe-web/</id>
        <title>The Universe Web</title>
        <published>2008-07-18T19:49:00Z</published>
        
        <updated>2008-07-18T19:49:00Z</updated>
        
        <link rel="alternate" type="text/html" href="http://duncan-cragg.org/blog/post/universe-web/" title="The Universe Web" />
        
        <category term="cyberspace" />
        
        <category term="architecture" />
        
        <category term="declarative" />
        
        <category term="socialsoftware" />
        
        <category term="publishsubscribe" />
        
        <category term="p2p" />
        
        <category term="rest" />
        
        <category term="scalability" />
        
        <category term="json" />
        
        <category term="metaverse" />
        
        <summary type="xhtml">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>

Since the 
<a href="http://www.virtualworldsnews.com/2008/07/ibm-and-linden.html">announcement</a>
by 
<a href="http://www.ibm.com/virtualworlds/index.shtml">IBM</a>
and
<a href="http://lindenlab.com/">Linden Lab</a>
that
<a href="http://opensimulator.org/wiki/Main_Page">OpenSim</a>
can talk to 
<a href="http://secondlifegrid.net/">Second Life</a>,
I&#39;ve been thinking again about RESTful Virtual Reality.
</p><p>
I&#39;m not the first, of course. Others have been motivated by the same
goal: To bring the Web&#39;s scalability, linkability and interoperability
into Virtual World platforms.
</p><p>
Ultimately, how to use the same techniques as the Web to link
Virtual Worlds together into a single, massive &#39;Virtual Universe&#39;.
</p><p>
Here&#39;s how I would architect the Universe Web...
 &#160; ...
</p>

            </div>
        </summary>
        <content type="xhtml" xml:space="preserve">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>
</p><div class="summary"><p>
Since the 
<a href="http://www.virtualworldsnews.com/2008/07/ibm-and-linden.html">announcement</a>
by 
<a href="http://www.ibm.com/virtualworlds/index.shtml">IBM</a>
and
<a href="http://lindenlab.com/">Linden Lab</a>
that
<a href="http://opensimulator.org/wiki/Main_Page">OpenSim</a>
can talk to 
<a href="http://secondlifegrid.net/">Second Life</a>,
I&#39;ve been thinking again about RESTful Virtual Reality.
</p><p>
I&#39;m not the first, of course. Others have been motivated by the same
goal: To bring the Web&#39;s scalability, linkability and interoperability
into Virtual World platforms.
</p><p>
Ultimately, how to use the same techniques as the Web to link
Virtual Worlds together into a single, massive &#39;Virtual Universe&#39;.
</p><p>
Here&#39;s how I would architect the Universe Web...
</p></div><p>
<b>Entities</b>
</p><p>
The Universe Web needs Entities. (I&#39;m going to be capitalising
Significant Things a lot here to help the Web comparison - hope you
don&#39;t mind). There&#39;s no need to make the Entity list too complicated
since we&#39;re not doing online games yet - just a world like Second Life.
</p><p>
Here&#39;s a list of different kinds of Entity:
</p><ul>
<li>   Places: buildings, streets, hills, lakes</li>
<li>   Things: trees, books, birds, clocks</li>
<li>   People</li>
</ul><p>
</p><p>&#160;</p><p>
<b>State, Links and animation</b>
</p><p>
Entities aren&#39;t exactly the Objects of Object-Oriented programming:
they have lots of public State. In a Virtual World, you can directly
experience their colour, position, orientation, physical relation to
each other, etc., thanks to the local render engine.
</p><p>
The basic structure of the Universe Web is made up of Linked
Entities. A tree is Linked to its ground which is Linked to a
building which is Linked to its occupants which are Linked to their
clothing. Kneebones may even be Linked to thighbones.
</p><p>
Entities are often animated. Actually, Places are generally static,
and People generally animate themselves. So, when talking in general,
we should look at the animation of Things, like trees, books, birds
and clocks.
</p><p>
There are two ways an Entity&#39;s animation can be guided: by Laws and
by Rules.
</p><p>&#160;</p><p>
<b>Laws</b>
</p><p>
Springiness is a handy Law. For example, tree branches, pages in a
book and birds&#39; wings and legs can all have springiness. We can
declare a mid-air location in a bird&#39;s State and a springiness in
its legs, then if the bird lands on a branch, the springiness can
trigger the bird and branch waving gently to a halt.
</p><p>
We could even allow a single bird to become part of a flock Entity,
where the flock only knows how many birds it has and the coordinates
of its centre. Each bird will then be animated by global flock Laws.
</p><p>
The book can have a State of open or closed. If bookness was
elevated to a global Law, then a book deciding that its State was
now simply closed could trigger the elaborate, springy closing of
its pages with a nice &#39;shlump&#39; sound at the end.
</p><p>
The clock&#39;s current time may be set by the clock Entity itself, then
the Law of time take over in between the clock updating its own time
directly.
</p><p>
A Law can be invoked over an Entity&#39;s animation by simply adding the
Law&#39;s name and parameters to its State. Such Laws can be handled by
the physics engine in the same way surface texture is handled by the
render engine: States such as &#39;red&#39; need global meaning, Law
applications such as &#39;springy&#39; need global meaning.
</p><p>&#160;</p><p>
<b>Rules</b>
</p><p>
When a clock reaches its alarm time, it rings.  When its wizard
master approaches, a magic book may glow and open.  Birds fly away
from danger (if a fox is too close, fly away from it). In between
danger, birds and foxes look for food (if a bird is close, run
towards it). 
</p><p>
These are Rules.  Rules are driven by the Observation of one Entity
by another. The fox Observes the bird, the book Observes the wizard.
Rules apply to Entity types: fox Rules, bird Rules, book Rules, etc. 
Rules can guide the animation of an Entity by evolving its State.
</p><p>
State evolution depends on the current State plus the States of the
Observed Entities: Rules make an Entity change from one State to the
next by taking the Entity&#39;s own State, Observing the States of the
Entities around that it cares about, then deciding what the next,
new State should be.  If an Entity changes State, those Entities
Observing it may themselves change State according to their own
Rules, and so-on.
</p><p>
Links are part of an Entity&#39;s State, and Links may therefore change
on the application of Rules. In other words, the virtual world may
restructure when a Rule is run.
</p><p>
An Entity may either Observe another Entity, or Link to it, or both.
An Entity that Links to another needn&#39;t Observe it. Trees don&#39;t
bother to Observe the ground they grow from. Conversely, an Entity
that Observes another needn&#39;t Link to it. A fox would only Link to a
bird if she was lucky enough to catch it. Meanwhile, it is true that
there&#39;s probably a <i>chain</i> of Links to everything that&#39;s Observed.
</p><p>
Unlike Laws, Rules can&#39;t or shouldn&#39;t be second-guessed, so have to
be run &#39;at source&#39; or &#39;inside the Entity&#39;, then the new State
distributed to both the Observing Entities and to all the render
engines.
</p><p>
But render engines are actually Observing People Entities..
</p><p>&#160;</p><p>
<b>People are First Class</b>
</p><p>
In Virtual Worlds, we have People avatars: People are first class
Entities.  People can Observe and can change State, but it&#39;s a real
user doing the animation, not a set of Rules. Observation and State
change by a Person is implemented through the render engine.
</p><p>
Although self-animated, People can still make use of Laws. For
example Laws can be invoked to allow gestures to be easier to make
and to look better, and to allow People to &#39;run forward&#39; rather than
putting their &#39;left foot forward, ..&#39;.  Avatar skills become global
Laws which can be triggered by an avatar&#39;s State animated by a user.
</p><p>&#160;</p><p>
<b>The Universe Wide Web</b>
</p><p>
The Universe Web I&#39;ve just described is a lot like the World Wide Web:
</p><ul>
<li>   An Entity is like a Web Resource</li>
<li>   The State of an Entity is like an HTML Web Representation of a Web Resource</li>
<li>   A Link in an Entity&#39;s State is like a Web URL inside an HTML Web Representation</li>
<li>   Laws are like Javascript, Flash, link hover, blink tags and animated GIFs</li>
<li>   Rule sets are like PHP scripts or Java servers</li>
<li>   A State Observation is like a Web Representation Transfer</li>
</ul><p>
A crucial difference between the Resource Web and the Entity Web is
that, here <i>it&#39;s another Entity doing the Observation</i>.  One
Entity transfers its State to another. 
</p><p>
It&#39;s as if the GET or POST has another Entity &#39;at the client end&#39;.
GET is like an Entity subscribing or Observing; POST is like an
Entity publishing or notifying its State to another (an HTML form
has a content type, too).
</p><p>
People are just examples of that Entity &#39;at the client end&#39;.
Instead of a user hidden behind a client browser, we have
first-class People Entities doing &#39;GET&#39;s and &#39;POST&#39;s: Observing
the Virtual World and acting (i.e., changing State) within it.
Other examples are foxes and clocks.
</p><p>&#160;</p><p>
<b>Notation and Protocol</b>
</p><p>
There are two open standards we need to have in progress while
implementing the Universe Web: the notation and the protocol (our
HTML/URI and HTTP).
</p><p>
Firstly, we have to define the notation for Entities and their
Rules. Both the State of Entities and the Rules that animate them
will be written in the same notation: a Rule talks directly about
State. To me, basing that on JSON (rather than XML) is a clear
choice. Add inter-JSON Entity Links (essentially UUIDs), then work
out a simple JSON Rule language. We will then need to define JSON
&#39;schemas&#39; for the kinds of Entity we would model. These can be
written in the Rule language itself.
</p><p>
Secondly, to define the protocol for Entities to Observe or
subscribe to one another. It will be a &#39;symmetric, asynchronous
HTTP&#39; - a Peer-to-Peer, Publish-Subscribe protocol. UDP and
Multicast stand out for this kind of interaction. A packet will
subscribe, a packet will return current State, a subsequent packet
will multicast State updates. We can re-use all the HTTP cache
headers, only now we can push updates into caches and into render
programs. Packets will inevitably end up tunnelled through TCP and
HTTP, mind...
</p><p>
This lighter notation, which also breaks the data up into smaller
pieces, and this multicast pushing of State change into caches, along
with P2P-style operation, will mean the Universe Web scales even
better than its parent. 
</p><p>
Also, programming declaratively using Rules is both highly
productive and further cleanly scalable through parallel processing. 
</p><p>
Of course, it will be pretty trivial to allow inter-Web cross-over
such as referring to PNG texture images via URL and pulling Universe
Web Entities into a Javascript application that subscribes to them
via Comet.
</p><p>&#160;</p><p>
</p><p>
<b>Building the Universe Web</b>
</p><p>
So that&#39;s my Universe Web. It&#39;s basically the same as the World Wide
Web and thus as scalable, linkable and interoperable. It comes with
added symmetry: Entities, including People as avatars, exchange
State in each direction.
</p><p>
It&#39;s a two-way data Web, not a one-way document Web.
</p><p>
I&#39;ve started work on the Universe Web: the notation, the protocol
and the implementation (in C, for portability across platforms,
including mobile).  Contact me if you want to help!
</p><p>

</p>

            </div>
        </content>
    </entry>
    
</feed>

