views:

188

answers:

3

Hello,

I'm looking for a program or library that I could use for experimenting with board games (chess mostly, but not necessarily -- other similarly complex board games are OK too). I'll test different game-playing algorithms.

This is what I need:

  • I'd like, if possible, to make my program play against players like gnuchess and crafty, but also against itself and against a human player;

  • It's OK if my player-program can communicate with the "server" via TCP, but it would be even nicer if it had a C interface (not C++, because then I'd have to write a wrapper);

  • I may want to change the game rules (initial position of pieces, number of pieces, and even movement rules);

  • Flexible (it's OK if the library/server validates chess moves, for example, but I'd like such feature to be optional because I will want to turn it off for some experiments);

  • Free (I may want to get into the source code and maybe change a few bits).

I'd be grateful if anyone could point me to such a library/server...

Thanks a lot!

P.S.: I wanted to include a "board-games" tag, but it seems that I'd need more reputation for that...

P.S. 2: I'd like to accept two answers (they're complementary). It's a pity StackOverflow doesn't allow that.

A: 

I'm not sure something like that exists yet.. by the way most of these topics are quite easy to develop by yourself:

  • vs player: just implement imput (you can use something simple like ncurses)
  • vs CPU: these games are called perfect information games and you can easily structure an AI with simple algorithms like minmax trees or negmax
  • to allow changing of rules it's more simple to hard code them (since every game could have its really different rules
  • for TCP support you should need to codify moves and separate GUI part from server part

If you are not going to test it with a large amount of different games projecting something really extendible (like an engine) will be a waste of time. Just concentrate on modifiable parts and program them wisely..

Actually some parts don't need to be generic: plan a good game protocol and then just care about events like unallowed move and similars..

Jack
+2  A: 

VASSAL is a cross-platform engine for playing board and card games over the internet. It is designed for allowing humans to play each other, but it is extensible enough you could add an AI player.

It is open-source and extremely customizable, people have created original games using it.

Dour High Arch
Um, I thought vassal had no game rules programming. Am I confusing it with something else? I thought vassal gave you game pieces and you played the game exactly as if the pieces were physical. That is not very conducive to AI programming.
jmucchiello
+1  A: 

The XBoard protocol is the standard used between chess engines and graphic board front ends. It is plain text: as far as I can say there is no library.

Although seems complicated, the implementation is quite straightforward: a really small subset is needed in order to develop an usable application. The doc usually refers to the chess engine, but the same applies to the client side (reversing the side).

Hypothetically you can have the same connectivity of XBoard/Winboard, depending on how much protocol has been implemented. If you need some code to inspect, other than the classic Eboard and Xboard, there are a lot of examples around the web, and I mean really a lot of (it is a list of chess engines, but someone of them, such as babychess, is also a GUI frontend).

ntd