Quake 2 in HTML5
Add comment!April 2nd, 2010
A while ago I wrote a blog post about WebGL's first appearance in WebKit. Since then, browsers have continued to evolve at a rapid pace.
Earlier today, three Google employees released an implementation of Quake 2 that runs in your browser using HTML5, plugin free. Everything works: the sound, the AI, even multiplayer! I originally thought it was an April Fool's joke, but sure enough, I compiled it and got it up and running at about 30 FPS on my humble MacBook Pro. You can check out the source code here. A detailed writeup on how it was created can be found here.
Quake 2 running in Safari, without any plugins
This is by far the most impressive HTML5 and WebGL proof of concept that I have seen so far. It really shows the potential of the platform and with a little bit of work, someone could make a standards based "Quake 2 Live" service. It will still be a while before you will be able to run Overgrowth in a web browser without having to download and run it natively on your computer, but we are definitely getting there.
However, while demoing the best of HTML5, this app does show a couple of technical limitations that will need to be addressed by the browsers before Quake 2 can be played optimally.
There is currently no way for a browser to capture the mouse. Therefore, if you move the mouse off of the window, the application can't track it anymore, or if you hit the edge of the screen, you can't look any further in that direction. That is sort of problematic for a first-person shooter.
There is also no way to go fullscreen.
These features could easily be abused, which is why they don't exist yet. However, it is definitely possible for the web browser to implement them in a secure way, for instance, by asking the user if they would like to authorize the app to go fullscreen and capture the mouse.