Crafty 25.3 opening book question

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Ultrabean
Posts: 9
Joined: Wed Jun 03, 2026 7:38 am
Full name: Sandy Vee

Crafty 25.3 opening book question

Post by Ultrabean »

Hey guys, I'm trying to use the "book random" and "book width" commands to control Crafty's variety of play in the opening but it's not working.

Here's the content of my crafty.rc file:

log off
ponder on
hash=512m
hashp=64m
book random 1
book width 5


When I remove the last 2 lines, Crafty plays book moves normally but when I include them, it stops responding.

The main reason I want to adjust variety is because Crafty tends to repeat the same openings. Like when I play e4, most of the time, it will respond with c5. Ideally, I want Crafty to choose a different opening/line every game.

Thanks in advance for your help!
Peter Berger
Posts: 842
Joined: Thu Mar 09, 2006 2:56 pm

Re: Crafty 25.3 opening book question

Post by Peter Berger »

Ultrabean wrote: Tue Jul 28, 2026 2:51 pm When I remove the last 2 lines, Crafty plays book moves normally but when I include them, it stops responding.
This shouldn't be the case but may happen in some graphical interfaces. Please re-add the two lines ( they are fine), add a new last line "exit" to your crafty.rc and try again.
Ultrabean wrote: Tue Jul 28, 2026 2:51 pm The main reason I want to adjust variety is because Crafty tends to repeat the same openings. Like when I play e4, most of the time, it will respond with c5. Ideally, I want Crafty to choose a different opening/line every game.

Thanks in advance for your help!
Please start Crafty in text mode and type "ana". Then type e4 and see what you get (there should be different moves with different probabilities).
If you like what you see there, maybe you just see an artefact of book learning that you can disable by learn=0.
Ultrabean
Posts: 9
Joined: Wed Jun 03, 2026 7:38 am
Full name: Sandy Vee

Re: Crafty 25.3 opening book question

Post by Ultrabean »

Hi, thank you for taking the time to reply!

Sorry, I should've mentioned that I'm on Windows 10 and the GUI I'm using is a portable version of Winboard 4.9.1.

Unfortunately, adding "exit" to the crafty.rc file did not work.

For your second suggestion, by text mode, I assume you mean starting Crafty in a terminal? If so, typing "ana" after starting Crafty in the terminal gives the error "Illegal move". I don't know if I'm doing it right though.
Ultrabean
Posts: 9
Joined: Wed Jun 03, 2026 7:38 am
Full name: Sandy Vee

Re: Crafty 25.3 opening book question

Post by Ultrabean »

Oh, one more thing I forgot to mention, I know that on Linux, packaged Crafty on Ubuntu comes with 3 separate opening books, book.bin, books.bin and I think the third one is cbook.bin or something like that.

Here I'm only using book.bin because it's all I could find on the Crafty website.

I don't know if this changes anything but thought I'd mention it.
Peter Berger
Posts: 842
Joined: Thu Mar 09, 2006 2:56 pm

Re: Crafty 25.3 opening book question

Post by Peter Berger »

Ultrabean wrote: Tue Jul 28, 2026 4:48 pm For your second suggestion, by text mode, I assume you mean starting Crafty in a terminal? If so, typing "ana" after starting Crafty in the terminal gives the error "Illegal move". I don't know if I'm doing it right though.
This sounds impossible to me, sorry. Where should this "illegal move" come from? Try it without books ( change their file names for a moment) - it should analyze and think some. If it does, you probably had corrupted book files previously. Then you can just download ( or create) others. If not, I am not able to help any further, sorry.
Archimedes
Posts: 183
Joined: Tue Mar 05, 2019 3:43 pm
Full name: Archimedes

Re: Crafty 25.3 opening book question

Post by Archimedes »

There must be a line break after the final exit command. You should always do this at the end of the last command, just to be safe.
Ultrabean
Posts: 9
Joined: Wed Jun 03, 2026 7:38 am
Full name: Sandy Vee

Re: Crafty 25.3 opening book question

Post by Ultrabean »

Archimedes wrote: Tue Jul 28, 2026 7:09 pm There must be a line break after the final exit command. You should always do this at the end of the last command, just to be safe.
Wow, you nailed it lol. Inserting a line break at the end resolved the issue :oops:

I literally spent over an hour trying to figure out why it wasn't working :roll:

Thank you!!