You are not logged in (login or register) Sitemap | Help!

The future of Virtual Reality is not server centric

The question of control

Edited by: Jani Pirkola


Second Life and Opensim use server centric model, which makes hosting expensive. Dan discusses how we are inevitably heading to more distributed virtual world simulations.

As presently conceived in Second Life and similar worlds, the server has eminent domain over all activities that occur "on" that server, similar to the way a website defines what a browser can do "on" that website. For instance, if Alice, wishes to chat with her friend Bob, and they are both on Charlie's sim (server), their conversation is mediated by Charlie's server. Why is this so? Primarily it has to do with the fact that Charlie's server is probably set up on a static IP address, whereas Alice and Bob are more likely running on home machines, behind a NAT and firewall. This seems to be a rather poor reason for such a limitation, however.

Alice and Bob could of course run other software such as AIM or Twitter, or engage in a Skype call. It would be nice if this sort of functionality were seamlessly integrated into the Metaverse, but today that isn't the case. The SL architecture has the sim as the core "deus ex machina", mediating, regulating, and in many ways fabricating the experience that all users on that sim will share. It may seem sort of natural; the sim is like Earth, and we are standing on Earth. In reality, of course, Earth, and each of us, are independent bodies existing in spacetime. We "stand" on Earth simply because Earth's gravitational pull is strong, whereas our gravitational attraction to each other is negligable. But it is important to remember that this is a state of affairs governed by our relative size and composition, rather than something truly intrinsic in our relationship to each other.

jalbafish3

Looking to first principles, is there some sort of metric or algorithm we can use to decide how to divide responsibilities between clients and servers? I've given this some thought, and here's what I came up with:

  • Anything that can run on the client, should run on the client.
  • Anything that can be stored on a server, should be stored on a server.
  • Communication should be terse and direct.
  • To the degree possible, resources should be provided by those who use them.

 

I believe these guidelines are founded on common sense. We store things on servers so that they can be universally accessible, and protected from the risk of corruption or loss on a single user's machine (we assume that servers are somewhat more robust, and run frequent backups!). We run things on the client, because that's where the user is. It's also worth noting that there are many more clients than servers in a typical scenario. Disk space is pretty cheap these days, but processing power is still a limited commodity. The final guideline -- being responsible for your own overhead -- relates to a social aspect of the Metaverse. CPU power is likely to remain the most precious commodity of the Metaverse for the forseeable future. As a free-market libertarian, I firmly believe that you can only be depended upon to be responsible for a resource if it costs you something, and there is a penalty for overuse. We'll see how that impacts things later on.

Let's go through some basic features of our Metaverse, and see how this approach plays out.

* Definitions of things -- terrain, prims, avatars

Can we store this information on servers? It seems that we can. Indeed, Second Life does so -- at least in theory. Obviously, the client needs to access this data in order to visualize the world. It creates a copy of the data; this copy may even reside on local disk (as a cache). However, the important thing to note is that the authoritative versions of things are indeed on various servers. Notice I say servers, plural; we are increasingly seeing data stored not on a single server, but across the Internet. Each individual resource we need to conjure up a scene may potentially be located on a different machine. This is outside the scope of this article, but whenever I refer to a "Server" holding data, it should be noted that this might in fact correspond to various physical machines in different places.

* Runtime behavior: avatar movement

For the most part, avatar movement is initiated on the client (in SL, through the keypad). Avatar movement doesn't actually "run" on the client, however; the movement command is sent to the server. Why? Because, in SL, the server is doing physics (and often running scripts), which affect the motion of the avatar. What if the required movement would cause you to go through a wall? In SL, the server has to get involved to solve this problem. It may seem the client could do so itself, since it has information about the walls and other elements of the environment. This approach is termed "client-side physics", and many networked videogames, particularly First Person Shooters, do in fact work this way. I would suggest that, according to my guidelines, avatar movement should be purely a client responsibility, using client-side physics to negotiate collisions with the environment. Obviously, we will continue to send movement information to the server, so that other users know where our avatar actually is. Likewise, we will continue to receive notifications of the movement of other avatars. But, what happens when avatars collide? More on that to come out in later articles.

* Runtime behavior: scripted prims

In SL, scripts run on the server. This is a pretty big deal, as scripts use up lots of resources. Scripts are bound to prims, and prims belong to users. Why not have scripts run on the machine of the user who owns the prim in question? This relates to a concept I call the "behavior server". In my mind, all behaviors should be managed and, if possible, processed by the owner of the object exhibiting the behavior. In the case of avatars, that's how things sort of work today. However, in the case of prims, everything is taken care of by the server. Getting back to that issue of resources and responsibility, this is a bad situation: it's in everyone's interest to make maximum use of the server, but it's in no one's direct, personal interest to ensure that the server is not overutilized. In economic theory, this is known as the "tragedy of the commons". In Second Life, it's known as a frakked sim.

