-
Notifications
You must be signed in to change notification settings - Fork 11
UniversalHiveProtocol
Draft Proposal
A GameType string identifies the expansion pieces (if any) available in the current game. All GameType strings start with Base
, and if there are any expansion pieces, a single +
and any combination of: M
for Mosquito, L
for Ladybug, P
for Pillbug.
Examples:
Base
Base+M
Base+L
Base+P
Base+ML
Base+MP
Base+LP
Base+MLP
info
The info
command asks the engine to return its identifier string.
Example:
info
id Mzinga.Engine 1.0.0.0
ok
newgame [GameType]
The newgame
command asks the engine to start a new game should return a board string.
Example without GameType:
newgame
Base;NotStarted;White[1]
ok
Example with GameType:
newgame Base+MLP
Base+MLP;NotStarted;White[1]
ok
play Move
The play
command asks to engine to play the specified move string and should return the updated board string if successful.
Example:
newgame
Base;NotStarted;White[1]
ok
play WS1[0,0,0]
Base;InProgress;Black[1];WS1[0,0,0]
ok
pass
The pass
command asks the engine to play a pass move and should return the updated board string if successful. It is the equivalent of play PASS
.
validmoves
The validmoves
command asks the engine for every valid move for the current board, returned as a semi-colon separated list of move strings.
Example:
newgame
Base;NotStarted;White[1]
ok
validmoves
WS1[0,0,0];WB1[0,0,0];WG1[0,0,0];WA1[0,0,0]
ok
bestmove time MaxTime
bestmove depth MaxDepth
The bestmove
command asks the engine's AI for the best move on the current board with the specified depth or time limit, and returns the move string for that move. The engine may optionally return moves incrementally as it thinks, as long as each move string is presented on its own line.
When using bestmove time
, MaxTime
is the engine's time limit to think, and it should be in the format hh:mm:ss
.
Example with a 5 second time limit:
newgame
Base;NotStarted;White[1]
ok
bestmove time 00:00:05
WS1[0,0,0]
ok
When using bestmove depth
, MaxDepth
is the number of plies (moves or turns) to look ahead, and should be a non-negative integer value.
Example with a two ply limit:
newgame
Base;NotStarted;White[1]
ok
bestmove depth 2
WS1[0,0,0]
ok
undo [MovesToUndo]
The undo
command asks the engine to undo one or more previous moves and should return the updated board string if successful.
Example without MovesToUndo:
newgame
Base;NotStarted;White[1]
ok
play WS1[0,0,0]
Base;InProgress;Black[1];WS1[0,0,0]
ok
undo
Base;NotStarted;White[1]
ok
Example with MovesToUndo:
newgame
Base;NotStarted;White[1]
ok
play WS1[0,0,0]
Base;InProgress;Black[1];WS1[0,0,0]
ok
undo 1
Base;NotStarted;White[1]
ok
history
The history
command asks the engine to list the history of the moves played so far (with the piece's original position before the move), returned as a semi-colon separated list of strings in the format PieceString > MoveString
. If there's no history, return a blank line.
Example with no history:
newgame Base
Base;NotStarted;White[1]
ok
history
ok
Example with history:
newgame Base
Base;NotStarted;White[1]
ok
play WS1[0,0,0]
Base;InProgress;Black[1];WS1[0,0,0]
ok
history
WS1[] > WS1[0,0,0]
ok
play BS1[1,-1,0]
Base;InProgress;White[2];WS1[0,0,0];BS1[1,-1,0]
ok
history
WS1[] > WS1[0,0,0];BS1[] > BS1[1,-1,0]
ok
Mzinga Copyright © 2015-2023 Jon Thysell.
Hive Copyright © 2016 Gen42 Games.
Mzinga is in no way associated with or endorsed by Gen42 Games.
Getting Started
Mzinga's Projects
Other