No description
Find a file
2026-03-12 10:13:07 +01:00
bot wip debug get_valid_actions for black 2026-03-04 17:43:27 +01:00
client_cli wip debug get_valid_actions for black 2026-03-04 17:43:27 +01:00
doc doc: tensor research 2026-03-10 08:19:24 +01:00
spiel_bot feat(spiel_bot): az_train parallel games with rayon 2026-03-12 10:13:07 +01:00
store feat(spiel_bot): dqn 2026-03-10 22:12:52 +01:00
.envrc devenv with rust 2022-11-30 16:15:03 +01:00
.gitignore script train bots 2025-08-10 15:35:12 +02:00
Cargo.lock feat(spiel_bot): az_train parallel games with rayon 2026-03-12 10:13:07 +01:00
Cargo.toml feat(spiel_bot): init crate & implements GameEnv trait + TrictracEnv 2026-03-09 09:17:17 +01:00
devenv.lock chore(devenv): pin cmake package (for burn-rl > sdl2) 2026-02-13 20:58:24 +01:00
devenv.nix chore(devenv): pin cmake package (for burn-rl > sdl2) 2026-02-13 20:58:24 +01:00
devenv.yaml chore(devenv): pin cmake package (for burn-rl > sdl2) 2026-02-13 20:58:24 +01:00
flake.nix dev env via flake.nix 2022-12-09 21:19:18 +01:00
justfile feat: c++ bindings 2026-02-26 13:27:55 +01:00
LICENSE Initial commit 2022-11-30 15:37:20 +01:00
README.md refact: docs 2026-01-15 17:13:07 +01:00

Trictrac

This is a game of Trictrac rust implementation.

The project is on its early stages. Rules (without "schools") are implemented, as well as a rudimentary terminal interface which allow you to play against a bot which plays randomly.

Training of AI bots is the work in progress.

Usage

cargo run --bin=client_cli -- --bot random

Roadmap

  • rules
  • command line interface
  • basic bot (random play)
  • AI bot
  • network game
  • web client

Code structure

  • game rules and game state are implemented in the store/ folder.
  • the command-line application is implemented in client_cli/; it allows you to play against a bot, or to have two bots play against each other
  • the bots algorithms and the training of their models are implemented in the bot/ folder

store package

The game state is defined by the GameState struct in store/src/game.rs. The to_string_id() method allows this state to be encoded compactly in a string (without the played moves history). For a more readable textual representation, the fmt::Display trait is implemented.

client_cli package

client_cli/src/game_runner.rs contains the logic to make two bots play against each other.

bot package

  • bot/src/strategy/default.rs contains the code for a basic bot strategy: it determines the list of valid moves (using the get_possible_moves_sequences method of store::MoveRules) and simply executes the first move in the list.
  • bot/src/strategy/dqnburn.rs is another bot strategy that uses a reinforcement learning trained model with the DQN algorithm via the burn library (https://burn.dev/).
  • bot/scripts/trains.sh allows you to train agents using different algorithms (DQN, PPO, SAC).