# Postina: A Publish/Subscribe Middleware Designed for Massively Multiplayer Games

I have just submitted my master thesis! Now, I have completed everything for my Master of Science in Computer Science, that is I have finished my studies!

In my project I developed Postina, a new network layer for Mammoth (an MMOG). Everything about Postina (including sources) is available online at http://postina.zindel.org.

The abstract is:
Postina is a network middleware designed for massively multiplayer online games (MMOG). It combines publish/subscribe functionalities with direct messaging, a feature of critical importance for MMOGs.

In MMOGs, numerous messages such as state updates are sent to different clients. While some messages must be multicast to a large group of clients, other messages are private and sent to a single client only. Using a traditional client-server approach limits the number of simultaneous players, a property that is undesired in MMOGs. A potential solution would be to use publish/subscribe systems which are designed for scalability. Pure publish/subscribe systems, however, do not provide any possibility to send a message directly to a single client as the peers do not have any knowledge of the network topology.

In this thesis we first study different publish/subscribe systems and the features they offer to choose an appropriate middleware providing the required functionalities for MMOGs. Additionally, we design Postina, an API for network layers in MMOGs that offers a convenient interface combining publish/subscribe and direct messaging. We then implement a version of Postina using Scribe, a topic-based publish/subscribe system built on top of the distributed hashtable Pastry. To fulfil the requirements of MMOGs, we add extra features such as reliable direct messaging and the capability of issuing subscriptions for other clients. This version of Postina is then integrated into Mammoth, the massively multiplayer game research framework developed at McGill University. Finally, the efficiency of the new network layer is tested to determine the maximum number of simultaneous players.

# Frühstücksroboter mit Eisenbahn

Beim heutigen Regenwetter habe ich herzlich wenig Lust auf «Ausseneinsätze» – ideal also, um auf sf.tv einige Sendungen zu schauen. Das Schweizer Fernsehen hat ja mittlerweile sehr viele Sendungen online und sogar bei Youtube ist SF mit einem eigenen Channel dabei.

Die relativ neue Sendung namens Einstein hat eine spezielle Serie mit dem Titel Die Roboter kommen! ausgestrahlt. Einige der vorgestellten Roboter sind einfach witzig, andere sind wirklich nützlich.
Mein persönlicher Favorit ist ein Roboter, der im Hotel Tenne in Saas-Fee in Zusammenarbeit mit einer Eisenbahn das Frühstücksbuffet bereit macht: der Roboter lädt gekochte Eier auf Eisenbahnwagen und füllt Gläser mit Jus. Die Eisenbahn transportiert diese dann ans Ziel. Das alles geschieht vollautomatisch. Den zweiminütigen Filmbeitrag zum Frühstücksroboter gibt es hier.

# Gmail by Microsoft

In his last blog post, Clem mentions a wonderful blog post talking about how Gmail would probably look like if it had been designed by Microsoft. The result is amazing – and although it is a joke, it contains a big grain of truth. But read yourself in What If Gmail Had Been Designed by Microsoft?

# Save Power with Linux

Intel has created a new website helping Linux users to reduce the power consumption of a computer (especially useful for laptops): www.lesswatts.org. On this page many tips and tools helping to save electricity (and therefore get longer battery life) are provided. During the next days (weeks?) I will do some tests and improvements on my laptop and tell you about the results.

Today I would like to start with the installation of PowerTOP, a tool helping to find out how badly the computer is configured and which software is consuming most of the power. It can be downloaded from www.lesswatts.org. Unfortunately it has not yet been integrated into the Ubuntu package system and there are currently no .deb files available. Thus you have to download and compile it yourself to install it – but that’s easy:

2. Unpack it by typing tar -xzf powertop-1.8.tar.gz in a terminal.
3. Enter the folder: cd powertop-1.8
4. On Debian/Ubuntu install sudo apt-get install libncursesw5-dev
5. Type make. The program compiles, this is done in a few seconds. If you get the following error
/usr/bin/ld: cannot find -lncursesw collect2: ld returned 1 exit status make: *** [powertop] Error 1
you have forgotten to install libncursesw5-dev in the previous step. Do it and retype make.
6. Type sudo make install (it is important that this be done as root/sudo!).
7. Start PowerTop sudo powertop

After being started, the program will tell you how often the CPU is woken up per second and give suggestions how you can improve the situation. In my case there are currently between 400 and 600 wakeups per second – in the best case three (3) are enough. Thus, my computer is wasting a lot of energy.
To achieve good results, a kernel of version 2.6.21 or later has to be installed. This also activates all functionalities of PowerTop.

In the next post we will install the new kernel on Ubuntu Feisty.

# Resize Images on Linux