Let's think about the ramifications of scripts running on user's machines instead of on the server. Say I have a vehicle, and I've scripted it to act in a certain way. In the SL model, that script (typically written in LSL, Linden Scripting Language) runs on the sim. I might have a Heads Up Display or keyboard interface to make it go, but this just entails parsing an input and sending commands to the server. The server does the hard work of running the script's logic, including code to manage acceleration, rotation, handling, collisions and so on. In addition, under the present paradigm, the server is probably running physics on the vehicle, to ensure it bounces off walls, doesn't fall through the ground, etc.

In my model, all this work is done by the client who owns the vehicle. The client runs a script that controls the logic of the vehicle's motion. It runs client-side physics to ensure the vehicle stays above ground, and caroms realistically off buildings (depending on your driving skill). The client then transmits a sequence of object update messages to the server, which then broadcasts those messages to the other clients who are observing the action at that time. Assuming there are 10 clients on the server, this scenario involves 11 messages for every 10 that would be sent the SL way. In exchange for a slight increase in network traffic, you get the client machines taking over a major part of a typical sim's CPU and memory overhead.

 

Article tagged:  | 3d web


10 comment(s) for “The future of Virtual Reality is not server centric”


Gravatar of K A K A said on Thursday, July 02, 2009 (7:02:40 PM)
Hi,
Kinda like the idea of client side resource usage, bringing down overall server load, however, the theory to run scripts on the owner side client, doesn't seem to make sense at all, we would end up with a non functioning 3d environment whenever an owner goes off line and leaves a club up and running on SL, when i have a car dispenser, giving users the chance to drive a car, i am still the owner of the script, but, when i am off line the venue would grind to a hold...
again, the idea is probably sound, but in all practicality, this wont work.
Gravatar of Robert Robert said on Thursday, July 02, 2009 (7:29:28 PM)
Some of this stuff doesn't seem practical. And in fact, a little dangerous. Any one of these could open up a massive amount of security holes, many of which would be exploited by Patriotic Nigras and other griefers. Its better in a lot of cases to just make the server software itself more efficient. Opensimulator can stand a lot of improvement, but unfortunately its developed mostly by volunteer hobbyists, with few if any professional coders. Their biggest mistake was using C# to develop it. Saps performance, is a bad language to develop cross-platform applications in because it favors one platform too heavily. That, and C# was developed by a company that has one of the tech industry's worst legal and ethical track records.

Only reason I actually use opensimulator is because there are no viable alternatives that I know of. As soon as there is, opensimulator is as good as dead.
Gravatar of Robert Robert said on Thursday, July 02, 2009 (8:27:23 PM)
KA, I think the scripts would run server side if the owner went offline. That sort of design decision is just plain obvious.
Gravatar of Rich Rich said on Thursday, July 02, 2009 (9:02:35 PM)
Logic as it relates the education sector from last October regarding Peer to Peer VW's in education - http://tinyurl.com/mqv7qu
Gravatar of danx0r danx0r said on Friday, July 03, 2009 (2:29:04 AM)
K A: I should have been more precise in the article. Rather than think of the 'client' in the conventional sense of your home machine, we can extend the idea so a 'client' is a physical or (more likely these days) virtual CPU plus memory & storage, that you have control of, and critically, you pay to maintain. That could exist anywhere -- at your house, in the cloud etc. It's up to you to keep it running, if you have a reason to make it persistent in the world.
Gravatar of danx0r danx0r said on Friday, July 03, 2009 (2:30:50 AM)
Robert: as to security, I believe running a script that sends out messages is less dangerous than uploading a script to another machine. Anyone can mod a client to attempt DOS attacks and such through messaging, but a script uploaded to a server is potentially capable of breaking out of its sandbox.

My model makes that concern irrelevant.
Gravatar of harrison partch harrison partch said on Friday, July 03, 2009 (4:27:49 PM)
The essay is totally wrong. Please don't bring up Croquet, either. The current architecture is entirely a consequence of GPU rendering and low bandwidth. As soon as tracers can produce 15 fps at 800x600 rays (say) then polygon renderers will be seen as the ugly things that they are, the constraints on geometric complexity of toy worlds will vanish, and CPU graphics will return. As soon as most users can get the bandwidth to stream that video, the logical place for rendering will be on the server, not at the viewer, the viewer will just display the video stream and send events to the server, and there will be no need to synchronize representations of the toy world between machines. One world, in the cloud, with bandwidth and rendering for all.
Gravatar of Jani Pirkola Jani Pirkola said on Friday, July 03, 2009 (4:46:43 PM)
Harrison: I can't see how it is possible to get along with UI response lag inherent with server side rendering. If it takes more than 100ms roundtrip from when I press a key for my avatar to respond, it *will* feel like moving in a jam.
Gravatar of Valer Valer said on Wednesday, July 08, 2009 (4:32:31 PM)
Hi Danx0r,
I am not really a specialist in this particular thing, but it looks like Solipsis has already started with non-server centric implementation. That's what they say at least.
I might have understood this incorrectly too.
Gravatar of Valer Valer said on Wednesday, July 08, 2009 (4:37:56 PM)
Oh, yes, and they (Solipsis) do not use C#.
"A central objective of Solipsis is to create a virtual world which is as independent as possible from the influence of private interests..."