Category Archives: Chess

Updates

Lua Gtk Engine

I’ve been working on a Lua based scripting engine for Gtk themes. Right now it isn’t really useful without example themes and documentation, so I will write more about it later. If you want to try it anyway, get gtk-engines from CVS and configure with –enable-lua. It still needs some work, many widgets aren’t supported yet.

For the API I’ve tried to find a middleground between flexibility and simplicity. It is based on simple drawing functions with parameters, for example: rectangle {x=0, y=0, width=200, height=200, radius=3, filled=true, color={1, 0, 0}}. Most parameters are optional. It is possible to specify both colours and gradients (linear and radial) with arbitrary colour stops. The nice thing about passing parameters like this is that you can store and modify them in a Lua table, for example:

myrect = { x=0, y=0, width=200, height=200 }
myrect.color = {1, 0, 0}
rectangle (myrect)

There is also a shape () function which takes an arbitrary number of normal and bezier points to create any shape you want. A screenshot that shows most of the current widget coverage:

Lua Engine

Writing themes like this is a lot more fun, especially since you don’t need a recompile and restart anymore before you can try your changes. But most importantly users will be able to install Lua themes like any other theme via drag and drop, instead of having to install a new engine, just because they prefer their Clearlooks to have square corners… Performance seems to be completely acceptable so far. The difference is measurable, but almost neglectable compared to the actual drawing times. Lua is a scripting language that was developed with speed and size in mind, so it adds minimal overhead.

Chessmonk

For chessmonk, I decided to split up the chess board part into a separate package. Not just the display but also any chess logic will be contained in this package, so it will become easier to create different board window types. I got this idea when reading about a software called Chess Position Trainer, which is based on a similar chess board widget. This still needs a lot of work and isn’t functional yet, but if you are curious you can find it in the gtkboardview branch of the Subversion repository.

Chess Tournament

I didn’t dare blog about this before, because I assumed it must bring bad luck. 😉 I recently played a seven round swiss tournament in Krefeld and surprisingly was able to reach fourth place with a performance of over 2100 (Final Standings).

In the last round I had white against the third seed of the tournament (2060 DWZ). I didn’t really expect to win this game and reach the price ranks, but then it even became a nice miniature after my opponent made a mistake soon after the opening moves:

1.d4 g6 2.c4 Bg7 3.Nc3 d6 4.e4 Nf6 5.Nf3 O-O 6.Be2 e5 7.O-O Nc6 8.d5 Ne7 9.a4 a5 10.b3 Nd7 11.Ba3 h6 12.Ne1 f5 13.f3 b6 14.Nd3 Nf6 15.b4 axb4 16.Bxb4 Nh5 17.a5 c5 18.dxc6 bxa5? 19.Nb5 Be6? 20.c7 Qd7 21.Bxd6 Bxc4 22.Nxe5 1-0

Chessmonk goes Cairo

I rewrote the board view widget to get rid of the dependency on GnomeCanvas, now it only uses GtkDrawingArea and Cairo. In the process I “cleaned up” the animation code by making it automatically figure out all required animations between two positions and added piece fading and (optional) coordinates for good measure. Here is a little screencast showing it in action, of course being a gif it is not of high quality:
Board Widget Screencast

Chessmonk 0.1

Now that Chessmonk is actually very usable as a pretty PGN viewer, I decided to make a release with the intention to generate some feedback.

Get it here:

http://www.chorse.org/stuff/chessmonk/ (hosted by Patrick Schnorbus)

Requirements:

You’ll need recent PyGtk and gnome-python libraries. It also uses GnomeCanvas. Gentoo users, make sure you have the SVG loader for libpixbuf installed. 🙂

Screenshot (click for larger size):

Chessmonk 0.1

Mirage, Chessmonk Progress

Meanwhile I released a new theme and created a project page for Chessmonk on Google hosting, so it now has a SVN repository. If you are looking for a pretty PGN viewer, I strongly suggest you give it a try.

I’m not sure yet whether I will release 0.1 once I took care of the remaining quirks, or if I wait until it has a wider set of features.

Edit: Fixed the links, sorry!

On The Future Of Chessmonk