To publish pictures in my gallery I have to resize them. Doing this picture per picture is annoying, I want to batch resize the images – the best solution would be a command line tool that accepts wildcards (*) so that many files (e.g. all in a specified folder) can be modified at once. With ImageMagick this is a very easy task under Linux: the command mogrify -resize "1200>" */*.JPG resizes all files with the ending .JPG in all subfolders to a width of 1200 pixels. The resize operation is only done if the original is larger than 1200 pixels (option >).

# Autorotate Images on Linux

Cameras store information about the orientation of an image in the so-called exif. Many programs automatically rotate images when displaying them. However they do not store the image after the rotation which is necessary if you want to publish your pictures in a gallery. Under linux the tool jhead does this job for you.
The command jhead -autorot *.jpg will rotate all files ending with .jpg in the current folder if necessary (i.e. if the exif-data indicate that you should rotate the image).

# How to Scan at UniFR

Students and collaborators at the University of Fribourg have access to a very fast and high quality scanner: the printer and photo coyp machine in the A100 hall at Pérolles II. Simply push the button „Scan“, then choose the „scan to file“ option (in the middle) and follow the instructions (choose pdf or tiff, set resolution, color etc). The scans are then stored in a folder that can be accessed using samba.

To access the scans, a samba client is necessary. Under Linux kbear or the command line interface smbclient can be used. For the command line interface, type the following command (replace by your username):

smbclient //admpr07/FILE_SHARE -U -W UNIFR

After, the same commands as in the terminal ftp client can be used, i.e. get to download a file, mget to download multiple files (e.g. mget *.pdf), cd to navigate and del to remove a file (which is recommended at the end, as everybody has access to the folder).

If smbclient is not installed, you will first have to install it. Under ubuntu this can be done by typing sudo apt-get install smbclient.

If you want to access the files using your own machine or from at home, you will have to connect using VPN.

# LaTeX-Beamer with Bibliography and Newblock

Tomorrow morning I will give a presentation on publish/subscribe (read the abstract and the invitation – you are welcome to drop in!). To prepare the presentation I used the LaTeX Beamer Class. The package is great, but the command \newblock which I use in the bibliography does not work and constantly produces the error http://latex-beamer.sourceforge.net/. This is due to the fact that the \newblock is not defined in the Beamer Class. The solution is to define it yourself by adding the following line of code after the \begin{document} command:
\def\newblock{\hskip .11em plus .33em minus .07em}

With this simple line everything is fine and the bibliography works.

# Comfortable Wireless Networking with Linux

Until a few minutes ago I was not really happy with the current configuration for (wireless) networking on my notebook. When I wanted to change to another (wireless) network (e.g. when I was not at home), I had to go to the network settings and change the network there. If I went to a new place, I had to use iwlist scanning to find out which networks were available and then manually enter the essid to the form. Connecting to the network was then rather slow, sometimes it did not work (always switched back to another network that was not available at the current place) and I had to reboot. Thanks to Clem who told me about the NetworkManager this is now over. Originally it is a gnome-tool but it works perfectly on my Ubuntu with XFCE.

I installed NetworkManager by the command sudo apt-get install network-manager, commented out (with #) all lines except those with lo in /etc/network/interfaces and rebooted. The first time I had to start the NetworkManager using nm-applet, since then a small applet has been in my xfce-panel. Similar to windows I can click on it to display available networks. By clicking on an entry, I can connect to the corresponding network (and enter the network key).

# Switching from Gaim to Pidgin

It has now been for a while that Gaim has changed its name to Pidgin (no, it is not pigeon…) due to a lawsuit with AOL and published the version 2 of this instant messenger. Now they have released 2.0.1, so I decided to install this new version.
My Ubuntu did not automatically install the new version. Unfortunately I could not find a .deb-package for Pidgin, so I had to compile Pidgin myself. Before doing that I made a backup of my folder ~/.gaim containing my preferences.

First, I had to download the source and then unpack the .tar.bz2-file using the command tar -xjf pidgin-2.0.1.tar.bz2. After a cd pidgin-2.0.1, I executed the first of the classic three commands to compile a program: ./configure. Unfortunately I got the message You must have libxml2 >= 2.6.0 development headers installed to build. so that I had to install sudo apt-get install libxml2-dev before again executing ./configure. This time everything went well and I was told configure complete, now type ‹make›. Obviously I followed this advise and typed make which busied my aging computer for a couple of minutes. To finalize the installation I had to type make install. After that, everything was ok.
I can now start Pidgin by typing pidgin in the terminal or by using the entry in the menu (Network -> Pidgin Instant Messenger).

Pidgin does not seem to have changed a lot compared to the beta version of Gaim 2 that I had installed before (however it has changed a lot compared to the older versions). The design and icons are different and more modern, but the functionalities are about the same. Unfortunately it does not support video or voice chats, but personally I prefer writing over talking, so this missing feature does not really disturb me. What I really appreciate is that Pidgin supports no less than 15 different protocols. As an example, I use it for my ICQ, MSN and GoogleTalk accounts.