Hacker News new | past | comments | ask | show | jobs | submit login
Mozilla's BrowserQuest - Massively Multiplayer HTML5 Experiment (browserquest.mozilla.org)
468 points by guigui on Mar 27, 2012 | hide | past | web | favorite | 106 comments



Article about how the game works: https://hacks.mozilla.org/2012/03/browserquest/


Since they used localStorage, you can modify the state of your character.

If you want the best weapons in the game, the sword is called 'goldensword' and the armor is call 'goldenarmor'.


What would be the point of that? The only fun in the game (besides the fact that it works at all) is finding the new gear and getting the achievements. If you just edit your character, then you may as well not even play.


Cheating single player is only affects the player themselves. But when it comes to online, multiplayer, then cheating/codes need to be restricted. It's more from a sustaining/profitability point of view – nothing drive users away when they first log on and see everyone running around looking identical and having the best items obtained with just a few key strokes.

I guess the OP's comment of local storage was also to point out the 'flaw' since it is for a multiplayer game.


I'm guessing they aren't too worried as it is just a demo. You can easily put some backend checks in for things like this.


Giving each weapon/character relationship an id solves this pretty easily.


TBH I just did it because I could.


Random idea: write a brand new game that talks to the Browser Quest server. Use the input of other players moving around as input into your own game (maybe some sort of ambient art thingy).


How'd you do it? I'm trying to do:

localStorage.data = localStorage.data.replace('sword1', goldensword')

But it just reverts after I type that into the console. Could someone explain how it works?


I ran this line

  localStorage.data = JSON.stringify((function (data) { data.player.weapon = 'goldensword'; return data })(JSON.parse(localStorage.data)))
and then reloaded the page, and I had the golden sword.


Ah, I see. I didn't reload the page. I wonder if there is any way to do this without reloading the page...

It be fun to show off if someone figured it out.


The client server protocol only lets you specify arbitrary equipment when you connect. To change equipment during the game, you have to Types.Messages.LOOT a dropped item.


Sorry, I don't understand. Types.Messages.LOOT can be used how exactly?


LOOT is an action in the client server protocol - you can't easily use it. The important part is that you can only equip an item that is available to be picked up, unlike when you first connect. You can specify any weapon and armor when you first connect, which is why editing the local storage works.


I actually did this in Chrome by just opening up the developer console, clicking on the Resources tab, and modifying the value directly. You'll see Local Storage under Databases in that tree on the left.


I did the same thing. You can actually change the weapon to "flask" (so it doesn't show up) and armor to things like "boss", "rick", "nyan", etc. "Rat" is pretty fun too.


You can also make yourself permanently invincible, attack 10 times per second, and teleport around, if you get a reference to some of the internal variables. I actually found it quite difficult to get that reference since the project uses requireJS and doesn't leave any global/window references. As far as I can tell, the only way is to pause in the debugger, which is much more tamper resistant than I expected it to be.


I'd like to hear more about how you did this. I'm always interested in manipulating Javascript and whatnot. Who knows, maybe I will learn something about securing my own games by tinkering with this.


I played it for 20min and after that I had golden sword and golden armor; hacking around in localStorage would probably have cost me around 10min too. And playing the game deems me much more fun :)


I like how they made it really easy to get in. No signup just name your guy and go. I generally don't have time to play games however I appreciate the amount of work that goes into them. Good Job.


Realm of the Mad God is even better on that front: it auto-generate a name for you, you just hit "Play" and you're in the game ready to rock (you can edit the game once you're hooked of course, and create a formal account, and start paying your dealer, but the initial experience is "hit play and you're playing")


best "tutorial" i've seen indeed.


I thought the most clever part was how it throws you (pretty much) directly into killing your first boss monster. You feel awesome within a few minutes of starting, immediately before getting told to go kill more boss monsters.


NPC soldiers with HTML5 orange shield are just too cute :)

And this is actually a nice little game. Buy then again, where is browserid and open badges support ?


There's no authentication here. I don't see why you would use BrowserID.


I could see using BrowserID for auth to save some kind of leaderboard on the server-side or something.


I have browserID supported on a few projects I've shipped, adoption comes down to the developers, all Mozilla can do is provide the tools.


