QuakeLight, the Silverlight port of Quake, is coming…
In the first post about QuakeLight, many people were interested and some just couldn’t quite believe what they saw. I was pretty impressed myself and contacted Julien Frelat the man behind the scenes. He was more than willing to provide information on the story behind QuakeLight, the coding techniques and access to run the actual demo.
(And to save you the time of reading through the whole interview, a public demo is not available yet. This is a "When-I-have-free-time" project for Julien.)
I’ve recorded a video of the demo running on my machine and the text-based interview is available for your viewing and reading pleasure. "Shenanigans", although fun to say, is apparently not appropriate in this situation. Enjoy.
Hello, sir, please tell us a little about yourself.
I am Julien Frelat, a 31-year old french developer. In real life, I work as a project leader for a software company called Assima. We work on unique technologies to improve and accelerate the work of end-users in companies (training, performance, translation…). In my very little spare time, I work on emulation and videogame software projects (InnoveWare Solutions). I am the author of several emulators including BoycottAdvance, a famous Gameboy Advance emulator that was able to run games even before the console was available in the US or in Europe. I also developed demos and a 3D game (Space Racer) several years ago.
Where did the idea for writing Quake in Silverlight come from?
I saw the leaked video from Adobe MAX 2007 showing Quake in Flash running in fullscreen (they cross-compiled the C code into Flash bytecode and plugged a few AS3 functions). Since I was curious about Silverlight (as an alternative to Java), I wanted to experiment with it. To my great surprise, a quick port of an emulated Z80 arcade game in C#/Silverlight was running about 2.5 times faster than the same code in Java. Given this, I decided to attempt a Quake port.
When you released the first demo video, some people couldn’t believe it. What’s the secret? Is this all custom code?
I first tried automatic conversion tools and ended up doing the job myself, abstracting highly-optimized C code into C# classes. I did not use any existing 3D engines, apart from the original Quake code. So you can say it is custom ported code 😉
From a technical perspective, I was not really convinced by other 3D experiments in Silverlight (Kit3D or Balder for example) so I turned to a traditional pixel-per-pixel 3D engine (they use scanlines in Quake and a simple Z-buffer). The keypoint was to heavily optimize the bitmap rendering and blitting. I think I reached the limits of what it is possible to do in Silverlight at this point.
It sounds like you’ve had previous experience writing games. How does Silverlight and C# compare to previous projects?
I wrote several C/C++ handheld emulators (Neopocott, Boycott Advance) in the past and then I decided to focus my work and experiments on Java projects.
I was especially interested in applets and I wanted to see full applications or operating systems running straight in a Web browser (RIA are not far from this now).
Java is a good platform but there are several drawbacks to port or develop emulators: lack of signed/unsigned types, no jump tables, no gotos, no good development environment prior to Eclipse…
I think I adopted Silverlight in a matter of few hours: a powerful language that supports exactly what Java was missing, very fast development and debugging in Visual Studio, a powerful API ala Adobe Flash, a tiny plugin to install, and very good performance.
Of course, we are only at the second release of Silverlight and there are important missing features for people developing games or emulators. No raster bitmap support, no dynamic sound generation means you need to find some tricks (use images and transparent images for tiles and sprites, encode sounds in mp3, etc.).
I am pretty sure Microsoft will extend the set of WPF features supported in Silverlight in the future (WriteableBitmap, 3D api…) and I am convinced Silverlight will become a great platform for demos, games and rich applications in general.
I want to emphasize that QuakeLight was developed in about three weeks during my holidays, given that I was babysitting/watching my son in the meantime… So you can code in Silverlight very quickly and very efficiently!
We’ve seen the demo of the game now, what’s left before we can play it?
I need to finish the 3D engine as there are still clipping issues left that prevent me from displaying correctly the main player weapon.
Regarding the game engine itself, you must be aware that id Software created a Quake C compiler. This is actually precompiled code with opcodes interpreted in the C code.
I have to implement this Quake-C interpreter and handle everything related to it (memory, stack, variables). This is very similar to interpreter cores used in emulators. This may be a long task.
There are other developments planned: add sound support (mp3), try network support for multiplayers. It really depends what it is possible to do with Silverlight.
Optimizations would be interesting too, to have a higher framerate for higher resolutions. As a reminder, the original Quake game was heavily optimized with assembly code (only a few cycles needed for a texel) and there are many optimizations not applicable here (especially no unsafe code is possible due to security reasons in Silverlight).
On the other hand, nowadays strategies could be interesting like a multi-threaded rendering to benefit from dual or quad-core processors.
What next from InnoveWare after QuakeLight?
I would say Quake II logically, as the source code is very similar. With this first Silverlight experience, I could also work on tools or libraries for similar developments.
This could be a 3D library, a graphics library, an emulation library… Maybe I can work again on emulator projects (Silverlight running Silverlight ?)…
As you can see, there are endless possibilities and it also depends on what Microsoft has in the hat for Silverlight 3.0.
I created a poll on the InnoveWare web site to see what people would prefer as the next InnoveWare project. 3D is the great favorite as for now (a sign for Microsoft ?).
So, do not hesitate to vote!
Thanks for the interview Julien!
I’ve also posted a few QuakeLight screenshots if you’d like to check them out.