[Kde-games-devel] Improving theme authoring for kgoldrunner

Luciano Montanaro mikelima at gmail.com
Fri Oct 30 14:34:23 CET 2009


On Fri, Oct 30, 2009 at 9:31 AM, Ian Wadham <iandw.au at gmail.com> wrote:
> Hi guys,
>

> I guess what has been at the back of my mind in this discussion is the
> programming effort.  It seems to me the above proposal would require a
> refactor/rewrite of much of the graphics code, because that code has
> already been worked upon many times by at least four people and is
> now a bit messy.

Well, I'll have another look at that, however one of my first
contributions to KGoldrunner was to provide a Teme class, which does
-- or should do all the theme loading. So it should be a simple matter
of changing the theme loader, and "everything should magically work".
:)

Actually, I'd like to go further in this direction, and have the theme
class responsible to generate the level background.

> Speaking personally, I am not in a position to put in
> that effort (see below) and I think maybe you will be spending some time
> on the Gluon project, Luciano, judging by the news from Munich ... :-)
>

Eh, yes. I should. But I'm in a position to be able to work only on
the Audio and controller part, since I have no usable OpenGL card at
the moment.

And how better to test KAL than trying to use it as a backend in KGoldrunner? ;)


> http://www.kdenews.org/2009/10/28/gluon-sprint-wrap
> Great shot of you BTW, Luciano!
>

>>
> IIRC Eugene was against the split between Actors and Set a while back,
> but maybe he has changed his mind.

Yes, that's why I've CC'd him, to be sure to have some feedback from him...
and yet he eludes me! ;)

>
> Further splits of SVG files also concern me a little, because I do not see
> how an artist will be able to maintain color balance and contrast across
> multiple files.

I tend to create a color palette for my own use. But my graphic style
tend to be on the minimalist side.

> KGoldrunner is rather sensitive to these things because
> the tile-layouts in the levels vary visually so much and the figures move
> around so much.  It has been all too easy to lose sight of enemies, gold
> or even the hero against some backgrounds and layouts.
>

Well, I want to load files separately, but you still can import the
other graphic sets in your vector editor anyway.

>> The hero, enemy and gold-enemy have exactly the same frames, and could be
>> swapped just by renaming them. We could have, for example, the Hero Mummy
>> chased by Evil Adventurers!
>>
>> And we could make a monster just by copying over the mummy file, and
>> changing the head to an Anubi mask...
>>
> Good points.
>
>> MyTheme.desktop should be changed in this way:
>>
>> Add a VersionNumber, so the theming engine can change loading strategy
>> Remove the Set and Actors fields, and replace them with a ThemeFolder field
>> where the theme element are stored.
>> Maybe it would be useful to add
>> NumberOfBackgrounds=n
>> NumberOfTilesets=n
>> NumberOfEnemySets=n
>> and
>> NumberOfMonsterSets=n
>>
>> It is not needed -- the game could simply try to load a new set, and if it
>> is not available, wrap the counter around, but it may be useful to know if
>> it's possible to cache the theme graphics.
>>
> Heh!  In the mod to reduce the number of SVG loads, I programmed the
> loadSvg method to save numbers like these in KConfig, so the KGrTheme
> class could pick them up and know how many bricks, gold variants,
> ladders, etc. to ask for from the cache for each theme.
>

Oh, I see. Well, then why not changing the theme loader to check for
fields in the .desktop file before? We have few themes, and it
wouldn't so much work to add the needed fields there. Maybe we could
add a small script to update the fields from the graphic files when
the svg changes.


>> <snip> <change of topic>

<snip>lots of interesting points</>

>
> So this is why I do not feel in a position to do yet another rework of
> the KGr graphics.

Oh, I can understand that. I was not trying to burden you with more
work, I assure you.
I just wanted to test the waters before doing that myself.

> Instead, I feel inclined to work on parts of the code
> that are less dependent on libraries ...  What worries me is that I am
> getting older (71 now) and one day will be unable to "maintain" KGr
> any longer, so then it will go onto the scrapheap and my dreams
> will die ... :-( ... :-(> ... :-(>>>

You've done a great work so far, I'm eager to see more for years to come.
But try not to get in trouble with your wife for the sake of
KGoldrunner, that's a bit extreme! :)

Cheer up,
Luciano



-- 
Luciano Montanaro

Anyone who is capable of getting themselves made President should on
no account be allowed to do the job. -- Douglas Adams


More information about the kde-games-devel mailing list