Expand description
An AI, client, engine, and server for the game of Copenhagen Hnefatafl.
§Feature Flags
By default the client and server feature flags are enabled.
- client - enable the
hnefatafl-clientbinary - console - on Windows print output to the console
- debug - enable iced debug mode, also log on the debug level
- js - enable options for generating javascript code
- runic - enable the
icelandic-runicbinary for translating Icelandic to Icelandic Runic - server - enable the
hnefatafl-server-fullbinary
§Message Protocol
Get more information about the message protocol used by the engine.
§OpenTafl and TaflZero
If you want to adapt your AI for this server’s tournaments, have a look at
the OpenTafl and TaflZero code. Following is the game format expected
to be used by clients when they issue the command
resume_game_json <game-id>\n. You will get back
= resume_game_json <opentafl_game_json>\n. opentafl_game_json is below.
The messages are newline delimited, but for ease of reading
opentafl_game_json has been pretty printed.
§OpenTafl Game Format
{
"id": 34253,
"attackers": "david",
"defenders": "ai-taflzero-10",
"dim": 11,
"start": "/3AAAAA3/5A5/11/A4D4A/A3DDD3A/AA1DDKDD1AA/A3DDD3A/A4D4A/11/5A5/3AAAAA3/",
"time_control": {
"main_time_seconds": 900,
"increment_length": 10
},
"time_remaining_ms": {
"attackers": 885694,
"defenders": 911981,
"last_move": "2026-06-24T19:57:38.07Z"
},
"moves": "d1-d3 e5-e2 d3-d2xe2 f8-c8",
"rated": true,
"messages": [
{
"username": "david",
"timestamp": "2026-06-24T19:57:33.519700276Z",
"content": "Hello!"
}
]
}Modules§
- accounts
- ai
- board
- characters
- draw
- game
- game_
tree - glicko
- heat_
map - locale
- message
- opentafl
- This code handles converting to and from the
OpenTaflformat. - play
- rating
- role
- server_
game - space
- status
- time
- tournament
- tree
- utils
Constants§
- COPYRIGHT
- HOME
- LONG_
VERSION - SERVER_
PORT - SOCKET_
PATH - SOFTWARE_
ID - The software package that this is.
- VERSION_
ID