
BananaBread: 3D first person shooter game compiled to JS+WebGL - robin_reala
https://developer.mozilla.org/en-US/demos/detail/bananabread
======
pmr_
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.

~~~
azakai
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.

------
idm
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.

~~~
azakai
The load problem on Chrome seems to be audio decoding related. Reloading
usually fixes it. Still investigating and looking for a better workaround.

------
FrojoS
Very impressive!

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

------
magikbum
Tried playing but didn't load. The demo video though looks amazing.
[http://www.youtube.com/watch?feature=player_embedded&v=m...](http://www.youtube.com/watch?feature=player_embedded&v=mIYmxPdtsl4)

~~~
mistercow
Yeah not working on Chrome on Linux for me. Gets to "preparing" and then stops
doing anything.

~~~
azakai
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.

~~~
RobotCaleb
Stuck at the end on preparing in Chrome. No errors for me. Just the following:
<http://pastebin.com/raw.php?i=wucwzSxM>

~~~
azakai
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.

~~~
RobotCaleb
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. :(

~~~
azakai
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.

------
EastCoastLA
Should have evolved some element for the <http://www.ludumdare.com/> event.

Maybe next time ;)

------
stcredzero
"Banana Bread" was also the name of a very early and very obscure erotic
adventure game on the Apple II.

~~~
stilist
I’m curious. More details?

~~~
stcredzero
Sorry, it's been too long ago, and too long before Google. I only remember the
mention of the name.

------
wazoox
Alas, unplayable with a non-QWERTY keyboard.

~~~
azakai
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.)

------
circa
looks awesome.. i'll try it when i get home.

------
crowhack
tried it in chrome windows 7, got error pointer lock/mouse is missing, any
ideas?

~~~
azakai
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).

