Wonderland Presence In Your Buddy List

June 17, 2009

Before diving into a description of a new Wonderland presence module that I wrote, I should introduce myself. I’m a PhD student at the MIT Media Lab, and I’m interning this summer with the Wonderland group at Sun, in the Burlington office. I’ve long been interested in designing and building all kinds of computer mediated communication systems, and so it’s exciting to be able to play with all the new tools that Wonderland gives designers. You can see more about my other projects at my projects page.

Wonderland server presence information in your buddy list.

As the places where we work and learn and play move online, we get an obvious benefit: we can include people from around the world in our activities in a more meaningful and fluid way. There are some downsides to moving away from shared, local, physical spaces, though. If I walk by a physical meeting room it’s easy (and socially acceptable) to glance in the doorway and see who’s there and what they’re doing. I’m almost certainly not going to invite myself in, but knowing who’s meeting and perhaps getting a hint about what the topic of the meeting is gives me a nice sense of what’s going on in the group. As a starter-project for me this summer to learn Wonderland, I put together a module that brings some of this sort of peripheral awareness and presence to Wonderland worlds.

I decided to take information about how many people are logged in to a Wonderland server — as well as the names of those users — and make it available in the context of an IM client. With this module, you can add a Wonderland world to your buddy list. This allows you to see at a glance, who (if anyone) is currently in the world. You’ll need an instant messaging client that speaks XMPP to do this. On OS X, my favorite is Adium or Apple’s built-in iChat. On Windows, I like Pidgin. If you have a Gmail account, you can use their built-in GoogleTalk system inside your browser.

When you add the world to your buddy list, the name of the server appears in your buddy list. In the image above, you can see that I have added the server named "Coherent", which is the name of one of our Wonderland severs. You can see on the right how I added the server to my buddy list. You’ll need your own Jabber account, of course. Once added to your buddy list, the status message shows how many people are in the world, and what their names are. So if you, like our team, have a few different Wonderland worlds set up for meetings, you can tell at a glance where the meeting is happening (and if anyone is there yet) before jumping in.

Conversation between someone in Wonderland and someone using an IM client.

If you want to communicate with the people in-world, this makes it possible. Anything you send to the Wonderland IM account gets broadcast to the text-chat channel in the world. Users in-world can choose to send instant messages to connected users outside the world by pre-pending an "@" sign to the message. This will send the message to all externally-connected users. The screenshot on the right shows a conversation between an Adium IM client and the Wonderland text chat window. Each time you initiate an IM with a Wonderland world, a welcome message is printed in the chat window with a link to that Wonderland world. This makes it easy to transition from an IM chat to a full in-world conversation.

How It Works

All in all, it’s a pretty simple process. I connect to an XMPP server (jabber.org), and update the status message whenever a user joins or leaves the server. I’m using Smack – a great free, open source Java library that made it easy for me to quickly throw something like this together. From a technical perspective, though, there were some notable hurdles. Most activity in Wonderland takes place inside of transactions. An example of a transaction might be handling a chat message from an avatar or changing the state of a Cell in the world. These transactions need to complete within 100ms, or the transaction system assumes something has gone wrong and restarts them. When we’re talking with an external network service like XMPP, there’s no way to guarantee we’re going to get a response within 100ms. To get around this, I wrote a Service — a Darkstar-level object that is allowed to run non-transactional code. This can be a tricky kind of code to write, and there are lots of potential pitfalls. Luckily, I had the benefit of getting advice from one of the Darkstar technical leads while I was working on this, so if you’re thinking about writing your own Service, this module might be worth looking at to see a Wonderland-specific example, as opposed to Seth Proctor’s wonderful Writing Darkstar Services article which is a little more general.

Future Directions

I hope this module is useful in its current state, but it’s really just a proof of concept to show how Wonderland might connect to outside services like XMPP. If you’re interested in working with this module, there are a few different ways you might want to extend this module. One easy thing to add would be some degree of access control. Right now, anyone can add this account to their buddy list and see what’s going on in the world. It would be easy and helpful to add a white-list of users or domains that are allowed to access the information.

A more ambitious project would be to abstract out this service such that it can be used as a CellComponent and attached to specific parts of a world. If your world has a few different distinct meeting spaces, for example, you might want to add the names of these virtual rooms to your buddy list rather than the name of the server. If you could give a cell an XMPPPresenceComponent, you could add that kind of fidelity to the presence display.

