[Kde-games-devel] KGame: A few questions
Inge Wallin
inge at lysator.liu.se
Sat Jul 31 14:54:42 CEST 2004
Hi there,
On June 30th, I sent a patch to kreversi that I thought made perfect sense. I
got a number of replies that confused me, and probably my answers to them
confused the other people. See
http://lists.kde.org/?l=kde-games-devel&m=108592221011540&w=2 for the
details.
The reason for the confusion was that I had just studied the code within
kreversi but was not aware of libkdegames in general and in particular the
KGame, KPlayer and associated classes. My patch made sense within kreversi,
but not in the bigger picture of KDEgames.
Oh, well... Since then I have studied up on KGame & Co, mainly by using
Martin Henis excellent documentation pages. I have also waited for the
release of KDE 3.3 before starting to work (not to mention having had a nice
vacation :-) ), but now I feel it is time go get going again so that I can
have something to deliver as soon as KDE 3.3 is released.
Anyway, I want to make Kreversi use KGame and I have a number of questions.
My focus in this is board games, so maybe some of the questions don't make
sense in a canvas based game. Feel free to expand your answers to fit in with
all type of games.
1. How up-to-date is Martin Henis docs? Is there anything that has changed
that makes the documentation out of date or even wrong?
2. There are two distinct meanings of the word "game":
a) an abstract entity that contains a number of rules, description of pieces,
description of the board, etc. (like "the game of chess") and
b) a game being played by a number of players at a certain time and place
(like "the game between Kasparov and Karpov at <date> in Helsinki").
My language, Swedish, has two distinct words for the two, and in my previous
game programs I have made distinct classes for the two usages. KGame,
however, seems to try to combine the two. Is this intentional? It would be
interesting to see some comments about this, since the usage of KGame seems
to be a bit confusing at times. (Maybe this is just me that isn't used to it
yet.)
3. Sometimes a game (in the sense b) above) can have viewers that should be
able to comment to each other about the game. Should this be implemented as
KPlayers, and, if so, what would be the best way to do it? The players in the
game shouldn't be able to see the comments, at least not until the game is
over.
4. If I want to analyze a game (in the b) sense), I might want to look at
variations, and then save them. This doesn't seem to be supported by KGame.
5. What game file formats are supported? There is a very general file format
for board games that is called SGF, the Smart Game Format. It would be good
if libkdegames got support for it. I am willing to provide the
implementation.
6. A case that makes the problem in question 2 above evident is this: If I
want to make a program that can act as a tournament director for a tournament
with network-based players, I will run into some problems. I think it is
obvious that it would be a good idea to separate the two meanings but others
might not think so. My question is: What are the general views on
refactoring / changing the API of KGame et al? Are the classes "done", or is
this work in progress?
Regards,
Inge Wallin
More information about the kde-games-devel
mailing list