[Kde-games-devel] Create file archives with Qt/kdelibs

Stefan Majewsky majewsky at gmx.net
Thu May 15 21:53:01 CEST 2008


Hi,

in the recent talk about Nonogram on this list, there was some discussion 
about which archive formats can be used. I think this topic is worth its own 
thread. For those who have missed the discussion until now, I have compiled 
the most interesting parts at the end of this mail.

At first, why is this topic so important for me? I'm currently working on 
Palapeli, a jigsaw puzzle game (located in playground). By now, Palapeli is 
able to save games in its appdata directory ("appdata" as in 
KStandardDirs::locate). It would also be nice to have an import/export 
function to pack one or multiple games into a file which can be shared (just 
as an ordinary box of puzzle pieces; imagine for example Alice sending a 
holiday photo to Bob as a jigsaw puzzle).

With the "one or multiple games" I come to the point of packaging. (Actually, 
I would have come to it yet earlier because a game consists of two files 
currently, the game state and the image.) The best immediate solution for me 
would be some kind of class which takes a list of files and generates an 
archive (and the other way around for importing of archives). The question 
I'm asking is whether something like this is already available; Christian 
Ehrlicher said that there is something similar in 
kdesupport/kdewin-installer, but this is not a dependency I can build on, and 
I do not like to copy the code to the local Palapeli source tree ("local" as 
in "only available to Palapeli").

I propose yet another (mid-term) solution: a management class for the 
described kind of game data storages in libkdegames. The code in Palapeli is 
quite generic so it could serve as a basis for that (I'm mostly using UUIDs 
as filenames, and a garbage collection is available to remove resources of 
deleted games.)

I'm looking forward to your suggestions and opinions on this topic.

Stefan

> [Ian Wadham]
> I recommend you avoid the use of tar files.  The KDE game called
> KGoldrunner used to have an individual file for each level and these
> (100s of them) were packaged into tar files for release and installation
> in KDE.  That caused endless problems because tar works differently
> in different UNIXes and Linux and also depending whether you are
> untarring and installing as "root".  And nowadays KDE games are
> being installed in Windows and Apple systems ...

> [Tim Vollerthun]
> I'm glad you pointed out the problems with tar-files. I think I will go back
> to subdirectories with plain files. 

> [Christian Ehrlicher]
> 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/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20080515/9463a244/attachment.pgp 


More information about the kde-games-devel mailing list