I am building a chess engine using AI and have succesfully connected it to the Arena Gui, by implementing the UCI protocol.

My goal is to train my AI by facing other AIs that Arena offers. Everything works well except the checkmate part where one of the engine loses. More specifically Arena does not give the last move made(that ended the game) to the losing engine,but instead it starts a new game when in tournament mode.

eg(from Arena debug):

2016-09-13 14:48:26,119-->2:position startpos moves d2d4 d7d5 a2a3 e7e6 a3a4 b8c6 a1a3 f8a3 e2e4 a3f8 b2b4 f8b4 c2c3 b4a5 f1e2 d5e4 g2g3 c6d4 e2d3 e4d3 c1g5 d4c2 d1c2 d3c2 g5d8 c2b1q e1e2 b7b6 g1f3 c8a6 c3c4 a6c4 e2e3 b1b3 e3e4 c4e2 d8g5 b3f3 e4d4
2016-09-13 14:48:26,119-->2:go wtime 295296 btime 231219 winc 0 binc 0
2016-09-13 14:48:26,121<--2:info score cp 3343 lowerbound depth 1 nodes 1 time 0 pv f3h1
2016-09-13 14:48:26,123<--2:info score cp 3343 depth 1 nodes 2 time 0 pv f3h1
2016-09-13 14:48:26,126<--2:info score mate 1 lowerbound depth 1 nodes 5 time 0 pv a5c3
2016-09-13 14:48:26,128<--2:info score mate 1 depth 1 nodes 6 time 0 pv a5c3
2016-09-13 14:48:26,129<--2:info cpuload 0
2016-09-13 14:48:26,130<--2:bestmove a5c3
2016-09-13 14:48:26,130*2*Found move:Ba5-c3
2016-09-13 14:48:26,290********Game end: 0-1 {Mate}
2016-09-13 14:48:26,291********Last game won by AnMon 5.75 with Black in 20 moves

In the example above my engine lost to its adversary(AnMon). As you can see the opponent gave the move a5c3 to the interface, and Arena just ended the game without sending a message to my engine before beggining a new game.

The problem lies in the fact that my goal is to train my engine's AI and to do that i need the last move made so that i can determine who won and who lost. Is there a way to make Arena give me that information?

If not what other engines that meet my needs would you reccomend?

3 Answers 3


I think for this you actually want the XBoard protocol, which specifies:


After the end of each game, xboard will send you a result command. You can use this command to trigger learning. RESULT is either 1-0, 0-1, 1/2-1/2, or *, indicating whether white won, black won, the game was a draw, or the game was unfinished. The COMMENT string is purely a human-readable comment; its content is unspecified and subject to change. In ICS mode, it is passed through from ICS uninterpreted. Example:

result 1-0 {White mates}

Here are some notes on interpreting the "result" command. Some apply only to playing on ICS ("Zippy" mode).

If you won but did not just play a mate, your opponent must have resigned or forfeited. If you lost but were not just mated, you probably forfeited on time, or perhaps the operator resigned manually. If there was a draw for some nonobvious reason, perhaps your opponent called your flag when he had insufficient mating material (or vice versa), or perhaps the operator agreed to a draw manually.

You will get a result command even if you already know the game ended -- for example, after you just checkmated your opponent. In fact, if you send the "RESULT {COMMENT}" command (discussed below), you will simply get the same thing fed back to you with "result" tacked in front. You might not always get a "result *" command, however. In particular, you won't get one in local chess engine mode when the user stops playing by selecting Reset, Edit Game, Exit or the like.

(emphasis mine)

UCI protocol is designed to be stateless, so an engine does not know when a game begins or ends, but is merely given a position to search.

As a compromise, you could trigger learning on a ucinewgame command, but this is not nearly as useful, because UCI does not send you the winning move. Perhaps perform a depth-1 search to see if there was a mating move, then assume they made that.

  • First of all thank you for your answer. Reading your post gave me the idea to search for whatever log files Arena might be saving concerning a game.And i found a .res file that Arena creates during a tournament.By parsing that file i can get who won each time, and hopefully that will solve my problem.This file could be read ,as you proposed, when we get the ucinewgame command and trigger learning. Sep 13, 2016 at 17:33

Arena is closed source, so I don't see any possibility for you to force the GUI to send you the last move. In fact, I don't think chess GUI should send the move to you because there wouldn't be anything for your engine to do.

If you really need the last move, maybe you want to use Cutechess? It's open source so you can do whatever you want once the game is over.


I think SmallChess is right and the Chess GUI is not supposed to send any more moves to a UCI Engine when the game is over by definition of UCI.

UCI Engines do not analyse Chess Games, but only single Chess Positions, so saving, storing or analysing a complete Chess Game is up to the Chess UI and not the UCI Engine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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