Chess Utility Function

Sort:
Avatar of Boheme

Hi all,

I'm trying to improve my chess AI that I'm making, but I feel as though the biggest bottleneck I'm facing is creating a good utility function (a.k.a. an evaluation function or a "pat-down" function). I've been looking online but I can't find any examples that are understandable.

If any of you know of a place where I can find such a function (be it source code or thoroughly explained prose), that would be amazing. The folks at chess programming wiki have one, but it is on the limit of being obfuscated to me: it uses weirdly-named methods, uses hacky magic-bitboard stuff,  and is written in C, which is not exactly the easiest-to-read language unless you're very proficient in it, which I haven't been for quite some time.

Any and all help would be awesome.

Avatar of hankas

Back in the college, I too was interested in creating a chess engine but it was never completed due to college workload and other diversions. However, I did look at Fruit, Crafty and Stockfish's source codes. I suggest you should look at them too.

Btw, there is no escaping C/C++.  If you can't read C/C++, then you pretty much have very limited choices as I haven't seen many chess engines written in VB or Java or other languages.

Bitboard is the de-facto standard, but you shouldn't get discouraged by this. It's just a data representation of the position on board. You may have different system implemented in your engine. With today's processing power, bitboard's efficiency is not that critical (although it may be helpful). What you may want to look closely at is their search algorithm and their evaluation functions.

Good luck!

Avatar of MrEdCollins

You're probably asking your question in the wrong forum.

Talkchess.com is the better place to ask this. 

It has five years, or more, of past technical discussions to browse, concerning all phases of chess programming.  There are hundreds of chess authors who visit the site on a regular basis.  They have an entire forum devoted to programming and technical discussions.  The knowledge of the users is second to none.

Avatar of Boheme

@hankas: Thanks for pointing me to some open-source chess engines. It hadn't even occured to me that some people would actually make high-rated, potentially commercial, chess programs and make them open-source.

@MrEdCollins: I'll definitely look there instead. Thanks.