Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

H2Othello – Othello Game

ProjetS6 Logo

Overview

H2Othello is an advanced Othello/Reversi game implemented in Python, featuring:

  • Multiple AI opponents (Greedy, Minimax, MCTS)
  • Local and network multiplayer modes
  • Voice command support for moves
  • Animated and themed graphical interface using Pygame
  • Scalable menus and adaptive UI

Features

  • Single Player: Play against different AI levels (Surface, Deep Sea, Abyss).
  • Local Multiplayer: Two players on the same computer.
  • Network Multiplayer: Play over LAN or internet (host/join, robust protocol).
  • Voice Control: Make moves using your voice (requires microphone).
  • Animated Graphics: Dynamic backgrounds and piece animations.
  • Multiple Languages: Easily extendable for localization.
    • Custom Logging: All game events and errors are logged to logs/game_log.txt.

Installation

Requirements

  • Python 3.9 or later
  • See requirements.txt for dependencies:
    • pygame
    • pygame-menu
    • numpy
    • librosa
    • sounddevice
    • pyaudio

Setup

  1. Clone the repository

    git clone https://github.com/Mflavien01/H2Othello
    cd H20thello
  2. (Optional) Create a virtual environment

    python -m venv monenv
    source monenv/bin/activate  # On Windows: monenv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Microphone setup

    The default microphone setup is for raspberry pi. You may need to adapt the acquisition frequency, line 13 in ./voice/voice_controller.py and/or the mic_index line 9.

Usage

Run the game with:

python main.py

Controls

  • Mouse: Navigate menus and play moves.
  • Keyboard:
    • Press V during your turn to use voice input for your move.
    • Press R to resign.
  • Network: Host or join a game, enter IP address as needed.

Network Play

  • Choose "Network" mode in the menu.
  • Select "Host" to wait for a player, or "Join" and enter the host's IP address.
  • Robust protocol with error handling, resign, timeout, and pass support.

Project Structure

  • main.py – Entry point, logging setup
  • game/ – Game engine, configuration, and core logic
  • ai/ – AI implementations (Greedy, Minimax, MCTS)
  • interface/ – UI, menus, animations, and event handling
  • network/ – Networking code for multiplayer
  • voice/ – Voice recognition controller
  • images/ – Game assets and backgrounds
  • utils/ – Logging and utilities
  • logs/ – Game logs (game_log.txt)

Customization

  • AI Difficulty: Change in the menu or set default in game/config.py.
  • Themes/Graphics: Replace images in the images/ folder.
  • Voice Model: Swap Vosk model for other languages in voice/.
  • Network Port: Change DEFAULT_PORT in game/config.py.

Troubleshooting

  • If you have issues with audio or voice recognition, ensure your microphone is set up and the correct device index is used in voice/voice_controller.py.
  • For network play, ensure both players are on the same network or port forwarding is configured.
  • All errors and game events are logged in logs/game_log.txt for debugging.

Authors

  • Gauthier Bullier
  • Flavien Mathieu
  • Arthur Gnom
  • Diane Vuillemin

License

This project is for educational purposes. Please contact the author for licensing details.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages