[Kde-games-devel] [GSoC] First draft of proposal: Port a KDE Game to QML

Viranch Mehta viranch.mehta at gmail.com
Thu Mar 15 10:51:30 UTC 2012


Hi all,

Here's my first draft of the proposal for the project idea "Write a KDE
Game using QML".
(Its a long one :S) I'd appreciate comments/suggestions on it :)

*Name:* Viranch Mehta
*IRC:* viranch
*Project:* Port a KDE Game to QML

*Motivation:*

Games have been a part of the KDE since the beginning of the project
itself. It has accumulated and tailored an impressive selection of high
quality games across numerous genres and tailored them to satisfy the
entertainment demands of its users. The games being powered by the KDE
technology, have their own set of libraries too which make developing games
relatively very easy on the developer's part.

Qt 4.7 came out with a new module QtQuick with a declarative QML language.
QML enabled designers the showcase their designs with the declarative
language, reducing the gap between the designers and the developers. QML
was primarily focused for mobile devices for creating fluid like
interfaces. But it was quickly optimized for desktop usage too. The
Javascript integration allows complex logic computations to be done within
itself.

QtQuick being the next big thing replacing QGraphicsView at most places, it
was a very clear decision to have KDE games be also ported to QML from
KGameCanvas/QGV. QML, being a declarative language, reduces the amount of
code by a great factor, also reducing the maintenance costs. With a little
modification, these games can also be made suitable to be played on mobile
devices if desired so in future.

I have been working on various projects using QML and I have to say, I
really like it. It is simply one of the most intuitive and simple languages
and perfect for creating 2D games. I have a deep interest (and a little
experience) in user interface and interaction and in making them as
intuitive and simple as possible. I also have a liking for developing games
besides above, and this project seemed like a perfect one to spend a summer
on. For this purpose, I have chosen KBreakout, being one of my favorite
games, for porting to QML.

*Tentative Implementation Plan:*

First and foremost, a QML component would have to be written in C++ for
displaying the game elements from the SVGs in QML. The current game engine
manages the moving around of game elements by itself, depending on the
logic calculations applicable at the moment. The logic seems to be spread
out across classes for different tasks. While most of the logic would
remain as-is, the game engine will only accumulate all the logic, and pass
it on to the QML part. QML will basically be loaded in a QDeclarativeView
central widget in the main window. QML is where all the animation logic and
effects would go. So all the inputs will go from QDeclarativeView (throught
main window) to the game engine and the game engine will send back the
resulting reaction (if any) to the QML part.

The QML components would include the ball, the bar at the bottom, the
bricks, the gifts, the background and rest of the minor visual elements.
The logic related to bounce angles, ball speed, ball miss, game
pause/resume and other animations (referred from the current game engine) will
also go into QML (specifically, the Javascript part). Consequently, this
logic would vanish from the game engine.

*Tentative Timeline:*

I plan to start working starting early May and finish up with most of the
project, including the complete QML port by end of June.

*May 1-15:* Start reading up code and related documentation to figure out
the areas which need porting. Most of the agenda would be to discard the
KGameCanvas and replace it with QDeclarativeView, which loads a simple set
of QML files. Also identify the parts of the game engine that would land up
in the QML part.

*May 15-31:* Write the QML component for loading SVGs in QML. I used this
in Plasma widget, and can be taken straight off it. The little problem with
it is, it heavily uses the plasma library. With some help, I'll have the
component in ready and put in libkdegames. After that, the basic and static
view of the initial game would be done in QML, taking care of positioning
and laying out of items. Also, registering and responding to keyboard/mouse
events would be done in this time period.

*June 1-15:* Implement loading the levelsets from XML via the game engine
into the QML. Once the levels are loaded correctly, game play can be
started. So the parts identified previously from the game engine relating
to the game logic would start being ported to QML's bundled Javascript.
Make sure the bouncing and breaking of bricks occur on time and there is no
glitch in the animations.

*June 15-30:* Make sure all the keyboard/mouse inputs are correctly
accounted for. Update the score at appropriate times. Make sure the move
across levels is smooth enough without any visual bugs. Fix other bugs and
have the game majorly reviewed by the mentor.

*July 1 onwards:* Discuss and identify how libkdegames can be evolved to
more support the games in QML. Also look into small feature requests/bug
fixes in the ported game.

*Other obligations:*

I am in my final year of college and I am joining a job starting July 1,
2012. My college finishes in the last week of April. Being fairly
experienced with QML and KDE development, I can assure that I would finish
up with the project within the months of May and June as described above. I
would still have enough spare time after that for discussions on how
libkdegames can be changed to accommodate and facilitate the porting of
various other games in future, as is also desired by the project idea.

*About me:*

As I just mentioned, I'm a final year under-grad engineering student from
DA-IICT, India.

I have been a GNU/Linux and KDE user since 3 years now and have fair
experience with software development. I learned Qt about 2 years ago and
fell in love with it. Working with Qt since then, I have worked on numerous
projects[1].

My first QML project was at a summer intern with a comapany in which I made
a coverflow-like movie browser, where a user can browse through a
pre-loaded list of movie covers flowing in a manner similar to the popular
coverflow. I have also been a part of GSoC 2011 with KDE Plasma and since
working on porting the plasma widgets to QML[2]. I'm also working on my
final year project at college involving a LAN game for  the card game
Contract Bridge[3] in QML.

Apart from these, I'm a python/bash scripting enthusiast automating most of
day to day tasks.

*Links:*

[1] http://github.com/viranch/
[2] http://viranchmehta.wordpress.com/category/kde/
[3] http://viranchmehta.wordpress.com/2012/02/16/bridge/


Thanks,
Viranch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20120315/3feac879/attachment-0001.html>


More information about the kde-games-devel mailing list