Finally, it would be nice if we didn’t have to rely on some external XMPP server. This module could include its own XMPP server, which would let the individual server XMPP names be at the same domain as the Wonderland server itself. This adds some complexity to the setup, but would make for a cleaner end-user experience. 

How To Try It

If this seems useful or interesting to you, check out the code in the unstable branch of the wonderland-modules tree. It’s called xmpp-presence. (see Download, Build and Install Optional Project Wonderland Modules for Version 0.5 for instructions on how to download, compile, and install optional Wonderland modules). It requires the latest version of the Wonderland code base, because I had to make some minor changes to internal Wonderland APIs to expose chat events and user-joined events that this system requires. You’ll also need to register for your own Jabber account. I’ve only tested the module with Jabber.org, so I would recommend using that. Other XMPP services
have slightly different login techniques, and you might need to tweak the code to get Wonderland to log in to non-Jabber servers. 

If you have any questions about this module, please don’t hesitate to get in touch! Just leave a comment here or post a message on the Wonderland forum.


Elastic Wonderland

June 10, 2009

We first came across Jeff Eastman on the Wonderland forum where he (as jdogsailing) chronicled his efforts to get Wonderland running on the Amazon EC2 cloud.  Recently, we had the opportunity to meet Jeff in person, and he kindly agreed to share his perspective on virtual worlds and also his recipe for starting a Wonderland server on EC2.  Read on for details.

Elastic Wonderland

I’ve been interested in 3d computer graphics since graduate school when I helped build the NCSU Computer Graphics Lab. Way before the cost of RAM had dropped enough to allow the construction of real time 3d frame buffers, we had a Varian 620 minicomputer that did hidden surface removal and shading to produce run-length encoded scan line segments that we squirted onto a 3-channel video disk to produce 3d images on a Sony TV screen. For many years, this system was the fastest 3d rendering platform around. We could completely render a scene composed of 200 polygons in about 30 seconds. How times have changed.

Hundreds of hours of D&D and Adventure later I was working with a small team at HP Laboratories in the mid ’80s. There  we built an immersive, 3d, virtual office environment in Lisp on an HP desktop system that had a 2d frame buffer and about 10mb of RAM. The project was based upon the ideas that fantasy role-play games and 3d virtual environments provided a strong metaphor for organizing and manipulating information in a distributed computer system. The environment had human avatars and NPC agents that could follow simple, rule-based instructions. It was, at the same time, populated with paper,  pencils, typewriters, calculators and file cabinets of a serious office mission and also the swords, daggers, treasure and scrolls of a fantasy adventure game. The agents could be serious, helpful creatures to find and deliver for you or they could be malevolent monsters bent upon your destruction. Of course, we had to keep them somewhat separated for political reasons, but the 3d metaphor was adequate to contain them all and there was only an artificial separation between the populations.

Today we have Second Life, a massively parallel, multiplayer 3d virtual reality in which the lines between fantasy role-play and serious endeavor are completely invisible. In SL, I can smoothly move between a serious customer presentation about Sun’s Eco Datacenters and a fantasy castle where I assume the shape of a white dragon to engage in mortal combat with its inhabitants. At the recent Virtual Edge 2009 conference in Santa Clara, Second Life’s Chris Collins reported they now have over 2 billion square meters of virtual real estate in SL organized into 27,000+ regions with 650,000 active users spending 44 million hours per month online. They have over two billion user-created objects in their universe which takes up 230 terabytes of storage. Chris reported an astounding $1.6 million dollars worth of goods and services change hands in Second Life every day.

Though fully immersive 3d technology is just beginning to appear in the commercial world, the Virtual Edge conference was sponsored by virtual event companies InXpo, On24, UnisFair, Virtual U and iCongo Live that were promoting Virtual Trade Shows, Virtual Offices and Virtual Universities. The physical conference itself was augmented by virtual attendees and presenters using Virtual U’s immersive 3d technology based upon the Active Worlds platform. Today’s virtual events are mostly limited to 2d renderings of 3d scenes by the available browser technology but this situation will change soon. Once true 3d model rendering is available as a browser plug-in, the entire web is poised to become 3d. When this happens there will be huge explosion in the data and server capacity required to support it.

