6

For the past few months, I have been experimenting with Stockfish with the goal of making the AI more fun to play against.

Stockfish is obviously a very powerful Chess AI but it plays very conservatively (my understanding is all powerful chess ai ). From a humans perspective, this is kind of boring and this is especially true for new or inexperienced chess players. Additionally, when in a losing position, often moves can become totally nonsensical.

I have had middling success so far by modifying various weights in stockfish's evaluation function. I want to create Chess AI that is totally ruthless, never plays for a draw and wants to end the game in a checkmate as soon as possible, potentially assuming greater risk in aid of that goal.

I'm not so worried about the playing strength of the chess engine, my goal is to create a a fun and engaging chess experience for more than just expert level players.

New contributor
TinyCamera is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4
  • 1
    Such engines already exist (google :-) but I can't answer your question how to specifically tune Stockfish, sorry. Sep 21 at 7:28
  • Do you have any specific recommendations?
    – TinyCamera
    Sep 21 at 16:25
  • Google :-) In two seconds I found e.g. pkoziol.cal24.pl/opental - a chess engine that plays like Tal (or so they say). And it surely wasn't the one I dimly remembered. Sep 21 at 18:15
  • BTW Stockfish with neural nets is not as conservative as engines used to be. If it senses the opportunity it will start attacking immediately and aggressively, not afraid to sacrifice pieces, while previous engines were more conservative about material. It's pretty terrifying to be on the recieving end.
    – qwr
    Sep 22 at 17:27

1 Answer 1

3

There's this number in Stockfish's code that assigns the value of a draw. This is typically 0 for obvious reasons - if your position is better (> 0.00) then it's preferable to avoid a draw, while if your position is worse (< 0.00) then the reverse applies.

If you change this value to a smaller number, then the engine will view drawing as worse than a slightly inferior position. In fact if you change this to a big negative number, then the engine will view getting mated as better than a draw. You will therefore get an engine that "never plays for a draw".

Making an engine that "wants to end the game in a checkmate as soon as possible" is a different matter, and it's unclear how you can do that, since the engine will always choose what its algorithm says are the best moves, not the one that is "most aggressive".

4
  • Thank you for the reply! Instead of making the engine more aggressive(which is somewhat subjective) how about making the engine privilege shorter games over longer ones? Would that be possible?
    – TinyCamera
    Sep 21 at 16:23
  • About the last paragraph, my understanding is that Stockfish uses a lot heuristics, so couldn't we add more heuristics, for example: development gets a bonus, pawns around enemy king are worth more, and so on, that should make Stockfish more aggressive, though weaker.
    – Akavall
    Sep 22 at 3:54
  • @TinyCamera I don't see how one would go about programming that, though. (And why would you want to? Winning in 100 moves is better than losing/drawing in 99.)
    – Allure
    Sep 22 at 5:01
  • @Akavall I suppose you could, yeah (although that would only be classical eval - it's not clear how to apply it to NNUE eval).
    – Allure
    Sep 22 at 5:01

Your Answer

TinyCamera is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.