Interfacing command line engines to Conqueror


Khan engines:


Conqueror uses the UCI protocol to communicate with engines.

If you are building your own khan engine, add support for the extended ucinewgame syntax to your command line engine:

    ucinewgame [rules] board [boardtype]

For example, the following command sends khan rules to the engine and specifies the initial board for a 'magician' type game:

    ucinewgame bondsmenLeaders 1 basePromotions swordsCaptureMounts 0 magicianDemotesKhan 1 magicianExtendedDemotionSqs 0 board magician

All the other UCI commands stay the same and are inherited from the original UCI standard.

If you wish, you can consult the Conqueror open source code for specific details on how uci commands are sent to the engine.

You should also support the new boardtype command. This way Conqueror will know what games your engine supports.
Return the following string if your engine supports all games:

    basic magician powermagician rescuegeneral rescuekhan

If your engine only supports khan standard games, then return:

    basic magician powermagician

Before asking the engine to evaluate a move, Conqueror passes the fen describing the current position. For Khan standard games, the command looks like:

    position fen wfwwa3/wksma3/wn6/aa6/6AA/6NW/3AMSKW/3AWWFW w 0 1 startpos moves g4f5 a5a4 h4h5

This follows the same syntax as chess except there are different characters to denote khan-like pieces:

    W/w = white or black mounted warrior
    A/a = archer
    S/s = swordsman
    N/n = assassin
    K/k = khan
    J/j = khan archer (demoted khan)
    I/i = khan sword (doubly demoted khan)
    F/f = first bondsman
    M/m = magician
    H/h = power magician
    G/g = demoted magician (m-)

Khan Siege:


For Siege games, the syntax is similar to the above example if you are starting from the standard tower position, with all 4 squares intact and the tower positioned in the centre of the board. With the winning squares set to A1,H8 for white and black.

However, if you are starting from a custom setup position, then you would pass the long version of the fen. Here is an example for Khan siege 1 (rescue general):

    position fen 8/2s5/2f1n3/1w4A1/1a2KHF1/2sA4/k1A5/8 b 2 1 C3 Tower { D4 E4 D5 E5 } Breached { D4 E4 } WinSquaresWhite { A1 } WinSquaresBlack { H8 } startpos moves g1g4

    C3 describes the square of the piece holding the captive general before any startpos moves are made, in this case, 'g1g4'.

    Tower {...} describes the startup tower configuration before any moves are made.
    Breached {..} indicates the subset of squares that have been undermined by magicians before any moves are made.
    WinSquaresWhite describes the set of squares that indicate winning positions for white to bring a captive to.
    WinSquaresBlack describes the set of squares that indicate winning positions for black to bring a captive to.

To test in Conqueror, copy your uci khan engine to the engines/khan folder of the Conqueror install path. Run Conqueror. Your engine will appear in the Game..Players list.

Here is another example describing how a setup fen could be passed for Khan siege 2 (rescue khan):

position fen "8/2s5/3f4/a3kS2/8/4S3/3H4/3F4 b 8 1 D1 1 - 1 TowerWhite { H5 H6 } BreachedWhite { H5 H6 } TowerBlack { A3 A4 } BreachedBlack { A4 } DropoffSquaresWhite { A1 } DropoffSquaresBlack { H8 }

The first four pieces of data before the 'TowerWhite' keyword describe the square of the piece holding the captive khan and the captive khan's 'alive' status. For example, in the above string, white's khan is kept by the piece at D1 and the captive is flagged as still alive ('1'). Black's khan is still imprisoned in the black tower (as denoted by '-'), yet he is still alive ('1').

The rest of the string follows the format of khan siege 1:

    TowerWhite {...} describes the startup configuration of the tower where the white khan is imprisoned, before any moves are made.
    TowerBlack {...} describes the startup configuration of the tower where the black khan is imprisoned, before any moves are made.
    BreachedWhite {..} indicates the subset of squares of the white khan's holding tower that have been undermined by magicians before any moves are made.
    BreachedBlack {..} indicates the subset of squares of the black khan's holding tower that have been undermined by magicians before any moves are made.
    DropoffSquaresWhite describes the set of squares where the white khan can be taken to, to 'heal' and become part of the white team again.
    DropoffSquaresBlack describes the set of squares where the black khan can be taken to, to 'heal' and become part of the black team again.

Interfacing chess engines to conqueror:


Copy your uci chess engine to the engines/chess folder of the Conqueror install path.
Run Conqueror.
Your engine will appear in the Game..Players list.