[Kde-games-devel] KGoldrunner

Luciano Montanaro mikelima at gmail.com
Thu Aug 9 20:38:35 CEST 2007


(I write to both the list and you because the list uses to think I'm trying to 
spam it) 

Il Thursday 09 August 2007 19:24:39 Parker Coates ha scritto:

> I'd like to urge you to rethink the above proposal to separate
> graphics across multiple files and to implement theme inheritance. The
> way I see it, it is over complicating the situation without any great
> benefits.
>
> Due to the nature of SVG files, I don't think pulling from multiple
> files or inheriting sprites from other themes is going to make theme
> development simpler. I whole heartedly agree that creating new
> animated sprites is a huge task, but I don't think they need to be
> moved to a separate file to encourage reuse simply due to the concept
> of copy and paste. I assume all themes are released under a
> sufficiently free license, that wholesale copying of of game elements
> would be permitted.
>

The problem is not the license, but rather, the way we use the svg files, and 
the limitation of inkscape, the tool we use to edit it.

> Theme "inheritance" can happen naturally with SVG. "Hey, this default
> theme is pretty cool, but it'd be cooler if it was more piratey. I'll
> just make a copy of default.svg and rename it to pirates.svg. I'll
> replace the background with a sand and palm tree scene. Then I'll
> replace the bricks with wooden planks. Easy. But replacing all those
> running men with new graphics is going to be way too much work. What
> if I just added an eye patch to each of the frames. Not bad. I'll do a
> beard too. Now a hat. What if I replaced one leg with a peg?" And so
> on.
>

The problem is that by copying stuff from one svg file to another, the items 
are relabeled (the ids are regenerated) so they have to be recreated for each 
frame. Moreover, the current runners use a clever trick, where a "template" 
runner is drawn, whith body parts for legs, head, torso and so on, and the 
running frames are composed from references to these parts. It's quicker than 
having to draw  the parts independently over and over, even if it removes a 
bit of flexibility from the author. 

So if one wants to rebase the theme on a different runner set, the only viable 
way would be to start from the theme one prefers to use, and add the 
background graphics there. But if there are improvement in the runners for 
the base set, porting them over the new theme would be impactical.
As an example, I have done changes to the runners for the default set; I'd 
like to adapt them to the geek city set (if it's OK to Eugene); now I just 
haveto copy the default theme actors to the geek city folder and tweak the 
colors; with an unified theme, I'd have to do lots of renaming by hand. A 
possible compromise would be to have independent "source" files, and to merge 
them in one file with some script at installation time. But I'm not sure 
theme authors would agree this would be an improvement. 

> Another concern is performance. If static items, heros and enemies are
> spit into separate SVGs, three separate KSvgRenderers will be
> required. It's my understanding that loading SVGs into renderers is a
> pretty expensive operation. (But maybe three smaller SVGs isn't really
> that much worse than one large SVG? I don't know.)
>

I didn't notice any slowdown, going from one file to two.

> Anyway, the above is just my opinion. Maybe there are other advantages
> to your proposal that I don't see. I'm sure whatever is decided in the
> end will work fine, but I guess I believe there's just a certain
> elegance to single file themes.
>

Maybe, but with the current tools, it's not really practical, in my opinion.

Luciano

> Thanks,
>
> Parker





More information about the kde-games-devel mailing list