[Kde-games-devel] aKademy 2006 BoF session ideas
Ian Wadham
ianw at netspace.net.au
Tue Sep 26 03:16:27 CEST 2006
From: "Mauricio Piacentini" <mauricio at tabuleiro.com>
Sent: Monday, September 18, 2006 7:06 AM
> http://wiki.kde.org/tiki-index.php?page=KDEGames+%40+aKademy+2006
>
> I started the page with some ideas collected in the IRC #kdegames
> channel during the past week.
>
I'm hoping someone will see this before the KDE Games BoF session
in Dublin on Wednesday. It relates to QGV performance and the
proposed new lightweight Canvas class.
At the moment, KGoldrunner is the only game that has encountered
performance problems with QGraphicsView and so is using the new
class, though I suspect the KDE Education application KStars may
be in difficulty (it's a desktop planetarium application) and it might
be a good idea to contact KStars' author if he is at aKademy.
I have just been trying one of Andreas' suggestions with the QGV
version of KGoldrunner, which was to scale the background tiles
and frames for the running men before any drawing is done, rather
than scale the whole view. I am still using QGraphicsPixmapItems
for all the tiles and runners, leaving the QGV Background blank
and untouched (using the QGV Background has overheads when
a tile within it has to be re-drawn, as Mauricio found).
Unfortunately I have hacked at the code, due to lack of time, so the
scene, view and border do not coincide as they should ... ;-( But
the game itself works OK with QGV, using the above approach.
Performance is fine on levels 2 and 25 of the Initiation game, the
levels that gave the most trouble. CPU usage (at 2.4 GHz) is about
3% on level 2 and 15-20% on level 25. QTimer events are coming
in, on average, about 5 msec slower than requested, but are never
more than 10% late. I am still seeing (in my log file) massive
re-draws of all tiles within a large bounding rectangle whenever
widely separated runners have to move simultaneously, but
because the re-drawn tiles do not have to be re-scaled on the fly,
we never hit 100% CPU, so the timing remains on schedule, give
or take 10%.
I'm still using Qt4.2.0-snapshot-20060830.
Performance with the new Canvas class is still much better than
with QGV (in that Qt snapshot), making the game playable on much
slower machines than mine. However, Andreas has hinted at some
changes in QGraphicsView and X11 that might, in time, alleviate
some of the difficulties KGoldrunner has had with QGV.
So I'd like to stay with the new Canvas class in KGoldrunner's
SVN code and await further developments from Trolltech. I won't
do any further work on the QGV version of KGoldrunner right now.
All the best, Ian W.
More information about the kde-games-devel
mailing list