2024-02-09 17:47:34 +01:00
# Trictrac
2022-11-30 16:15:03 +01:00
2026-01-15 17:03:16 +01:00
This is a game of [Trictrac ](https://en.wikipedia.org/wiki/Trictrac ) rust implementation.
2022-11-30 16:15:03 +01:00
2026-01-15 17:03:16 +01:00
## Usage
2026-04-22 17:42:05 +02:00
Install [devenv ](https://devenv.sh/getting-started/ ), start a devenv shell `devenv shell` , and run the following commands.
```bash
# Run the relay server
just build-relay
just run-relay # listens on :8080
# Run the game (separate terminal)
2026-05-02 11:11:39 +02:00
just dev
2026-04-22 17:42:05 +02:00
```
2026-05-24 16:22:50 +02:00
Open a browser window at `http://127.0.0.1:9091` . You can play against a very basic bot, or invite an other player to connect at the same address.
2026-01-15 17:03:16 +01:00
## Code structure
- game rules and game state are implemented in the _store/_ folder.
2026-05-24 16:22:50 +02:00
- a server for the network game is implemented in _server/relay-server_ , which uses _server/protocol_
- the web client is in _clients/web_ , it connects to the server using the _clients/backbone-lib_ library
2026-04-22 17:42:05 +02:00
- the command-line application is implemented in _clients/cli/_ ; it allows you to play against a bot, or to have two bots play against each other
2026-05-24 16:22:50 +02:00
- the bots algorithms and the training of their models are implemented in the _bot/_ and _spiel_bot_ folders. This is a work in progress, they are not performant at all.
2026-04-22 17:42:05 +02:00
2026-05-24 16:22:50 +02:00
## Inspirations
2026-04-22 17:42:05 +02:00
2026-05-26 19:18:00 +02:00
The multiplayer game architecture, implemented in packages _clients/backbone-lib_ , _clients/web/game_ , _server/protocol_ and _server/relay-server_ is a [Leptos ](https://leptos.dev/ )-optimized adaptation of the macroquad-based [Carbonfreezer/multiplayer ](https://github.com/Carbonfreezer/multiplayer ) project.
2026-04-22 17:42:05 +02:00
2026-05-24 16:22:50 +02:00
The web client UX/UI is inspired by https://playtiao.com.