Installing BrowserQuest on Amazon EC2

BrowserQuest, the OpenSource MMORPG that was realeased this week by the great Mozilla Foundation. They brought us not only the Firefox but also a variety of other great software  projects. This time they sponsored the french developers Franck and Guillaume Lecollinet from Little Workshop to create very cool multiuser game. Their work proves that they not only speak french and english but also JavaScript fluently, as the state on their website.

I am not sure if this game really passes as Web3D but it is 3D enough for me at least – and it’s fun to play. Also the design is wonderfully retro-ish – before you ask: the art wasn’t ripped elsewhere but created by themselves. Also, these guys managed to solve a few technical problems that I wasn’t sure that you could solve in a browser game.

The game is written in JavaScript on the client side (obviously) and the obvious choice for the server side was nodejs, and that was  only one of a few clever design decisions to get this thing done:

– their installement runs on 6 servers each handling 10 worlds with around 75 players; one can check the status of the instances via a status page.  So one server could host 750 players, all of them 4500. When I was on, the number was around 2000.
– the ‘save game’ is stored locally in the browser, so they dodged fancy identity management.
– there is no database – all is handled by nodejs.
– (I am sure I forgot many, meh)

So I wanted to roll my own MMORPG on EC2, yay!

One lonely Dirk and a NPC ...

(Caveat: they created the map with the tiled map editor plus a special converter which they didn’t release yet. So creating you own map is complicated to say the least at the moment but I hope someone comes up with a solution.)

It took me some time to find out how to install it (embarrassing, I know) so I thought I’d document this here. The one piece of information that I missed is that you basically start two servers – one as a static server that only serves all the media including html/js/css and the other one is the node server. The latter is located in the server directory while the former is in a folder called client. I was somehow expecting that the static files are also served by node (like in Express for example) but I was wrong.

So here’s the scoop – if you need more detail, please leave a note in the comments.

To roll my own MMORPG I chose a Ubuntu t1.micro instance (AMI ID ami-349b495d) which is the first one in the Quickstart menu of your Amazon AWS page. After it launches you want to add a rule to the security group opening port 80/TCP (or 8080/TCP) and attach an elastic IP.

Then you install nodejs and npm and git the code from github. Then follow the instructions here except that they forgot memcache, so read this. Then you start the node server. Now – important – start another server from the ‘client’ or ‘client-build’ directory, serving the static files. I used Marak Squiers http-server with port 80.

If everything worked, you point your browser to the elastic IP DNS name and you see your own RPG!
(if not, either you or me did something wrong :-) )

So here is my daughter and a friend of hers saying ‘cheese’ on EC2!Yay! with friends!

Again – if you need more info, drop a line in the comments.

EDIT: here’s how to install in a Gist.
EDIT2: here’s an updated script.

14 Responses to Installing BrowserQuest on Amazon EC2

  1. […] If you want to drill down even more and experiment with your own installation, check out this article:  Installing BrowserQuest on Amazon EC2. […]

  2. sgricci says:

    Nice work! This should help people that are having issues on GitHub.

  3. sgricci says:

    Nice work! This should help people who are having issues (who are posting on the GitHub issues list) to set it up properly.

  4. Zubzub says:

    I really need help with this. Im thinking of using a windows VPS or linux. If I send you the details could you set it up for me?

  5. Rob says:

    Thank’s sir! you rock!, I can’t wait to set this up with some friends!

  6. […] 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 […]

  7. […] us not only Firefox but also a lot of open source projects like BrowserQuest (I wrote about it here) and of course BananaBread from the man […]

  8. As an avid games fan, I just wanted to drop you a quick word or three to say
    thank you for putting this nice piece up.

Leave a comment