Subject: [ogpx] Decoupling simulation services from land for VWRAP scalability

From: Morgaine <[email-masked]>
Date: Thu, 11 Mar 2010 18:33:41 +0000

After a very interesting presentation on the
MXP<http://www.bubblecloud.org/>protocol given to us by Ben Lindquist
/ Arkowitz Jonson in-world in Second
Life yesterday, we were discussing in the AW Groupies IM channel how
simulations in VWRAP-compatible worlds might be made more scalable.
Intriguing MXP'ish ideas kept appearing in the discussion, as I'll describe.

VWRAP has *decoupling of services* at its core.  This gives it the
flexibility to offer multiple deployment patterns, as well as the
scalability that stems from distributing load across multiple remote
services instead of centralization.  Unfortunately, so far most VWRAP
discussion has implicitly held to an SL-like region model in which *land
service* is tightly coupled to *simulation service*, which has a negative
impact on the scalability of regions.  In the worst case scenario that we
have today, regions are completely non-scalable over the number of
*actors*in the region, because region simulators are monolithic in
their current
implementation.  There has to be a better way.

(I'm using "*actor*" to mean anything that is subject to physical
simulation, hence mainly agent/avatars and in-world objects.)

MXP has "perfect scalability" proportional to the number of actors in a
region, because it has no centralized simulation.  Instead it employs the
notion of "participants" that each do their own simulation locally, plus
central "hubs" which reflect or replicate the contribution of each
participant to all other participants in the shared space.  It should be
noted that while MXP's hubs are conceptually a shared resource, they are
stateless and hence present no practical barrier to achieving high
scalability in the simulation.  (Limits to actual scaling imposed by network
bandwidth continue to apply of course.)

Although MXP's local participant simulation is hugely scalable in this way,
it clearly lacks an essential ingredient that we have come to expect of VWs,
namely environmental simulation / physics in the shared space.

Our AW Groupies discussion led rather naturally to service decoupling.  Why
not make *simulation* a VWRAP service as well, and decouple it from the
region's *land* service?  This could open up a number of opportunities for
more scalable deployments.

If simulation were a VWRAP service, we could split simulation into two
parts, independently scalable:

   - *Actor simulation service* which allows each actor to simulate its
   internal state.  This actor simulation could be running on a supercomputer
   cluster for scientific research applications, or on an agent's PC to
   simulate the avatar's mannerisms or dance (*agent actor*), or on a world
   provider's machinery for persistent in-world behaviour (*object actor*).
   A flexible region would typically provide access to at least two actor
   simulation services, one for agent actors and one for object actors.  The
   choice of where the actor simulations run would be a matter of world
   deployment policy and user selection.  This correlates quite well with the
   MXP notion of "participants".

   - *Environment simulation service* which handles simulation of the
   environment in the shared space.  This is most concerned with physical
   simulation in traditional regions that emulate the real world, and deals
   only with the bounding box and centre of gravity of actors, *NOT with
   their inner actor simulations*.  Non-physical types of environment
   simulations would also fit in this category --- for example
*magic*simulation might well be very popular in some types of virtual
world.  Since
   this simulation is performed as a service, it doesn't need to run as an
   integral part of a VWRAP region, but instead could be performed externally
   in a distributed manner if higher scalability is required --- that would be
   a deployment choice.

Being independently scalable, these two service types (three actual
services) would no longer be restricted by the resources available within
the region.  *Agent actor simulation* would scale perfectly 1:1 with the
number of online clients, *object actor simulation* would scale in whatever
manner the chosen object service provides, and the scalability of *environment
simulation* would depend on the deployment pattern and services chosen by
the region provider.

It's worth noting that Second Life and Opensim already have a slight hint of
an *agent actor simulation service* --- they call it animation! :-)  This is
a terribly limited facility though, being based on replay of pre-packaged
pose and animation files.  Replacing animation by local simulation reflected
by the region (with animation as a subset) would open up the doors for
hugely more powerful types of expression using the full local power of
multiple cores as well as OpenCL.  Noteworthy projects such as the IEEE's AI
Learning Center <http://ailc.agstechnet.com/>and many others in education
would benefit greatly, as would accessibility work and "bots" in general.