While I’m mostly doing polishing work (preparing for a first release), I’m getting a better idea about what I ultimately want to accomplish with the Chessmonk GUI. I intend to support the following tasks:

  • Viewing Chessgames – The most simple use-case, which is very straight forward. Opening and viewing PGN files already works. I also intend to add database queries in the future, so you can view a subset of your large reference database.
  • Analysing – Features I intend to add for this task are a free analysis mode, chess engine evaluation and positional database queries (like scid’s tree view).
  • Editing – The ability to enter new moves, variations, comments, etc. Also to save a modified PGN file or to import games into a database.
  • Book and Repertoire – Although I never used it, I very much like the simple philosophy of Bookup. It should be possible to manually evaluate a position in the database and use these evaluations in the positional database reference view. Especially when using back-solving (basically figuring out what’s the best evaluation when both sides play the best moves), this can be a lot more helpful than simple result statistics. Additionally I want to allow the user to flag every position as belonging to his opening repertoire, so the program can mark all games which involve any of these positions and novelties played in lines from the opening repertoire.

So as you can tell, I plan to add complete database support, but in a manner that does not take away from the current simplicity of the interface. I will most likely go for a relational database like PostgreSQL, which would make it easy to add online databases.

All this might sound a little over-ambitious for now, but the good thing is that I can approach one step after another, without being forced to ever complete them all. I still would like to invite additional comments from other chess players who use chess database software (not chess clients).

Chessmonk


I thought it was time to show a first preview shot of another project I’m working on, a PyGtk based PGN (chess game) viewer. Currently it features a completely scalable board (using SVG piece images), clickable moves in the notation display, variations and comments. Pretty much all PGN notations should be parsed already, including legal moves, ambiguity detection, promotions, etc. Oh yeah and moves are smoothly animated.

Initially I wanted this to become a full fledged database application, but then I just couldn’t nail the interface down for all possible use cases. So I decided to try something different and make this a pure PGN reader for viewing and analysing of chess games. I’m thinking about matching this up with a real chess database in the future (possibly web based) and I might add limited editing abilities. But this is all still very unclear, so I will concentrate on plain PGN reading for now. The only major feature I still want to add is UCI chess engine support (for Fruit/Toga and the likes).

Thoughts on the “ideal” chess interface would be appreciated, but judging from the lack of replies to my last blog posting, I doubt that any chess players are reading my blog. 🙂

White to move and win material

White to move

This is from a game my father played today. His opponent (rated 300 points higher at ELO 2200) was white and offered a draw in this position, which my father accepted. How could white have proceeded instead to gain a significant advantage? Try to solve it completely without moving pieces or using a computer. It is difficult and very interesting. 🙂

My Latest Game

This was played last week during a local team cup. Unfortunately we lost very closely despite this win.

Borgmann, Daniel (1581) — Stratenwerth, Gerhard (1654)
05/06 – Viererpokal – SG Aljechin IV vs. Langenberger SV I (3) Solingen
2005.11.13 1-0 C88e

1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 d6 8.c3 Na5 Black delays castling unusually long. The downside of the knight move is the weakening of e5, which allows white to attack the center right away without the fear of Bg4. 9.Bc2 c5 10.d4 Nc6 11.d5 Nb8 12.a4 bxa4? A critical mistake which black will regret for the entire length of the game. Now the a-pawn becomes very weak and c6 an ideal outpost for my knight. Necessary was Bb7 or b4.
13.Bxa4+ Bd7 14.Nbd2 O-O 15.Bxd7 Nbxd7 16.Nc4 Nb6 17.Na5 Qc7 18.Nc6 There it is. White has a big advantage already. 18…Rfe8 19.Bg5 Kf8 20.Bxf6 Bxf6 21.Qe2 Qb7 ( 21…a5 would have been an interesting way to keep the pawn. It is indirectly covered by the Queen, since Nxd5 is threatened.) 22.Nd2 Ra2 would have been more accurate. 22…Bg5 23.Nb3 Nd7 Nxd5? fails to Nba5 24.Nba5 Qc7 25.Ra2 Nb8 26.Rea1 Qb6 27.Nc4 Qc7 28.Nxb8 Qxb8 29.Rxa6 It was just a matter of time. 29…Rxa6 30.Rxa6 White has a winning advantage, despite the rather weak extra pawn. The next three moves already decide the game. 30…Be7 Better Rd8 31.Nb6 Rd8 32.Qb5 Qb7 33.Qc6! A killer move, since the black queen has no place to go. If it takes the white queen, the pawn will be unstoppable. Black is forced to give up more material and the game is practically over. 33…Qxa6 34.Nd7+ Rxd7 35.Qxa6 Rd8 36.Qb7 Ke8 37.b4 cxb4 38.cxb4 Rd7 39.Qb8+ Bd8 40.b5 Rc7 41.g3 Kd7 42.b6 Rc1+ 43.Kg2 Rb1 44.b7 Rc1 45.Qxd8+ 1-0