[Kde-games-devel] [OT] Tar (was: Re: Game introduction: Nonogram)
Tom Vollerthun
Vollerthun at gmx.de
Wed May 14 10:53:54 CEST 2008
Hi,
> If I understood Tom correctly, there is only one file per tar-file.
> Is this correct?
No. I thought it would be nice to have several games per package, so that you could have a package "The Beatles" with games that result in images of each of them. If you have one puzzle per Beatle, you'd end up with four "levels", each of which should have a name, a hint and a description/license/whatever/...
Current design would have these four game-files plus the corresponding description (plus translations?) in a gzipped tar file. This tar file is discovered at runtime and accessed via the KTar-API of kdecore.
I don't care too much about which package format to use or having the stuff packaged at all. I'd do as is easiest to port and translate.
>
> You are using xpm files for the levels? This is perfectly the choice if
> you want to integrate the levels into your code (since xpm is indeed
> compilable C code), but since you seem to load them dynamically,
> I would suggest using PNG.
I don't want to have the levels within the code. I see KNewStuff-integration fitting perfectly for user-provided games and packages, so it's necessary to have dynamic loading of the games.
But I don't care about the file format. The game is designed to have different loader-backends, so providing support for another format isn't too difficult, although the XBM-backend is yet the only one.
Currently the XBM-files are loaded into a QImage anyway, so if QImage can load PNG as well, there's no need to stick with XBM.
In the long run, I'd switch to some to-be-specified xml-format that doesn't disclose the result of the puzzle, so cheating isn't as easy :)
I chose XBM because at Ali Corben's blindchicken-site, there are lots of games to be had and they are in XBM (yes, I asked him about the license: he said it's public domain, but it would be nice to be mentioned somewhere).
Kind regards,
Tom
>
> 2008/5/14 Christian Ehrlicher <Ch.Ehrlicher at gmx.de>:
>
> > > Von: "Tom Vollerthun"
> > > Hi Ian,
> > >
> > > I'm glad you pointed out the problems with tar-files. I think I will
> go
> > > back to subdirectories with plain files. But that _will_ result in one
> > file
> > > per level, since I (currently) use image files (p.e. xbm) as game
> data.
> > I
> > > don't really care about that, but since you said I wouldn't want it:
> > what's
> > > the downside of having three hundret small files instead of one large
> > > (except of using more I-Nodes in the file system and causing a small
> > amount of
> > > fragmentation) ?
> > >
> > I wrote a small QIODevice-Wrapper for tar which can read and write files
> > from/to tar files. It can be found here:
> >
> http://websvn.kde.org/trunk/kdesupport/kdewin-installer/3rdparty/filters/
> >
> > We use it in our kdewin-installer to unpack .tar.bz2 and it works fine.
> I
> > must say that this class only a small subset of tar - it can read tar
> files
> > created by linux tar but don't know about others (imho there are more
> than
> > five slightly different tar formats). But this can be fixed if needed.
> >
> >
> > Christian
> > --
> > 249 Spiele für nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro.
> > Neu: Asterix bei den Olympischen Spielen: http://flat.games.gmx.de
> > _______________________________________________
> > kde-games-devel mailing list
> > kde-games-devel at kde.org
> > https://mail.kde.org/mailman/listinfo/kde-games-devel
> >
> >
--
--
Computer Science is no more about computers
than astronomy is about telescopes.
Dijkstra
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
More information about the kde-games-devel
mailing list