Today I’m pursuing a business opportunity involving the use of immersive virtual reality and I’ve encountered Project Wonderland while investigating the available platforms. I’m still a Wonderland noob, but as a fan of open source and an Apache Mahout committer I can see how it could offer a serious and viable alternative to the other proprietary VR platforms on the market today. My involvement with Mahout and Apache Hadoop has necessarily led me to become a user of Amazon’s Elastic Compute Cloud (EC2). It’s tough to justify the purchase of a dozen computers just to run a couple Mahout clustering jobs so EC2’s on-demand computing platform was a natural choice when I needed a Linux server to bring up Wonderland for a test drive. The process itself was rather straightforward but there are some details that need to be done correctly in order for the deployment to function fully, especially the voice bridge.

The age of cloud computing is upon us, and Amazon is a major player in the infrastructure-as-a-service component of the cloud. EC2 has been around for a couple of years and is growing rapidly in use. Apache Hadoop is an open source implementation of the Google Map/Reduce and BigTable platforms which can now sort a petabyte in a little over 16 hours. It has had direct EC2 support for a little over a year and Amazon has recently introduced Elastic Map Reduce using the Hadoop platform. As immersive virtual reality makes it into the main stream and the web adds an important new spatial dimension, its not hard for me to imagine Amazon offering Elastic Wonderland not far down the road.

Bringing Up Wonderland on EC2

If you have never used EC2 I highly recommend Amazon Web Service’s excellent tutorial. This will give you step-by-step instructions on starting up your first EC2 instance and is a necessary prerequisite for the other steps that follow. Once you have successfully created an AWS account, installed the EC2 tools and created your security key-pair you will have everything you need to bring up a Wonderland server instance.

  1. Make sure you have defined a security group (default is ok as below) and have configured the following ports:
    • ec2-authorize default -P tcp -p 22
    • ec2-authorize default -P tcp -p 80
    • ec2-authorize default -P tcp -p 1139
    • ec2-authorize default -P tcp -p 4848
    • ec2-authorize default -P tcp -p 5060
    • ec2-authorize default -P tcp -p 6666
    • ec2-authorize default -P tcp -p 6668
    • ec2-authorize default -P tcp -p 8080
    • ec2-authorize default -P udp -p 5060
    • ec2-authorize default -P udp -p 6666
    • ec2-authorize default -P udp -p 6668
    • ec2-authorize default -P udp -p 10000 12000
  2. Go to your AWS Console
    • Click the EC2 Tab
    • Sign in
    • Select Launch Instances with the following attributes:
      • select Getting Started on Fedora Core 8 AMI
      • 1 small [keypair] [group]
    • Select the Elastic IP tab
      • allocate one elastic IP
      • associate with your new instance
  3. Access your public URL in a web browser and you should see:
    Congratulations! You’ve successfully launched the EC2 Getting Started AMI.
  4. Now access it by your static IP just to check:
    Congratulations! You’ve successfully launched the EC2 Getting Started AMI.
  5. Now log in to your server using your elastic IP (e.g. ssh id_rsa-gsg-keypair root@[your Elastic IP])
    • install the Java 6 JDK
      • # wget -nv -O java.bin http://%5Bjdk 6 URL]
      • # sh java.bin
      • # mv /usr/local/.
      • # cd /usr/local
      • # ln -s java
    • set up environment variables
      • # cd
      • # vi .bashrc
        export JAVA_HOME=/usr/local/java
        export PATH=$JAVA_HOME/bin:$PATH
      • #. .bashrc
      • # java -version (verify java is working)
    • install Subversion and Ant
      • # yum -y install ant subversion
      • # yum -y clean all
    • check-out and build Wonderland dev5 tag then run it
  6. Now open a browser on your new wonderland server on EC2, port 8080 (you should see the wonderland welcome page)
    • click here to access server administration.
      • edit Voice Bridge
        add voicebridge.first.rtp.port=10000
        add voicebridge.last.rtp.port=10200
        add voicebridge.server.public.address=[your Elastic IP]
        add voicebridge.server.public.sip.port=5060
        change voicebridge.status.listeners=[your Elastic IP]:6668
        change voicebridge.local.hostAddress=[your Private IP]
      • click Manage Snapshots
        make celltest-wfs current (ok to restart server)
      • click Home
    • click Launch Wonderland
  7. The client should start (click Trust) and you should be able to hear the singing teapot if you walk near it.

%d bloggers like this: