Author Topic: Dammen is the board game draughts for Windows / BSD / Linux Systems  (Read 1057 times)

0 Members and 1 Guest are viewing this topic.

Software Santa

  • Administrator
  • *****
  • Posts: 4281
  • OS:
  • Mac OS X 10.9 Mac OS X 10.9
  • Browser:
  • SeaMonkey 2.32.1 SeaMonkey 2.32.1
Dammen is the board game draughts for Windows / BSD / Linux Systems (dammen is the dutch word for draughts)

About dammen

dammen is, as stated above, a software program to play the board game draughts. It is equipped with a simple gtk-interface and a surprisingly capable (if I may say so) a.i.

dammen was originally conceived when I found myself with some spare time on my hands and I decided to combine two of my hobby's: programming and draughts. I figured I could try to program a draughts board which had knowledge of the rules and could tell you what moves where legal and what moves where not. After some time I indeed had a program which displayed a draughts board on which you could move the pieces around and could tell you all the legal moves you could do. From there I decided to equip it with an a.i.-opponent, and I learned it some basic tactics of draughts.

When I had programmed an a.i.-opponent with some knowledge of the tactics I tried it and found it actually hard to beat. That's when I decided I was proud of myself and I wanted to share my creation with the world, resulting in this SourceForge project. I also hope to find some people who would like to help me improve it, because I feel that it still has a lot of room for improvement. Not just programmers, but also draughts-players (especially those who can beat this program hands down) whom I actively ask for advice and suggestion's in how to improve the a.i.

For completeness: dammen is free software which can be used, copied, modified and (re)distributed under the terms of the GNU General Public License. It currently runs on GNU/Linux and windows, but should also compile for other operating systems that are able to use the gtk+ and gtkmm libraries.
What has changed?

dammen is now in it's second releas (version number 0.2), and these are the changes since the first release.

    Fixed some bugs and programming errors. The program no longer occasionly crashes with a segmentation fault. Also fixed a memory leak (yes, a memory leak, I was truly ashamed of myself) and I also heavily increased the efficiency of the program by removing an extremely silly misplaced semicolon, to be precise in the file field/

    void Field::operator=(Field const &other)
      this->d_state = other.d_state;
      if(this->d_number != other.d_number); // this semicolon renders the if statement useless
        this->d_number = other.d_number;
        this->d_map = other.d_map; // expensive and unnesecarry

    How silly can your bug's get? I discovered this bug after running the program through a profiler, and fixing the bug heavally increased it's speed. Note that it didn't make it much faster since I used the gained efficiency to make the ai think 'deeper'.
    Fixed a bug concerning an inconsistincy between the program and the official rules regarding the promotion of a piece.
    You no longer have to click on every square your piece passes, you only have to click on enough squares to uniquely specify your move. See also section How to play dammen.
    General improvements to the artificial intelligence.


Before trying to install dammen, make sure you have gtk+ and gtkmm properly installed. If you're lucky enough to run GNU/Linux, you probably have them already already installed or you can easily install them through your distribution. For windows users I refer to this installer.

Download the file you think you need. Use the .zip file if you use windows, the .tar.gz file if you want to install from source and the .deb file for convenient installation on a debian-like system.
Building from source

For this you should check that, besides the runtime libraries, you also have the gtk+/gtkmm header files. For the rest it is simply unpacking the tar.gz file and running make. Note that the Makefile is build for use on GNU/Linux and GCC (even for creating the windows binary). For other system's you may have to adept the Makefile to your specific needs. Note there is no well defined rule for installation, but feel free to create a link in /usr/bin or on your desktop.
Debian (and similar)

For the convenience of Debian users (and similar systems, like for example Ubuntu) I have created a debian package. Just run as root dpkg -i <dammen>.deb.

Simply unzip <dammen>.zip in an appropriate place and run dammen.exe. Create some links (for example on your desktop) if you like.
How to play dammen

I assume you're already familiar with the rules (and numbering) of international draughts (because that is the form that is played here). If not, I refer to this site.

In dammen the human player always plays with the white pieces and the computer always plays with black. You can specify the move you want to make by first clicking on the piece you want to move and then on the field you want to move it to. In the message field below the numbers of the fields you have clicked will appear. If you have accidently clicked the wrong square you can simply click on some meaningless black square (that is, your clicks should not result in a legal move) until the numbers in the message field disappear (and "Illegal move" is displayed).

If you have to remove one of your opponent's pieces, you click on the piece that has to do the removing, and then on the field it will end up afterwards. Often you have to remove more than one piece.

Here you have to click on all the squares your piece passes, that is the squares 26, 17 and 6, in that order.

Not that since release 0.2 it is no longer always necessary to click on all squares the piece passes, you just need to click on enough squares to uniquely and unambigiously specify your move. In the above example, there is onely one legal move the white piece on square 26 can do, so you only have to click on square 26.

When you have made your move the computer will think about his and, when ready, makes it's move. Note that, especially in the 'hard' setting, this can take a while. Remaining is the meaning of the 'New', 'Open', 'Save' and 'Quit' buttons, but I hope they explain themselves.

Bugs, limitations and todos

dammen is still a 'young' program, and by far not perfect. Here is a list of thing's I consider wrong or incomplete about the program. Since release 0.2 the program, to the extend of my knowledge, no longer contains actual bugs besides the problem when you try to maximize the window. If you think you have found one, please inform me.

    The game becomes ugly and unplayable when you maximize it's window. This is where I should point out that this actually the first program I've written with a graphical user interface so my knowledge on this point is limited. If you know what could cause such such problems (and how to prevent them) please inform me.
    There is no easy way to undo your mistakes. In the future dammen may be equipped with a 'Go back' button.

    Note that there is an uneasy way to undo your mistakes. You can save the game and manually edit it using your favorite editor (it's saved in plain ascii text). I should mention that the parser for reading the file is very strict, and since manually editing your saves is just plain cheating I feel no urge to change it.
    You can only play with white and the computer always plays with black. It should be possible to play with black or to play against a human opponent.
    dammen is not completely compliant with the official rules. Officially, when you touch (click on) a piece, you have to move it. Because I feel dammen should remain a game, I decided not to implement this rule. Also, to be fully compliant with the official rules it should not be allowed to have the same arrangement of pieces more than three times in a game. Because this poses technical problems and I consider this an utterly unimportant rule (by the time you have reached that stage in a game you should already have concluded it is a draw) this is not implemented.

Beside these points I feel there is a lot of room for improving the artificial intelligence, and this is the main point at which I want to improve the game, and I actively ask help from others.