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
- 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.
- Custom Logging: All game events and errors are logged to
- Python 3.9 or later
- See requirements.txt for dependencies:
- pygame
- pygame-menu
- numpy
- librosa
- sounddevice
- pyaudio
-
Clone the repository
git clone https://github.com/Mflavien01/H2Othello cd H20thello -
(Optional) Create a virtual environment
python -m venv monenv source monenv/bin/activate # On Windows: monenv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Microphone setup
The default microphone setup is for raspberry pi. You may need to adapt the acquisition frequency, line 13 in
./voice/voice_controller.pyand/or themic_indexline 9.
Run the game with:
python main.py- Mouse: Navigate menus and play moves.
- Keyboard:
- Press
Vduring your turn to use voice input for your move. - Press
Rto resign.
- Press
- Network: Host or join a game, enter IP address as needed.
- 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.
main.py– Entry point, logging setupgame/– Game engine, configuration, and core logicai/– AI implementations (Greedy, Minimax, MCTS)interface/– UI, menus, animations, and event handlingnetwork/– Networking code for multiplayervoice/– Voice recognition controllerimages/– Game assets and backgroundsutils/– Logging and utilitieslogs/– Game logs (game_log.txt)
- 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_PORTingame/config.py.
- 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.txtfor debugging.
- Gauthier Bullier
- Flavien Mathieu
- Arthur Gnom
- Diane Vuillemin
This project is for educational purposes. Please contact the author for licensing details.
