How does one recover their lost love of chess programming?

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
tmokonen
Posts: 1075
Joined: Sun Mar 12, 2006 5:46 pm
Location: Vancouver

How does one recover their lost love of chess programming?

Post by tmokonen » Thu Jun 05, 2008 10:28 pm

I'm not really sure this is the proper forum for this message, since this is not a technical issue, but it is related to programming, so I figured it would be most appropriate to place it here.

When I first started working on Tony's Chess, it was a whole newfangled and exciting world. It was a complete change of pace from my workaday database programming job. It was fun to finally get a move generator working, especially handling those tricky castling and en passant moves. I had bolted on a random move selector to my move generator, and me and my coworkers laughed as it randomly and very rapidly moved pieces, only to somehow manage to draw LaMoSca.

Then I added a fixed depth 4 ply alpha beta search (no q-search yet) and watched it have some fun sloppy 3/0 games against Chad's Chess. It was also a fun little punching bag to play against, just strong enough make a game last 30 or 40 moves, but not strong enough to be a serious threat to win. Then I added iterative deepening and a quiescent search, and I played it... and lost my first game against Tony's Chess. So I played it again... and lost again. I had reached an important milestone, it was now strong enough to win against me more often than it lost.

Tony's Chess hasn't advanced very much since those days, but I had a lot of fun tweaking it, trying some new eval terms, maybe playing with move ordering, or trying various search techniques like PVS, history heuristic, and null moves.

Nowadays, I just can't seem to find the motivation to work on it any more. Even after dropping it for weeks and coming back to it, programming my chess program just seems like a chore, and not fun like it used to. Sometimes, when I'm driving in my car, I'll have a million thoughts in my head about my program and I'll be thinking "yeah, yeah, excellent, I can't wait to try that when I get home!", but as soon as I start up Visual C++ and look at that monospaced indented mass of parentheses and semicolons and asterisks and square brackets, my will to program is just drained, and I end up just closing it and playing a game on PlayChess.

I'd like to know if anyone has hit a similar type of wall before, and what they've done to break through it and regain the fun they used to have.

Tony

User avatar
Zach Wegner
Posts: 1922
Joined: Wed Mar 08, 2006 11:51 pm
Location: Earth
Contact:

Re: How does one recover their lost love of chess programmin

Post by Zach Wegner » Thu Jun 05, 2008 10:59 pm

I think everyone has had one of those. I've gone on several months-long breaks, but I can never really break free. It can get tedious, especially when you are just starting and there is such a big, boring framework that must be built up. Writing a fen parser and an opening book reader is not fun, but once you do it it's great to see the result. The trick to chess programming IMO is just to bite the bullet and flesh out the boring low level stuff in a clean way, and then spend the rest of your time tweaking the search and eval.

A good way to help out also is to find huge bugs, or rather fix them (having them is not fun). So in this regard it helps to release your engine open source, as people will find bugs for you.

Some people, when they get bored, start a rewrite. When your engine is too messy to work on, this can work, but in most cases this would be much worse for me. Some people (Tord...) are just crazy. ;)

Edsel Apostol
Posts: 770
Joined: Mon Jul 17, 2006 3:53 am
Full name: Edsel Apostol
Contact:

Re: How does one recover their lost love of chess programmin

Post by Edsel Apostol » Fri Jun 06, 2008 12:43 am

Hi Tony,

The best advice I could give is to release your engine. When other people started testing it and playing it in tournaments, you will be motivated to make your program stronger.

krazyken

Re: How does one recover their lost love of chess programmin

Post by krazyken » Fri Jun 06, 2008 12:52 am

It's all about having a goal that interests you.

tmokonen
Posts: 1075
Joined: Sun Mar 12, 2006 5:46 pm
Location: Vancouver

Re: How does one recover their lost love of chess programmin

Post by tmokonen » Fri Jun 06, 2008 2:59 am

Hi Edsel. I released it last year, after much poking and prodding from the crew at the ChessWar chat room. Those guys are constantly bugging me to release something new. ;) I started work on the engine in 2003, so it was sitting under wraps for quite some time before I did finally release it.

It's a rather weak (and somewhat buggy :() engine at this stage. The ChessWar rating is 1443, with a performance rating of 1576 in the last promo tournament. With that sort of strength, I'm not too surprised it would have flown under your radar, Twisted Logic would mercilessly crush it. But you're right, it is nice to see it compete in online tournaments like ChessWar and Le Système du Suisse, even in this embryonic stage.

