[Kde-games-devel] Sharing levels

Ian Wadham iandw.au at gmail.com
Fri Nov 16 22:21:27 UTC 2012


Hi onpon4,

Thanks very much for writing.  I am the author of KGoldrunner and
always happy to hear news of what KGr players are doing.

On 16/11/2012, at 12:45 PM, onpon4 wrote:
> I always thought it ought to be easier to share levels in KGoldrunner,
> since otherwise the level editor is kind of weak.

This takes me back a bit … :-) … to the very beginnings of KGoldrunner.
My children and I used to play Loderunner on an Apple IIC in the early
'80s and we used to challenge each other by composing levels for the
others to solve.  There was no problem sharing because there was just
one computer in the house and each player had their own floppy disk.

The levels my children composed back then are in KGoldrunner today.

Also, about once every year or two, people write to me saying they have
composed some levels, so I get them to send me a tarball of the games.dat
and *.grl files and away we go.  All those levels have been released with
KGoldrunner, but they usually require some editing - mainly to get the
titles and hints in line with KDE style and translation standards - and
they are all Championship level and mostly very hard.

So I will have a look at your five-year old brother's levels, because it is
time we had some easier ones in KGoldrunner … :-)

> So I wrote a script
> that will make it much easier by packing individual levels into their
> own files (Tar or Zip archives, or perhaps binaries) which can then be
> unpacked on another computer.
> 
> This is what I have so far. It's in Python, and it can either be used
> from the command line or from another Python script by being imported
> as a module:
> 
> http://lrforever.netii.net/games/grg.py
> 
> I chose to simply pack the necessary files into a standard Tar file
> with the extension ".grg" ("GoldRunner Game").
> 
> Other than being in the command-line, it works seamlessly. I packed my
> little brother's levels with it as a test, and there are no problems:
> 
> http://www.mediafire.com/?5n6cmnwvhip2pow
> 
> I would like to hear any comments about this script. Is there any way
> a form of this could end up in KGoldrunner itself?

Your script is very neatly written and I admire its use of comments, but
unfortunately I do not know Python well and KGr is written in C++.  So it
is unlikely that I can use it, I regret to say.

What you are proposing, essentially, is an export/import facility for the
Game menu and that is certainly worth me having a look.  I have also
thought of using KDE's GetHotNewStuff facility, but somehow I never
seem to get around to it.

KGr actually has two file formats.  The original one has the games.dat
file and multiple *.grl files for the levels, as you have used in your script.
This format is both playable and editable, but standard KDE tools
cannot extract text for translation from it.

The newer format is the "game_<prefix>.txt" format used in releases.
This is playable, but not editable at the moment, however it does
include tags that text-extraction programs need.  See examples here:

https://projects.kde.org/projects/kde/kdegames/kgoldrunner/repository/revisions/master/show/gamedata

That format has the game info and all the levels in one file, which is
also readable by humans (*.txt).

It would be nice to have a format that is readable to humans, playable,
translatable and editable - and has an entire game in one file …

There is a Shell script in the above repository, KGr2toKGr3.sh, that converts
editable format to release format, but it is rather hackish, does not do
a perfect job and is not released and installed with KGoldrunner.  I only
use it when someone sends me a tarball containing some levels.

All the best, Ian W.



More information about the kde-games-devel mailing list