Monday, 28 May 2007

The future of SchafKopf

Someday SchafKopf has to be ported to KDE4. We all know that, but as of now, no one in the team has volunteered to do so (and no one else either).

One reason might be that we (Benni, Christian, Lenz and I) all agree that SchafKopf in its current state is not really maintainable. We hacked together a nice Card Game which is fun to play - but it is far away from the perfect Schafkopf implementation!

While driving home today, after I talked to Lenz over Schafkopf and Python I think it is time to start the discussion about what should be done with SchafKopf for KDE4.

My idea on how it should look - well this is most likely not even my idea but our idea that arose sometime - is the following.

  • We need a Schafkopf server process

  • Players can connect to this server

  • Human and AI players are implemented

  • The GUI connects to the server too

This has the following advantages. We can support different GUIs (Qt4, GTK, console and a web front end similar to all these online poker rooms - just for your favorite Bavarian card game). So we could write a simple Qt4 GUI (should go pretty fast because all logic is in the server) and have a KDE4 port.

The server can be implemented in another language than the GUI. As a reason we can choose a language that is maybe better suited for AI stuff than C++. My first idea was: Use Common Lisp! Two reasons: Firstly I wanted to learn Common Lisp and secondly it is famous for its usage in AI research. I even hacked together a small server in LISP. It understands the basic Schafkopf rules. You can look at the source if you want. It went pretty fast using Lisp, but it would need some work.

Well, talked to Lenz today and - even if he is a great Lisp fan - he thinks a server in Lisp has two big disadvantages:

  • Lisp is not very common on users systems. Users will have a hard time compiling SchafKopf

  • Only few developers know Common Lisp, so we won't get much code contributions

He suggested Python to be used for the server. Python is well known by many developers. We can code in a functional way where necessary, so we should be as fast as when developing in Lisp and python is available on almost every system.

What can I say? The guy in the black clothes is right! If we want to get a SchafKopf version for KDE4 with a clean source that is maintainable we should

  • write a SchafKopf server in Python

  • write a Qt4 GUI that connects to the server

Who wants to join me in this project? Any other ideas?