A port of the Cube 2/Sauerbraten 3D game engine/first person shooter to the web, compiling C++ and OpenGL to JavaScript and WebGL using Emscripten.
FPS-type games: http://dl.dropbox.com/u/80664946/index.html
Non-game example: http://www.syntensity.com/static/night14/fireworks.html
Screenshots: http://mozakai.blogspot.com/2012/06/bananabread-02-levels.html
Cube 2 is a compact and efficient 3D game engine. By compiling it to JavaScript and WebGL you can run a complete first person shooter in your web browser, using only standard web APIs and without any plugins.
Features:
- A multitude of visual effects including water reflection/refraction, parallax mapping, glare, particle effects, lightmaps, skeletal animation (on gpu), etc. etc.
- Streamlined and quick physics system
- Ragdoll physics
- Bot AI with adjustable skill level
- Integrated in-game editor
- Fast performance both running on the web or natively
- zlib license
The original engine also has a lot of other features not yet enabled (but will be):
- Multiplayer
- Multiplayer editing
- Shadowmapping
Get emscripten and its dependencies,
It's recommended to go through the emscripten tutorial to see that it is set up properly.
You will also need crunch if you want smaller downloads,
http://code.google.com/p/crunch/
Build in crnlib using the Makefile (if it isn't in the release yet, see the
issue filed on their site where we submitted it,
http://code.google.com/p/crunch/issues/detail?id=1 ). You can disable
crunch if you don't want it, remove all mentions of crunch in
cube2/src/web/Makefile
.
Then do make
in cube2/src/web
for a web build. You can also do make
in
cube2/src/native
for a native linux build.
If you have any problems building, feel free to file an issue here or to find us on emscripten IRC (see emscripten site).
See needed.txt for some possibly useful scripts to package the output.
-
Run python -m SimpleHTTPServer 8888 in cube2/
-
Load localhost:8888 in your browser
If you append ,debug
to the URL of one of the levels, it will use
bb.debug.js
instead of bb.js
. The debug build has not been run
through closure compiler and is much more readable for stack traces
and profiling and so forth.
Code is zlib licensed (just like Sauerbraten):
Copyright (C) 2001-2012 Sauerbraten authors (see cube2/src/readme_source.txt) and BananaBread authors (see below)
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
- This notice may not be removed or altered from any source distribution.
BananaBread authors:
- Alon Zakai
- Gregor Koch
- Bobby Richter
New art content created for this project specifically is all CC-BY,
http://creativecommons.org/licenses/by/3.0/
If there isn't a specific license file alongside some content, then this is the license, so you can use that content freely.
Pre-existing content is mostly CC-BY or CC-BY-SA, see license files in specific directories. An exception is the character model, its license is sadly more restrictive (for now - we hope to fix that), see details in
packages/models/snoutx10k/
packages/models/hudguns/