48 hour chess

Discussion of chess software programming and technical issues.

Moderator: Ras

mike_bike_kite
Posts: 98
Joined: Tue Jul 26, 2011 12:18 am
Location: London

48 hour chess

Post by mike_bike_kite »

I thought I should introduce myself and my little chess program. I've programmed many games before in the past but only recently had a go at chess. My program is a java applet so it has to be reasonably small so it has no opening book or end game db. It's more of a fun chess program than something aiming to be the next world champ.

It currently process around 30k nps and uses a combination of tactical and strategic evaluation. It's current playing strength is around 1650-1750 (my guess) depending on the type of game. I have hit a few issues and was googling for ideas when I found this site.
  • 0) How do I ensure that the program is playing better after each change I make?

    1) The program can get stuck in some positions. It's ahead but it needs to sacrifice material etc to break through. Obviously a deeper search would help but are there any techniques for spotting that a change in plan is required. At the moment it just moves it's king back and forwards hoping for divine intervention.

    2) 30k nps is ok but it's not allowing me to look deeply. I'm currently looking into different ways of extending the search on exchanges. I'm also trying to understand the concept of null moves to improve alpha beta pruning but it's a bit uphill at the moment:) I also wondered about widening (?) the alpha beta cut off point so it just ignores anything that's even remotely close to the current best score. Ideas?

    3) I'm also looking for a new name for the program - I guess "fun chess" has been taken.
Any feedback would of course be welcome. I'm certainly not aiming for world class play but it would be nice if I could achieve anything close to a 2000 rating but I'm quite a way off at the moment.

Mike Robinson
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: 48 hour chess

Post by hgm »

First I want to congratulate you with your applet; I played it, and it was really nice. "Fun Chess" would be a very applicable name. 8-)

To ensure changes are beneficial, people usually play test games. To make sure to get a significantly large number of independent games, (likea few thousand), one either uses an external book randomly forcing the first 10 (say) moves into the progam, or plays aganst a large number of different opponents (or one that randomizes its play sufficiently).

Of course it is not easy for you to do any of this as long as your program is stand-alone, only able to play through operator-assisted input. It would therefore be very helpful if you could isolate the IA of your program from the GUI, and make it into a simple console application that interacts in one of the standard protocols (WinBoard or UCI). You can then automatically test against any of several hundred opponents, using a GUI like WinBoard or Arena, selecting those of a strength that makes for meaningful testing.

This is not really hard, as for automatic testing usually a very small subset of the protocol suffices: e.g. for WinBoard protocol all you would need is to understand long-algebraic moves on input, and print moves prefixed with the word "move" on output. And then react to the commands "new" by setting up a new game and the engine to play black, "go" by setting the engine to play the current side to move, and "force" to have the engine not play any side at all, but just accept moves (until it receives "go"), for setting up a position from an external book handled by the GUI. That is really all, I think. (Although reacting to "quit" would also be decent.)

For an example of a (very elaboate) driver for WinBoard protocol, see http://www.open-aurec.com/wbforum/viewt ... 24&t=51739 .
mike_bike_kite
Posts: 98
Joined: Tue Jul 26, 2011 12:18 am
Location: London

Re: 48 hour chess

Post by mike_bike_kite »

Thanks for the encouragement!

I looked at the interface, obviously it's in C rather than Java, but I still couldn't see where I read the moves from - is there a html interface? Could I run a Java application on my PC at home and communicate via this interface or is it specific to C?

I've just released a new version of the program (9.6) and it seems to be playing a fair bit stronger now.
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: 48 hour chess

Post by hgm »

The moves are simply read from the standard input, and written to the standard output, like any simple text application that you run in a command-prompt window. When used in a GUIlike WinBoard or Arena, the GUI starts up the engine process, connected to it through (two-way) pipes to communicate with it; the engine does not have to be aware of any of that at all.

