BananaBread – Cube 2 engine in the browser

September 9, 2012

After BrowserQuest (I described the merits and the installation over here) the Mozilla Foundation didn’t stop by bringing top-down 2D multiplayer to the web. A couple of days ago they released Bananabread. From the description:

BananaBread is a 3D first person shooter that runs on the web. It takes the Cube 2: Sauerbraten engine, which is written in C++ and OpenGL, and compiles it using Emscripten into JavaScript and WebGL so that it can run in modern browsers using standards-based web APIs and without the need for plugins.

This is important in a couple of ways.

  1. This is a full-fledged first person shooter running completely in the browser  in JavaScript and WebGL – smoothly.
  2. The described development way – compilation of a C/C++ with Emscripten – could be one way to go to develop games or virtual world environments in the browser (as opposed to written in JS directly).
  3. I learned in the Google Creative Sandbox in Berlin that Google sees the Chrome browser more and more as a multimedia engine to run creative applications – like games. That’s why they are incorporating things like WebGL and the Mouse Lock API. Obviously Mozilla/Firefox agrees.
  4. Sauerbraten.

I’ll go into more detail for this last bullet.

The Sauerbraten engine – luckely renamed Cube afterwards – was written by Wouter van Oortmerssen back in 2002 with Cube 2 following two years later as a re-design. The major features that makes Cube 2 stand out from the rest of the pack are:

  1. It is lightening fast on current hardware and runs great even on older hardware because it uses a cube based, oct-tree approach to render the world.
  2. It’s a multiplayer game with real-time editing abilities.
  3. It’s open source.

Now let’s look at the first issue: the cube based approach. If that sounds familiar – that’s right. That’s the same approach that Mojangs Minecraft uses. Also the second bullet – multiplayer editing – is a feature of Minecraft: in fact the multiplayer editing feature is what makes most of the fun (according to personal observations and some relatives ;-) ).

I am not stressing this to tell somebody ripped the concept of somebody else, rather the opposite: we can learn from both concepts to create better virtual worlds.

To me, Minecraft today seems to be as close to virtual world immersion as it gets, with its incredibly easy user interface and the fantastic crafting notion. Sauerbraten, on the other hand, features more realistic graphics, although using the same blocky approach. Also it’s open source. Both have clients for Windows, Mac OSX and Linux  using a completely different approach (Java vs. C++).

With virtual worlds being at an all time low (see the Gartner Hype Cycle 2012 discussed in Wagner James Aus NWN ) we need to learn from these concepts to do it better next time – and there will be a next time.

With the WebGL translation of Sauerbraten, I can’t help but stress there are ways to create a multi-plattform, multi-device approach for games and virtual worlds – even within the browser.

If I had too much time and/or money on my hands, I’d propably start with the Cube 2 engine, de-militarizing it (a bit) and slowly but surely adding features like external user authentification, multi-screening abilities, DropBox integration – maybe even crafting features. The Sandbox Game Makers did a Cube 2 conversion towards a somewhat more peaceful, educational game play:

There’s tons of ressources and mods out there. I’d like to point out the excellent (albeit german) ressources at Natenoms Blog with a very friendly user community, explaining important more advanced features like mumble integration (i.e. VoIP support in Cube 2).