Saturday, December 31, 2011

Games for the Next Billion

Catchy title right? Don't worry, content partly matches to that description... ;)

It seems that I quite often include videos in my blog posts. There is no reason to stray away from that habit now, so here's a video showing a beta version of "Smoke the Bugs!" game on N950 & N8:

By looking at the graphics, effects, dynamic lights etc. what you saw was a pretty average OpenGL (ES 2.0) game, right? Well yes and no... Yes, GLSL shaders have been used for the effects. But no, there is zero lines of OpenGL and in fact also zero lines of C/C++ in the game. It's all QML + GLSL + JavaScript.

To work on current Harmattan & Symbian devices, game uses Qt 4.7 with the shaders plugin. This is an okay-ish platform, as you see from the video: N8@680MHz runs at smooth ~60fps. But I have also smelled, tasted and floated in the sweet velvet of Qt5 and can tell you as a fact that it will be much better. With Qt5 & QtQuick 2.0, applications will get a healthy boost of performance, smoothness and possibility for even better effects.

Here is a short list of improvements QtQuick-based games will gain from Qt5:
- Performance: QML Scene Graph will render everything faster than Qt4 QGraphicsView-based renderer, especially when the amount and complexity of (animated) items rises.
- Performance2: New V8 JavaScript engine performs much better than the JavaScriptCore engine in Qt4. Also thanks to this integration work, there is deeper co-operation between QML and JavaScript.
- Smoothness: Qt5 moves rendering into a separate thread which makes UI feel much smoother.
- Effects: QtQuick 2.0 supports shader effects to make QML UI's much more dynamic. Using shaders with Qt4 is possible with the shader plugin as shown above, but Qt5 native support will be more complete.
- Particles: QtQuick 1.0 contains particles plugin but it's very basic when compared to QtQuick 2.0 particles. No game can survive without particles!
- QML features: There are additions in QML which will suit games very well like SpriteImage for sprite animations and PathAnimation & PathInterpolator to animate along a custom path instead of linear path.
- QtCreator: Had to mention this one still as the work done in QtCreator Qt5 integration, QML debugger & analyzer etc. will improve the developer (that's me) productivity.

Now look at the video again to see what the old 2011 QML looked like, add all the above improvements to it and use your imagination... For me it feels like Qt5 & QtQuick 2.0 can offer a great platform not just for applications but also for games. Billion or two, I don't really care... ;) Happy New Year 2012 Everyone!


Anonymous said...

Question is will we really see official support of Qt5 on N9...

I really hope this is the case...

Kaitsu said...

anonymous: I guess it depends how you define "official support".. I'm quite sure Qt5 will not be included as part of a future OS update, that's too big change/addition. But I'm equally sure that Qt5 will work fine on N9 and there will be prebuilt Qt5 packages for N9 available at some point.

Anonymous said...

Great looking demo. The idea behind the game seems a bit cruel though. Poor bugs, what did they ever do to hurt anyone!?

Kaitsu said...

Anonymous: Thanks! This is already addressed in the game with a note "No real bugs were hurt while developing this game. Let's leave it so and smoke them only virtually, thanks!". We should respect all living creatures, wouldn't slingshot pigs with birds either ;)

BTW: My 6 years old beta-tester gave a thumbs up yesterday. After 15 minutes of angry birds he asked "Dad, can I play that bugs game now?" Me happy =)