Skip to content

Statistics-For-Surfer/Briscola-Game

Repository files navigation

Sure, here is the markdown code for the improved README:

## Reinforcement Learning for Briscola

Welcome to the repository for Reinforcement Learning (RL) applied to the classic card game Briscola. This project includes the environment, training modules, interfaces, and models used to develop and train RL agents to play Briscola. It is developed for the course of Reinforcement Learning @Sapienza, University of Rome

### Directory Structure

Here's an overview of the key directories and files included in this repository:

#### 1. Environment

**Directory:** `src/briscola/env`

- **Files:**
  - `Game.py`: Contains the main game logic for Briscola.
  - `Object.py`: Defines the objects and data structures used in the game.
  - `Players.py`: Manages player interactions and behaviors.

#### 2. Training

**Directory:** `src/briscola/train`

- **Files:**
  - `brain_sddqn.py`: Implementation of the SDDQN (Double Deep Q-Network) brain.
  - `evaluation.py`: Scripts for evaluating the performance of trained models.
  - `game_train.py`: Main training script for running training sessions.
  - `networks.py`: Defines neural network architectures used in training.

#### 3. Interface

**Directory:** `src/briscola/interface`

- **Subdirectory:**
  - `images/`: Contains images used in the game interface.

- **Files:**
  - `interface.py`: Code for the graphical interface of the game.
  - `card_position.py`: Manages the positioning and display of cards in the interface.
  - `app.py`: Main application file to run the game interface.

#### 4. Models

**Directory:** `src/briscola/models`

- **Files:**
  - `model_transformer.pth`: Pre-trained transformer model.
  - `model.pth`: Other pre-trained models used for playing Briscola.

### Getting Started

To get started with this project, you can follow these steps:



1. **Install dependencies:**
   Make sure you have Python installed. Then, install the required Python packages:
   ```bash
    pip install -e ".[dev]"   
    ```
2. **Run the game:**
   You can launch the game interface using:
   ```bash
   python src/briscola/interface/app.py
  1. Train a model: To start training a new model, run:

    python src/briscola/train/game_train.py
  2. Evaluate a model: To evaluate a trained model, use:

    python src/briscola/train/evaluation.py

Contributions

Contributions to this project are welcome. If you find a bug or have a feature request, please open an issue. For major changes, please open a discussion first to communicate what you would like to change.