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.
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.
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.
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.