The code of the WinBoard driver is just an example of what you would have to put in the engine in stead of its own GUI.So in your case you would have to translate it to Java. (Or at least the part of it you need; many commands would not be useful for automatic testing.)
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: 48 hour chess

Post by Adam Hair »

Hi Mike,

I would just like to add that if you choose to make your engine WB or UCI compatible, you can get help from others in regards to testing.

I played against the program last night and found it to be a good opponent for me.

Thanks,
Adam
User avatar
Sam Hull
Posts: 5804
Joined: Tue Mar 14, 2006 9:19 am
Location: The Cherokee Nation
Full name: Sam Hull

Re: 48 hour chess

Post by Sam Hull »

mike_bike_kite wrote:3) I'm also looking for a new name for the program - I guess "fun chess" has been taken.
Cool program with a pleasant and intuitive interface - nicely done! A suggestion would be to display the next choice instead of the current one on the appearance options menu.

1) Mikrob
2) Latte
3) Krakatoa (you know ... East of Java)

;-)
-Sam-
mike_bike_kite
Posts: 98
Joined: Tue Jul 26, 2011 12:18 am
Location: London

Re: 48 hour chess

Post by mike_bike_kite »

Thanks for the comments.

You're right about the next choice buttons for appearance. I'll put this in.

Names are difficult things though:
  • *Mikrob sounds interesting and Russian (so good for chess) but I suspect would get forgotten by users.
    *Latte - oddly every other program in Java gets called Latte - I even once produced a database system for a bank called Latte.
    *Krakatoa - again sounds interesting but I'm not sure people could spell it and it leaves a nasty suspicion that the program will blow up at some point in the future .
:)
User avatar
Sam Hull
Posts: 5804
Joined: Tue Mar 14, 2006 9:19 am
Location: The Cherokee Nation
Full name: Sam Hull

Re: 48 hour chess

Post by Sam Hull »

mike_bike_kite wrote:Thanks for the comments.

You're right about the next choice buttons for appearance. I'll put this in.

Names are difficult things though:
  • *Mikrob sounds interesting and Russian (so good for chess) but I suspect would get forgotten by users.
    *Latte - oddly every other program in Java gets called Latte - I even once produced a database system for a bank called Latte.
    *Krakatoa - again sounds interesting but I'm not sure people could spell it and it leaves a nasty suspicion that the program will blow up at some point in the future .
:)
Well, you got those suggestions because Mikerob sounds like a Japanese beer, Cappuccino is too long, and, well, Krakatoa is west of Java anyway so forget that one. Prism came up in another thread, for clarity and color; or you could go with 2week, for your total development time. Or call it Anabax, which in Greek loosely means no table (my personal favorite).
That's it - I'm out.

;-)
-Sam-
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: 48 hour chess

Post by tpetzke »

Hi Mike,

very nice interface. It's fun to play with it.

For improving its strength you can have a look at that position from my game

[d]r4r1k/p3Nppp/5n2/1NP5/8/Pb1P4/1P3PPP/R1B1R1K1 b - - 0 1

Your engine with black played .. Rfb8 ? which loses the rook in the corner right away after Nc7. When you check what let it play that rook move you might find a bug in your search code. As this requires only a shallow search it should not be caused by horizon effects.

Thomas...
mike_bike_kite
Posts: 98
Joined: Tue Jul 26, 2011 12:18 am
Location: London

Re: 48 hour chess

Post by mike_bike_kite »

I've just released a new version (10.1). It has better a bit better graphics, more functionality and doesn't make the same mistakes though sadly it makes entirely new mistakes. I intend tuning out the issues by getting it alter it's own weightings and just play itself again and again until it becomes obvious where the issues are. It also does an ID based search on time.

I included your suggestions re the appearance buttons Sam - that's definitely an improvement. I'm currently thinking of naming it FunChess as it really doesn't play that strong but it is kind of fun to play against.

New version at same old web url.