Disclosure: We are a professional review site that receives compensation from the companies whose products we review. We test each product thoroughly and give high marks to only the very best. We are independently owned and the opinions expressed here are our own.
Yesterday Google released a video of their engineers playing Quake II using Safari without using plugins. The Engineers used some of their 20% time to test the limits of HTML5. Their results were an HTML5 port of Id’s Quake II game engine! Normally I would not do a post on video games, but this game is programmed and setup to run via a web browser using HTML5. Run Quake II as the Google Guys set it up shows the potential of HTML5 and the future of web design. Running Quake II with HTML5 will only run on “modern browsers” such as Safari and Google Chrome.
So How They Do It?
They started with Jake2, a Java 3D game engine that is a port of GPL’D Quake2 game engine from ID software. They also used the Google Web Toolkit, WebGL, WebSockets, the Canvas API, HTML 5 <audio> elements, and local storage API to cross-compile it into Javascript. The results can be seen in the video above. They reached 30 to 60 frames per second on laptops! This may very depending on your hardware and internet connection.
How to Compile Your Own Version of Quake II for HTML5
In order to make Jake2 work, you will have to (source: quake2-gwt-port):
- Created a new WebGL based renderer
- Ported the network layer for multiplayer games from UDP to WebSockets
- Made all resource loading calls asynchronous
- Created a GWT implementation of Java nio buffers based on WebGL arrays (to be ported to ECMAScript Typed Arrays)
- Implemented a simple file system emulation for saving games and preferences using the Web Storage API
Google Engineer have mostly used Linux and Mac to run and build the code. There are six steps to follow.
- Install ogg vorbis and lame by running sudo apt-get install vorbis-tools and sudo apt-get install lame on linux. On a Mac, install MacPorts and then run sudo port install vorbis-tools and sudo port install lame. The tools are needed to convert the Quake II resources for the Web.
- Check out the code and change into the project directory (cd quake2-gwt-port).
- ./build-dedicated-server (will build the tools and the client and server code).
- ./install-resources (will download, unpack, and convert the original Quake II demo resources). Due to a glitch in our maven build files, you currently also need cp -r maven-build/server/target/gwtquake/war/gwtquake war. We are fixing this.
- ./run-dedicated-server [port] (will run the local Quake II server).
- Navigate to: http://localhost:8080/GwtQuake.html (or whatever port you specified to the server).
Final thoughts
After watching the video, I believe the game play was not as good as running the original, but it still looks good for what it is and the technology being used. As HTML5 evolves so will the quality of the work created.
What are your thoughts?
This is so unbelievable! I think the browser is really going to be the full replacement of all applications and it’s heading towards Google’s philosophy of Google Chrome OS… It’s definitely going to be that one browser which can open all kinds of applications by going to the desired URLs….