News for hackers. Stuff that matters.
Re:BananaBread: 3D first person shooter game compiled to JS+... by pmr_ on Tuesday August 28, 2012 @02:58PM (#4445276)
I'm wondering: Was the technique of compiling from C++ to JS primarily for code reuse? I always perceived the ability to code in something else besides C++ as one of the main advantages of the whole "Games on the Web" thing.
Re:BananaBread: 3D first person shooter game compiled to JS+... by azakai on Tuesday August 28, 2012 @03:04PM (#4445301)
Code reuse was a major reason, yeah. It was much, much easier to compile a full open source game engine (that was worked on for many years!), instead of writing a new one from scratch.

Another benefit is C++ compiled to JS tends to be faster than handwritten JS, because it avoid things like GC and property accesses and focuses on things JS engines can easily do fast, like typed array accesses.

Re:BananaBread: 3D first person shooter game compiled to JS+... by idm on Tuesday August 28, 2012 @01:16PM (#4444779)
It took a few tries on OSX/Chrome (no relevant errors from the console to report) but it seemed to be more reliable when running inside a "fresh" tab as opposed to one I had already reloaded several times.

Having played it, I must report back to say: this is stunning. It's wicked fast. Wow. Just wow.

Re:BananaBread: 3D first person shooter game compiled to JS+... by azakai on Tuesday August 28, 2012 @02:33PM (#4445146)
The load problem on Chrome seems to be audio decoding related. Reloading usually fixes it. Still investigating and looking for a better workaround.
Re:BananaBread: 3D first person shooter game compiled to JS+... by FrojoS on Tuesday August 28, 2012 @03:22PM (#4445410)
Very impressive!

Was playable in low-ress mode, though sometimes laggy, on my 2010 MacBook Air with Chrome.

Re:BananaBread: 3D first person shooter game compiled to JS+... by magikbum on Tuesday August 28, 2012 @11:26AM (#4444146)
Tried playing but didn't load. The demo video though looks amazing. http://www.youtube.com/watch?feature=player_embedded&v=m...
Re:BananaBread: 3D first person shooter game compiled to JS+... by mistercow on Tuesday August 28, 2012 @11:59AM (#4444338)
Yeah not working on Chrome on Linux for me. Gets to "preparing" and then stops doing anything.
Re:BananaBread: 3D first person shooter game compiled to JS+... by azakai on Tuesday August 28, 2012 @12:32PM (#4444520)
Strange, works for me on Firefox and Chrome. Can you look in the error console? Debug output goes there, could help narrow down the problem.

Edit: The "troubleshooting" section on the page might help.

Edit2: If that doesn't help, try clearing the cache and reloading, I've seen that fix things on Chrome, not sure why.

Edit3: And specifically for Chrome, make sure pointer lock is enabled, it's disabled by default.

Edit4: I think I can reproduce this, once every few runs it stalls like that, because Chrome fails to decode audio sometimes. Reloading fixes it for me.

Debug build is up at http://dl.dropbox.com/u/80664946/index.html which tells you what is causing startup to fail in the error console.

Re:BananaBread: 3D first person shooter game compiled to JS+... by RobotCaleb on Tuesday August 28, 2012 @12:35PM (#4444538)
Stuck at the end on preparing in Chrome. No errors for me. Just the following: http://pastebin.com/raw.php?i=wucwzSxM
Re:BananaBread: 3D first person shooter game compiled to JS+... by azakai on Tuesday August 28, 2012 @12:51PM (#4444619)
Thanks, that's very strange. It looks like the correct output during startup, and then it just stops.

It's not too surprising there are bugs here, this is one of the first examples of its kind on the web, and I'd expect issues in browsers and in the game itself. However it does work for me in multiple versions of Firefox and Chrome so I don't have a good guess as to what the problem could be in your case.

For a future version I'll try to put in more debug output, perhaps that will help.

Re:BananaBread: 3D first person shooter game compiled to JS+... by RobotCaleb on Tuesday August 28, 2012 @01:29PM (#4444852)
It did work once I tried Firefox. Pretty cool. Although, having to change my settings every time I went in (keys, mouse invert, mouse sensitivity) got old fast.

Clicking into one of the text boxes (mouse sensitivity) and hitting backspace caused the browser to go back in my history. :(

Re:BananaBread: 3D first person shooter game compiled to JS+... by azakai on Tuesday August 28, 2012 @01:32PM (#4444861)
About the settings, yeah, we should store them using IndexedDB for later runs. Haven't gotten around to that yet.

I've seen the "go back" bug myself a few times. Not sure yet what causes it, I think I saw it with the middle mouse button on Linux primarily.

Re:BananaBread: 3D first person shooter game compiled to JS+... by tluyben2 on Tuesday August 28, 2012 @12:18PM (#4444437)
I have the same issue on Chrome (21.0.1180.82)/Mac OS X (10.7.2). Other WebGL stuff works.
Re:BananaBread: 3D first person shooter game compiled to JS+... by EastCoastLA on Tuesday August 28, 2012 @01:08PM (#4444728)
Should have evolved some element for the http://www.ludumdare.com/ event.

Maybe next time ;)

Re:BananaBread: 3D first person shooter game compiled to JS+... by stcredzero on Tuesday August 28, 2012 @02:51PM (#4445244)
"Banana Bread" was also the name of a very early and very obscure erotic adventure game on the Apple II.
Re:BananaBread: 3D first person shooter game compiled to JS+... by stilist on Tuesday August 28, 2012 @03:19PM (#4445393)
I’m curious. More details?
Re:BananaBread: 3D first person shooter game compiled to JS+... by stcredzero on Tuesday August 28, 2012 @05:47PM (#4446047)
Sorry, it's been too long ago, and too long before Google. I only remember the mention of the name.
Re:BananaBread: 3D first person shooter game compiled to JS+... by wazoox on Tuesday August 28, 2012 @04:21PM (#4445700)
Alas, unplayable with a non-QWERTY keyboard.
Re:BananaBread: 3D first person shooter game compiled to JS+... by azakai on Tuesday August 28, 2012 @04:53PM (#4445850)
You can enter the game's menus (`) and change the keybindings.

(However, we haven't implemented saving the config file for next run yet, so it will just be for that run.)

Re:BananaBread: 3D first person shooter game compiled to JS+... by circa on Tuesday August 28, 2012 @01:01PM (#4444675)
looks awesome.. i'll try it when i get home.
Re:BananaBread: 3D first person shooter game compiled to JS+... by crowhack on Tuesday August 28, 2012 @02:52PM (#4445251)
tried it in chrome windows 7, got error pointer lock/mouse is missing, any ideas?
Re:BananaBread: 3D first person shooter game compiled to JS+... by azakai on Tuesday August 28, 2012 @03:00PM (#4445283)
See the troubleshooting section on the page - pointer lock is disabled in chrome by default, you need to enable it to run the demo (you can do so in chrome://flags).