On the *object actor simulation* front, opening up object simulation as a
service would remove the need for regions to run their own object simulation
/ scripting infrastructure.  It would also remove the constraints imposed by
regions running a standard beginner-friendly object simulation service
alone, so scientific, industrial and educational simulation would benefit
greatly.  It is worth mentioning that Opensim provides a range of
alternative scripting / programming systems, including MRM Script, MRM
Loader and Region
Modules<http://maimedleech.com/2009/05/12/opensim-programmability/>which
can take object actor simulation into very ambitious territory.

Factoring out simulation from land services would allow advances on all
these fronts, independent of advances in region technology.

Morgaine.

---

From: Carlo Wood <[email-masked]>
Date: Mon, 22 Mar 2010 15:57:50 +0100

It is possible to move "policy" (like 'have to follow the rules of physics')
to the viewers, and enforce it based on statistics: Assume that most viewers
are the official implementation and react predictably, and simply let
the viewers 'vote' to establish who is breaking that policy.

For example, 6 avatars are in a room. 5 run approved viewers, one is using
a rogue viewer. The one with the rogue viewer walks through a wall. The
other 5 detect this and (automatically) inform the server that this viewer
broke the accepted policy. The server bans the rogue viewer. That leading
by itself to keeping the number of rogue viewers small and hence the
system working.

On Thu, Mar 11, 2010 at 06:33:41PM +0000, Morgaine wrote:
> MXP has "perfect scalability" proportional to the number of actors in a region,
> because it has no centralized simulation.  Instead it employs the notion of
> "participants" that each do their own simulation locally, plus central "hubs"
> which reflect or replicate the contribution of each participant to all other
> participants in the shared space.
>
> It should be noted that while MXP's hubs are
> conceptually a shared resource, they are stateless and hence present no
> practical barrier to achieving high scalability in the simulation.  (Limits to
> actual scaling imposed by network bandwidth continue to apply of course.)
> 
> Although MXP's local participant simulation is hugely scalable in this way, it
> clearly lacks an essential ingredient that we have come to expect of VWs,

-- 
Carlo Wood <[email-masked]>

---

From: Morgaine <[email-masked]>
Date: Mon, 22 Mar 2010 17:13:15 +0000

Indeed Carlo, although your scenario of rogue viewer breaking the laws of
physics doesn't arise in my proposed decoupling of simulation services,
because only the *AGENT simulation* is performed by the *agent* locally ---
for example, control of mannerisms, emotes and in general anything that
doesn't affect the physics of the region.

The *ENVIRONMENT simulation* is a service chosen by the *region*, not by the
agent, so a rogue viewer cannot break the laws of physics --- the position
and bounding box of the agent in the region are still controlled by the
region, even if the region chooses the region simulation to run in an
external simulation service.

It's quite easy to express the current SL and Opensim pose and animation
mechanism as a simple example of an agent simulation service --- they work
in exactly the required way already, decoupled from the region simulation.
However, they currently operate in "batch mode", controlled by sending
pre-packaged animation files to all participants.

The next step for *agent simulation* beyond sending pose and animation files
is to define a range of parametrized agent actions which the agent can
perform on agent state, and let the region notify other participants in the
vicinity when they occur.  This doesn't impact on the physics simulation at
all.

The best thing about all this is that the VWRAP protocol wouldn't have to
know any of the details of agent simulation --- it would merely provide a
way for the region to gain access to the agent's agent simulation, ie.
obtain a cap for it.  Once the region has the cap, it can then proxy the
state of the agent simulation transparently to other participants.

It's worth mentioning that this is backwards compatible with the current
pose and animation system, making it very easy to implement an agent
simulation service in practice.  From there it is a small step to
fine-grained agent simulation, a major boon to the machinima community, and
a great leap for expressivity in virtual worlds.

Morgaine.

=================================

On Mon, Mar 22, 2010 at 2:57 PM, Carlo Wood <[email-masked]> wrote:

> region,