Zach's and Kenny's advice are good, too. I suppose I could set my next goal to be to make it out of ChessWar's promo division and into division F. Thanks for the help, folks.

Tony

User avatar
Bill Rogers
Posts: 3562
Joined: Thu Mar 09, 2006 2:54 am
Location: San Jose, California

Re: How does one recover their lost love of chess programmin

Post by Bill Rogers » Fri Jun 06, 2008 5:32 am

I question for you Tony. Did you write it in a modular fashion? By that I mean do most of the subroutines stand alone until they are called? This makes it much easier to work on an engine as you only look at one piece of code at a time instead of the entire engine.
For a reference as to what I mean, have you ever looked at TCSP? His eval is a seperate program from his move generator, etc.
Bill

Sven
Posts: 3830
Joined: Thu May 15, 2008 7:57 pm
Location: Berlin, Germany
Full name: Sven Schüle
Contact:

Re: How does one recover their lost love of chess programmin

Post by Sven » Fri Jun 06, 2008 11:33 am

Hi Tony,
check your PM.
Sven

User avatar
jshriver
Posts: 1105
Joined: Wed Mar 08, 2006 8:41 pm
Location: Morgantown, WV, USA
Contact:

Re: How does one recover their lost love of chess programmin

Post by jshriver » Fri Jun 06, 2008 5:32 pm

Good question, I probably have the biggest chess vaporware engine in existence, since I've been tinkering with one since around 96? 97? Still trying to get out of the move generation phase.

So if you made it to the point where you can play your own engine that's still pretty good :)
As for motivation, look at why you started in the first place. Still feel that way or feel like you've accomplished that goal? If so nothing wrong with moving on to something new.

After a lot of frustration trying to get a chess engine up and running (mostly due to lack of programming ability it seems) I tried something else and have made a bigger dent into a go engine than I ever have with chess.

Did/do you want to write something that can just play a legal game? If so you've accomplished that, but if you want something that can compete in WCCC and win, then that will take years and years or work and practice. Just have to keep focused I guess.

Hope that helps :)
-Josh

Dann Corbit
Posts: 10267
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: How does one recover their lost love of chess programmin

Post by Dann Corbit » Fri Jun 06, 2008 9:17 pm

A Chess Programming Apology:

Chess programming, how do I love thee? Let me count the ways.
I love thee to the depth first heights that my soul can reach.
In my quiescent moments, I evaluate my love for the as mate in two.
I love thee to the level of everyday's most quiet need: otb splendor.
I love thee freely, as I am a cheapskate.
I love thee purely, as pure as the game itself.
I love thee with a passion that can only be described as a disease.
I love thee with a love I seemed to lose, or at least when I play against the fruits of my labor.
I love thee with the passion of a man who chooses to slide little wooden horsies around on cardboard squares,
I shall but love thee better after mate.

tmokonen
Posts: 1075
Joined: Sun Mar 12, 2006 5:46 pm
Location: Vancouver

Re: How does one recover their lost love of chess programmin

Post by tmokonen » Sat Jun 07, 2008 12:58 am

Bill Rogers wrote:I question for you Tony. Did you write it in a modular fashion? By that I mean do most of the subroutines stand alone until they are called? This makes it much easier to work on an engine as you only look at one piece of code at a time instead of the entire engine.
For a reference as to what I mean, have you ever looked at TCSP? His eval is a seperate program from his move generator, etc.
Bill
Hi Bill. I broke down my program (straight C, no OO) in a somewhat similar fashion to that. I have separate source files for movegen, search, eval, and hash functions, and a source file for utility functions like winboard command handling, board editing, and reading options from the ini file. Still, there's probably a few too many globals, so it can stand to use a bit more modularization.

I've taken a look at both Faile and TSCP, but only really the search routines. I found the movegen to be fairly straightforward, but it took quite an effort for me to get into a recursive thinking mode and properly understand the alpha beta algorithm. Also, I don't use C at all for my daily work, that's all lily livered Visual Basic stuff, so getting comfortable with C took a while too.

My main sources of ideas and inspiration was Bruce Moreland's set of web pages, and David Levy's books The Chess Computer Handbook and How Computers Play Chess. I tend to prefer to study pseudocode, and try work out the details myself. I'd rather have something original and not a patchwork.

Post Reply