AI-GameOptimization
- ๐น๏ธ Introduction
- ๐ซ Showcase
- โจ Features
- ๐ป Installation
- ๐ Usage
- ๐ Project Structure
- ๐บ๏ธ Game Levels
- ๐ค Contributing
- ๐ License
Welcome to the AI-GameOptimization repository! This project explores the use of optimization algorithms to solve complex games. Currently, it focuses on solving the Sokoban game using Q-learning, with plans to extend to genetic algorithms and other optimization techniques in the future.
Q-Learning Implementation: An AI agent that learns to solve Sokoban puzzles through reinforcement learning. State Management: Efficient representation and management of game states. Deadlock Detection: Mechanisms to detect and avoid deadlocks in the game. Training and Evaluation: Tools to train the AI agent and evaluate its performance.
To get started, clone the repository and compile the code using a C++ compiler.
git clone https://github.com/Mhijazi16/AI-GameOptimization.git
cd AI-GameOptimization
Make sure you have a C++ compiler installed. You can use g++ for compilation:
g++ -o game main.cpp
Initialize the Game: Run the compiled executable to start the game.
./game
Select Level: Enter the level number you wish to play when prompted.
Train the AI: Enter the number of episodes to train the AI agent.
Solve the Game: The AI agent will attempt to solve the game using the trained Q-table. Follow the prompts to see the AI's progress.
main.cpp: The main entry point for the application. Point.h: Defines the Point structure and related operations. Context.h: Contains constants and configurations for the game. State.h: Defines the State structure and methods for managing game states. Helper.h: Includes helper functions for initializing the game, applying moves, generating child states, and implementing the Q-learning algorithm.
Level 1
Episodes to solve : 5
๐ชต๐ชต๐ชต๐ชต๐ชต๐ชต
๐ชต ๐ชต
๐ชต ๐ชต
๐ชต ๐งบ๐ชต
๐ชต๐ชต๐ชต๐ชต ๐ชต
๐ชต๐ ๐ชต
๐ชต๐งบ ๐ชต
๐ชต ๐๐ชต
๐ชต๐ชต๐ชต๐ชต๐ชต๐ชต
Level 2
Episodes to solve : 40
โบโบโบโบโบโบโบโบโบโบโบโบโบโบโบ
โบ ๐ช ๐ช โบ
โบ ๐ซ ๐ ๐ช โบ
โบ ๐ซ๐ช ๐ช ๐ช โบ
โบ ๐๐ช ๐ช โบ
โบ ๐ช ๐ซ โบ
โบ ๐ช ๐ช ๐ช ๐โบ
โบโบโบโบโบโบโบโบโบโบโบโบโบโบโบ
Level 3
Episodes to solve : 110
๐ฟ๐ฟ๐ฟ
๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ
๐ฟ ๐ฟ๐ฟ๐ฟ๐ฟ ๐ฅฉ๐ฟ
๐ฟ ๐ ๐ฅฉ ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ
๐ฟ ๐ฟ ๐ฟ๐ฟ๐ฟ ๐๐ฟ
๐ฟ ๐ฟ๐ฟ ๐ฟ ๐ฟ ๐ฟ
๐ฟ๐ ๐ฟ๐ฟ๐ฟ ๐ฟ๐ฟ๐ฟ
๐ฟ๐ฅฉ ๐ ๐ฅฉ๐ฟ
๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ๐ฟ
Contributions are welcome! If you have suggestions for improvements or new features, please create an issue or submit a pull request. Follow these steps to contribute:
Fork the repository. Create a new branch (git checkout -b feature-branch). Make your changes. Commit your changes (git commit -m 'Add some feature'). Push to the branch (git push origin feature-branch). Open a pull request.