Re: Missing games and levels in KSokoban?

Ian Wadham <[email protected]> Sun, 28 Aug 2022 12:18:32 +1000
Newsgroups gmane.comp.kde.devel.games
Message-ID <[email protected]>
Hi Friedrich,

> On 26 Aug 2022, at 10:38 pm, Friedrich W. H. Kossebau =
<[email protected]> wrote:
>=20
> Am Freitag, 26. August 2022, 09:02:56 CEST schrieb Ian Wadham:
>> One of the things I disliked about KSokoban, which I played in KDE 2 =
and KDE
>> 3 times, was that a new maintainer came along and replaced all the =
games
>> and levels with an entirely different set (called Sasquatch).

Actually Anders Widell was the author all the time in the early days. It =
was he who
committed the first release at
=
https://invent.kde.org/games/ksokoban/-/blob/401d353748defbbf9ccd9770ce386=
b8505a38873

He also removed the original levels and replaced them with Sasquatch =
etc. So I wonder
if he was motivated by copyright concerns when he did that. As you will =
have seen, the
provenance of the original levels is given in the AUTHORS file, which =
you edited a few
days ago.

Incidentally, here is the  original TODO file: I don't think it has =
changed much over the years... :-)

* Icon
* Help file
* Go to specific level
* Scores
* Save/restore
* Load levels from files
* Drag & drop movement

>> Although the
>> new levels were good, the earlier levels were nice because they were =
graded
>> from easy to hard and gave everyone, including little kids, access to =
the
>> game.
>>=20
>> I=E2=80=99ll have a dig through the repository in the next day or two =
and see what
>> the current situation is re sets of levels.
>=20
> Okay. Already saw that in the ML archive discussions and made a mental =
note,=20
> but with lower priority currently compared to theming.

The level files released by Anders were indeed text files, even though =
they were
always named =E2=80=9Clevel.data=E2=80=9D. They can be opened directly =
by vi and Apple=E2=80=99s Text
Editor on my MacBook Pro. They should probably have a .txt suffix these =
days.

The only =E2=80=9Cbinary=E2=80=9D or data-like feature is the occurrence =
of a line at the end of each level
that contains a single zero-byte. That is, of course, the =E2=80=98\0=E2=80=
=99 character or C-type string-
terminator. All those =E2=80=98\0=E2=80=99 characters could just be =
deleted, leaving the empty lines. Then
the whole =E2=80=9Clevel.data=E2=80=9D file would be easily parseable =
into games and levels as a multi-line
text file, thus obviating all that bin2c complexity that was in the =
original build.

FWIW that roundabout way of loading the game data was one thing that put =
me
and others off persevering with porting KSokoban to KDE4. It was hard to =
be sure
that it was just a workaround to avoid file I/O and not something more =
signifant that one
might risk breaking (IIRC file I/O was a bit ho-hum in KDE 1 and Qt1 =
days, so maybe
that=E2=80=99s why Anders used bin2c and #include to get the levels =
loaded).

I see that Shlomi got around the problem, when porting to KF5, just by =
keeping an
instance of the =E2=80=9Clevels/data.c=E2=80=9D file in the repository =
and removing the =E2=80=9Clevels/level.data=E2=80=9D
text-file.

Anyway, if you wish to recover/reorder any or all of the games, the two =
versions of
=E2=80=9Clevels/level.data=E2=80=9D just before the change over to =
Sasquatch and later to KF5 ought to
contain the most recent commits of all the text or text fragments you =
may need.

> Even more after I=20
> discovered https://ksokoban.online which helped me solve levels where =
I first=20
> thought "this is impossible, the data or game must be broken" :P and =
was to=20
> give up working on reviving releases.
> (totally could understand also why people even filed bug reports =
against=20
> ksokoban about "level x is not solvable", as I later saw, could have =
been me=20
> :P)

That is one cool website, one of the best I=E2=80=99ve seen for playing =
a game. Simple,
direct and easy to operate. And what a joy to have a =E2=80=9CShow =
Solution=E2=80=9D option=E2=80=A6 :-)

>> Also, I think the game is a good one to have a Game Editor added.
>=20
> The author of easySok agreed there, I saw :) Too bad that app also =
stalled.
>=20
> Thought the few who would like to do levels can use a plain =
texteditor, as the=20
> supported level format is plain text based, no?

Yes, it is text, but probably not easy to edit and play. Experience with =
composing
KGoldrunner levels suggests that you need a visual editor and a quick =
way to
switch to =E2=80=9Cplay=E2=80=9D (and test) mode when trying out ideas, =
moving walls, re-positioning
treasure, etc. A lot depends on exact placement to change a level from =
easy, to hard,
to impossible. I think the same might be true in KSokoban. As time went =
on, guys
would send me KGoldrunner levels that were unplayable by me, so I added =
a feature
to record all moves and save them to a file, which could be renamed as a =
=E2=80=9Csolution=E2=80=9D
file. Then I insisted that game-composers supply such a file along with =
their levels.
The ingenuity and inventiveness of those guys has given me endless =
pleasure over
the years...

> See also
> =
https://docs.kde.org/trunk5/en/ksokoban/ksokoban/loading-external-levels.h=
tml
>=20
> The whole level loading and management support though needs an =
overhaul=20
> indeed, to make things more discoverable, understandable & usable.

Hear, hear!

> Would be my own next target after theming, together with bringing back =
those=20
> lost levels where possible. But only later this year, or early next. =
But agree=20
> this is a rather weak spot.
>=20
> And having a dedicated separate editor for easy level design would be =
neat. As=20
> well as integration with online communities already collecting & =
managing=20
> levels. But that is a lot of work I do not see myself currently having =
time=20
> left for, TODO list already full :)

Well, it=E2=80=99s great that you are working on all this, Friedrich.

All the best.
Ian W.