Yes, but this is a Mozilla project, so no excuses on that one.


It is on github, you could propose a patch... Mozilla is a not-for-profit, this is a technological demo...


Mozilla are trying to push their BrowserID on the world though. A fairly popular (among devs) technological demo seems like the right place to start that; it'd show us how easy it is for users to use, and how simple it is to integrate. Not using it is a wasted opportunity.


This demo is really for HTML5, not for BrowserID. BrowserID might add an unrefined and unnecessary hurdle to the game. Then all the other platform dev's and press will say silly things like HTML5 requires BrowserID or something.


This is what I was responding to:

"... adoption comes down to the developers, all Mozilla can do is provide the tools."

I don't really care whether it has BrowserID or not. It just seemed that the parent was unaware that the game was a Mozilla project.


Awesome! Thanks for the productivity kill mozilla. Looks great and it's a lot of fun. Now I want to learn how to do this stuff in the browser.


Brilliant game, the little Easter Eggs really made it worth playing.

For anyone wondering about the 2 mystery achievements at the end; the clues are in client/js/game.js ( https://github.com/mozilla/BrowserQuest/blob/master/client/j... ), line 278.

Hiding the clues in the code like that just adds to the coolness. Great touch!


Very fun and well done. Nice of them to publish the source as well..


It feels very polished indeed. It works just fine on Safari, SFX included, although there's no music (dunno if it is supposed to have). A little musical theme per area would be nice.

There are easter eggs all over the place. I don't want to spoil them but a bunch of them really made me smile.


There is music, it can listen to it on Chrome.


as i could on firefox


You can follow the player population in real-time on this dashboard: http://browserquest.mozilla.org/status/


Can anybody explain what the dashboard is showing?


3 servers, 10 worlds per server, number is people.


Just collected the 20 achivements. Really fun demo, inspired me to learn more about pixel art. I can code well but my art skills are bad. Wish they expanded it...


This is so awesome. Well done Mozillians!


Could not move while on Chrome... was nifty though, I applaud the effort put into this. One day Flash, one day...


I'm on Chrome and it worked fine. Took a while to connect to the server, but other than that, it works great.


I could move on Chrome by clicking where I wanted to walk


Apparently you have to run full screen. I sure hope they fix that.


https://github.com/mozilla/BrowserQuest/blob/master/server

It's weird to me that they list the node dependencies in the server README instead of using a package.json.

Very cool project, though.


Did anyone figure out how to get to the mario pipe, and what the ??? quest is?


First ??? quest: Get an orange potion (to get the Firefox costume)

Second ??? quest: Enter a portal. I found one to the east-southeast to the starting point.

Still trying to figure out the last one.


The last one is Rickroll'd, you meet Rick Astley in one of the caves.


It's in the maze, I've heard, but I can't find Rick.


The easiest way is, pick a random door in the first room, and then every time you come into a new room go back the way you came (doors aren't symmetric in this game.) This will put you in a cycle that eventually takes you to Rick. You'll visit some rooms more than once.

Alternately, just stumble around until you find a room with one top entry and 3 bottom entries. Take the bottom left door, which will take you to Rick.


He's in there. Try unorthodox combinations. I think there's some state stored on whether or not you went through "up" doors or "down" doors.


Always go to the left, even if it's the entries to the top or the bottom.


I did both but didn't get any additional achievement, what am I doing wrong?


It's in the cave above the cat.


It's still a long way to compete with Flash in the area of games but it's nice to see this effort.

When I talked to Flash developers, their main concerns were having to worry about different browsers and their belief that everything became "open source" automatically because you can just view the source. They don't want to spend weeks on a project that sets them apart from other competitors only to be copied by the next guy within a day.


Shouldn't the beauty of games be the gameplay and the art, not the technology? Isn't it a good thing that the technology behind a game is no longer the primary selling point?


It'll be nice when the tech doesn't matter but if someone can't play your game because they prefer a different browser then that kind of sucks.


If you're referring to IE, well IE will give up Flash support anyway.


If you're referring to Windows 8, Flash will still work in desktop mode. Plugins will only be disabled in Metro mode.

And yes, I think this separation is ridiculous.


The technology behind a game is nearly always the primary selling point. There are too many games so users need some way to differentiate them. Seeing that game X uses tech Y means that people will talk about it and play it just to see tech Y. Even if it isn't very good people _will_ talk about which means it gets sales.


I dunno, this is better (and more fun) than any Flash based browser MMO I've played. Also didn't bug me about buying coins in their store or some Zynga-like upsell.


That's an interesting argument against HTML5 apps. If I really want to copy your Flash app, I'll just start at https://www.google.com/search?q=flash+decompilers


The mouse movement is laggy. Why not use hardware mouse speeds? For an interaction with that much frequency, it makes the game unplayable.


Anyone know how they do the networking?

Websock , Comet or ajax?



Ah, It's websocket with load balanced nodejs servers.


It's not a Comet style poll because the only requests I see it making are to a server that seem to be tracking metrics that have no response.


There are active websocket connections.


I can't wait until browsers have inbuilt peer-to-peer networking. Then we could do something like this entirely client side


I forked this https://github.com/mkrecny/BrowserQuest - added a static file server on branch static and dependency management via package.json. Main annoyance now is that they don't include the audio assets in the github repo : / Great fun game though.


I found a bug.

I had my guy move to the other side of a barrier, and he did so by taking a path through the adjacent square - but then my view was in the adjacent square, my guy moved offscreen, never to return.

For such a slick demo, that was really unexpected.


Would be pretty cool if someone implemented a decent browser-based MMORPG with a high degree of scriptability. Get the best of MMORPGs and MUDs + portability.


The other day, I was thinking about an SMS based MUD for cheap feature phones - text based of course. An online game for places without much 3G adoption but where there are lots of Nokias, so to speak.


I had an idea for a universal MUD a long while back (probably in junior high school, when I was a huge MUD nerd). A single game world with interfaces for IM, SMS, and the web. No matter where you were or what interfaces you had available, you could continue to be immersed in the world. I got the communication code working well for IM and the web, but never went beyond that; with Twilio, it'd probably be pretty straightforward...


Hmm... that could get too expensive fast. You have to find a place where unlimited texting packages are standard :)


Sounds interesting. Wanna email me? :)


