-
Notifications
You must be signed in to change notification settings - Fork 20
Game Engines
Some popular games like Chess are blessed with high quality engines that provide extremely powerful artificial intelligences to play against. In general those engines are text-based programs that do no provide a nice user interface. Instead, they rely on a few standard protocols to interface with user interface programs like WinBoard, XBoard and JoclyBoard.
However, interfacing UI and AI programs often requires a little bit of configuration. In the future, JoclyBoard may provide preset configurations for most popular engines, but for now, you might need to perform some tuning to make both programs cooperate. Do not worry, most of the times, a copy/paste is enough.
Once you created an engine in JoclyBoard, it is saved to the persistent configuration so you can use it as either or both players in a game at any time in the future.
A JoclyBoard engine has the following properties:
- Name: so you can refer to this label to assign the player to the engine
-
Protocol: as of now, it can be
UCI
orCECP
for Chess and variants andHub
for Draughts - Binary path: most of the time, JoclyBoard launches automatically the engine, so you need to tell him where to find the program
- Details: this one is more tricky and contains a number of optional fields to tune. This field is a text in YAML format that defines a configuration object. The specifications of the details are provided below but you may be more interested by just picking the configuration for the engine you want to run
- Stockfish: Chess
- GnuChess v6: Chess/CECP Chess/UCI
- FairyMax: Chess Makruk Capablanca Chess Shatranj Courier Chess Cylinder Chess
- MaxQi: Xiangqi
- Fruit: Chess
- Crafty: Chess
- Scan: Draughts/HUB Draughts/DXP
- Mobydam: Draught
- Dreamer: Chess
- Hoichess: Chess
- Sjeng: Chess
- Phalanx: Chess
- Glaurung: Chess
- Senpai: Chess
Note: the configurations below are minimal. In many cases, you can (and should) add arguments to the engine programs to load opening libraries.
Game: Chess
Protocol: UCI
Details: leave empty
Game: International Draughts
Protocol: Hub
Details:
args:
- hub
initialCommands:
- init
workingDir: path-to-where-scan-is-installed
Do not forget to replace path-to-where-scan-is-installed
by the actual location where scan is installed.
Game: International Draughts
Protocol: Dxp
Details:
# parameters below are optional, but useful to autostart Scan DXP server
binary: path-to-scan-binary
args:
- dxp
workingDir: path-to-where-scan-is-installed
# port must match the one specified in scan.ini, default 27531
# port: 27531
Game: International Draughts
Protocol: Dxp
Details:
# parameters below are optional, but useful to autostart Mobydam DXP server
binary: path-to-mobydam-binary
# port: 27531
Game: Chess
Protocol: CECP
Details:
initialCommands:
- xboard
movePattern: "My move is :\\s*(\\S+)"
Game: Chess
Protocol: UCI
Details:
args:
- --uci
Game: Chess
Protocol: UCI
Details: leave empty
Game: Chess
Protocol: CECP
Details:
initialCommands:
- xboard
Game: Chess
Protocol: CECP
Details: leave empty
Game: XiangQi
Protocol: CECP
Details:
variant: xiangqi
Game: Makruk
Protocol: CECP
Details:
variant: makruk
Game: Capablanca
Protocol: CECP
Details:
variant: capablanca
Game: Shatranj
Protocol: CECP
Details:
variant: shatranj
Game: Courier Chess
Protocol: CECP
Details:
variant: courier
boardSetup: ["edit","#",
"Pa4","Pb2","Pc2","Pd2",
"Pe2","Pf2","Pg4","Ph2",
"Pi2","Pj2","Pk2","Pl4",
"Ra1","Nb1","Ec1","Bd1",
"Me1","Kf1","Fg3","Wh1",
"Bi1","Ej1","Nk1","Rl1",
"c",
"Ra8","Nb8","Ec8","Bd8",
"Me8","Kf8","Fg6","Wh8",
"Bi8","Ej8","Nk8","Rl8",
"Pa5","Pb7","Pc7","Pd7",
"Pe7","Pf7","Pg5","Ph7",
"Pi7","Pj7","Pk7","Pl5",
"."]
Game: Cylinder Chess
Protocol: CECP
Details:
variant: cylinder
Game: Chess
Protocol: CECP
Details: leave empty
Game: Chess
Protocol: CECP
Details:
initialCommands:
- xboard
Game: Chess
Protocol: CECP
Details:
initialCommands:
- xboard
movePattern: "move\\s+([a-h]\\S+)"
Game: Chess
Protocol: CECP
Details:
initialCommands:
- xboard
movePattern: "my move is\\s+(\\S+)"
Game: Chess
Protocol: UCI
Details: leave empty
Game: Chess
Protocol: UCI
Details: leave empty
The configuration object may have the properties:
-
args
: the arguments passed to the engine program when launched. It is an array of strings. By default, the engine is launched without any argument. For instance,
args:
- --uci
when applied to a program like gnuchess is equivalent to launching the command with gnuchess --uci
-
workingDir
: an optional string representing the path of the directory where to launch the engine from -
debug
: a boolean indicating whether you want the JoclyBoard/engine dialog to be printed to the console. Default isfalse
. -
initialCommands
: an optional array of strings passed to the engine right after it has been launchedheight
(default 10) is the number of rows on the board -
variant
: some engines accept alternative chess rules by specifying a variant string -
movePattern
: a regular expression, expressed as a string, to identify the move chosen by the engine in its output. For instancemove\\s+(\\S+)
will extract the move stringe7e5
in the engine output linemove e7e5
-
boardSetup
: an array of strings passed to the engine to initialize the board. This is useful in case Jocly and the engine disagree on the initial board state -
defaultClock
: if the match is not timed, this parameter represents the number of milliseconds the engine is told to have remaining -
binary
: an optional path to a binary program that starts an engine in server mode. Some engine/GUI protocols rely on a socket-based connection. When JoclyBoard tries to connect to the engine, it first attempts to connect to the given host/port. If this fails, andbinary
is defined, it will first launch the program's binary and retry to connect.args
andworkingDir
apply to this binary launch -
port
: port to be used for server based protocols (default depends on the protocol itself, for DXP, it's 27531) -
host
: hostname or IP address to be used for server based protocols, default is "127.0.0.1" -
launchDelay
: the time in milliseconds to wait after launching the engine server binary -
restart
: if set totrue
, the engine process is killed after each move request