Skip to content
Ilya V. Portnov edited this page Apr 8, 2022 · 6 revisions

Welcome to the hcheckers wiki!

Architecture

HCheckers has client-server architecture. The server (hcheckersd) works as a game server, allowing several game sessions to happen at the same time. Client application (hcheckersc.py) displays the board and lets the user interact with the server. From user's perspective, the client application is the program itself. But in fact, all "interesting things", such as game rules and AI, are in the server, and client application is merely an interface.

HCheckers client application

Main window

Screenshot_20220405_204205

The main window contains the following parts:

  • Menu bar. The menus are described at the Menus page.
  • Toolbar. Commands in the toolbar repeat the most used commands from the menu.
  • The area with a message from another side (another player) - at left, under the toolbar. This, for example, shows the last move of another player, or whether another player has accepted your draw offer.
  • The widget with pieces counts. This shows how many are men and kings of each color currently on the board.
  • The main area with the board.
  • Optional History docker. By default it is not shown.
  • Optional Log docker.
  • Status bar. It shows current game status, used game rules, and the name of used AI preset (if any).

HCheckers Server application

Command line

HCheckers server can be run with hcheckersd command. Use hcheckersd --help to show description of all possible command-line options. The most usable of them are:

  • -c, --config PATH. Use another configuration file instead of ~/.config/hcheckers/server.yaml.
  • -L --local=on|off. If enabled, the server will be running in "local" mode. In this mode, the server can be shut down by the command from client application, when client application is closed. This mode is usable when running client and server on one machine, without intention to use server as game server.
  • --metrics=on|off. If enabled, the server will listen at additional HTTP port (8000 by default). At this port, there will be a web-page displaying current performance metrics of the server.

Use +RTS options after all HCheckers parameters to specify options for GHC Runtime, such as amount of heap to be used; for example, hcheckersd --local=on +RTS -H1G. Use hcheckersd +RTS -? to display help about Runtime options.

Configuration file

HCheckers server configuration file is defined in YAML format. The usable options are:

  • host: Host name to listen on. localhost by default.
  • port: TCP port to listen on. 8864 by default.
  • local: enable "local mode" (see above) by default. Disabled by default.
  • enable_metrics: enable metrics by default. Metrics are disabled by default.
  • log_level: minimum severity of events to be written to log file. The available options are debug, trace, info, warning, error, fatal and disable (to disable logging at all). The default is info.
  • log_path: path to the log file. By default, hcheckers.log in the current directory is used.
  • ai/threads: maximum number of parallel threads to be used by AI for thinking. 4 by default. This usually should be approximately equal to the number of available CPU cores for maximum performance, or less, if you want to use your CPU for other tasks.
Clone this wiki locally