works with opera but eats a whole cpu core


which version? the non-preview 11 didn't worked.


Version 11.61, Build 1250, Platform Linux


HTML5, the futur of gaming! Meanwhile, World of Warcraft uses less CPU/GPU than this demo...


I'd like to see see gain some traction and give Runescape a run for it's popularity.


What is the license on this?


We will update the licensing info in the GitHub repo in the coming days.


Clever, and very well done.


Am I doing something really stupid, or is this not working anymore???


19/20 ... what is the unknown ????? 20th one...anyone able to find?


1. Go into forest 2. There is a maze cave in the top right corner of forest. 3. Get stuck in the maze ;) 4. To find final award just go through a cave door then go back into the door you came out of. 5. Yes, caves are magic


thanks !! it worked..


Crashes Mobile Safari on my iPhone.


No issue on iOS 5.1 here (on a 4S)


Really organized, easy reading source too: https://github.com/mozilla/BrowserQuest

Outstanding work that I'm sure is going to inspire a lot of people. Though I don't see a license file anywhere.


Thanks. We are going to update the repository soon with licensing info.


Awesome! And again great work. The game was really enjoyable and the code inspiring.


Thank you. That means a lot to us. :)


One annoying thing is that I don't see any sort of guide on how to create map files.


Presumably they have a tool for doing so. (At least, I hope they do...writing all of that data by hand looks like a Herculean task.) Hopefully they will release that as well.


Why github is not showing json files correctly? https://github.com/mozilla/BrowserQuest/blob/master/client/s...

I can see only "{", to view the full i need to go to Raw format. I think Github should provide support for formatted json.


seems like a new github bug


Btw, there's an OctoCat NPC in game that tells you the github url :)


Can't even get past the enter your name screen.


I got past that and into the game but I can't get my character to move, tried on Chrome and Safari.


Wow this is pretty cool. But flash could do this years ago :)


Yes, but flash will not be here years from now. Just move on.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: