Open Source Platform
for interconnected virtual worlds

NG Design Document/Viewer Architecture/Avatar

From Rex community wiki

Contents

Motive

One of the prime aspects of the current realXtend viewer is the avatar architecture. A large percent of resources used on the viewer were dedicated for it. As such, much of the architecture implementation can be directly lifted from the current viewer and used in realXtend-NG. It should be noted though that some of the avatar implementation uses code that is under GPL license [1]. A more liberal license is preferred for realXtend-NG, therefore those parts of the implementation will probably not be usable.

Current realXtend Avatar

Avatar code is divided into 3 distinct parts in the current viewer: generic avatar, Ogre avatar and OpenSimulator avatar. In addition there is support code for the realXtend avatar, such as networking code for storing the avatar to the avatar storage server and authenticating the avatar. The support code is partly under GPL license, so removing the dependencies on GPL code and coding our own implementation may take some work.

Avatar Data

The realXtend avatar is composed of the following parts:

  • Generic xml - contains generic avatar specific data, such as first name or last name, and a list of assets the avatar uses: mesh, skeletons, textures and materials. This is data that both the client and the asset storage server (in current architecture, avatar storage server) will need.
  • Avatar xml - avatar specific data that only the client needs, such as mappings for animations and specific bones in the skeleton to those of the OpenSimulator avatar, for OpenSimulator feature compatibility, and morph modifiers.
  • The actual assets used by the avatar, binary data.

Avatar Code

realXtend avatar code is composed of the following parts:

  • Avatar Lib - generic realXtend avatar implementation that does not depend on any specific renderer, but is realXtend specific.
  • Ogre Avatar - realXtend avatar implementation that depends on Ogre renderer to render the avatar.
  • OpenSimulator specific avatar code / protocol specific avatar code - interacts with protocol implementation to f.ex. animate the avatar based on packets from the server. Also ties the OpenSimulator avatar implementation to realXtend avatar implementation.


Image:Avatar_Components.png

XML-RPC

XML-RPC is used in the protocol for communications between the client and avatar servers. Currently the implementation relies on GPL code but work is already being done for XML-RPC support for authentication, and that same code can be used for avatar assets. Furthermore as it has been suggested that the avatar storage server would be integrated with generic asset server, viewer asset cache could be used for avatar assets as well. There would no longer be need for separate code for world asset and avatar asset management.

Avatar Generator

In addition to this, there is the Avatar Generator specific code. The Avatar Generator uses almost all original code. The Avatar Generator can be used as a standalone program, or as an embedded feature in the current viewer. The AG consists of a dressing room with the avatar standing in the middle, the avatar modifying tools and the avatar exporter / importer. The Avatar Generator uses CEGUI UI library.

Avatar Asset Cache

Avatar implementation uses the client's asset cache in an indirect way. A workaround was needed since avatar assets use a hash value for identification, rather than lluuid like other assets. This hopefully can be forgotten and the new viewer asset cache implementation should be able to handle all types of assets, avatar or otherwise.

Moving to realXtend-NG

Avatar library can be used almost as is, with some refactoring. It is probably good idea to divide it into generic realXtend avatar, rendering specific and OpenSimulator protocol specific parts.

It is questionable whether OpenSimulator protocol specific avatar parts can be reused in the new viewer, as some of the code relies on GPL code, such as how generic animations (walk, stand, fly...) from the server are launched, or avatar head turning.

Many features that essentially use our own protocal (generic messages), such as launching specific animations from server script, animation LOD and IK, should be possible to use mostly as is with some refactoring if time permits. The user interface of the Avatar Generator should be changed to use whatever UI library is used by rest of the viewer.

Citations

  1. The GNU General Public License
    (http://www.gnu.org/licenses/gpl.html)