This project, led by Prof. Garg, involved designing agents for the two-player board game 'Four in a Row'. The game's objective is to be the first to form a line of four discs in a vertical, horizontal, or diagonal arrangement on a seven-column, six-row grid. This project required implementing three specific algorithms for the game's AI agents.
The project's methodology included:
- Minimax Implementation: Developing a depth-limited minimax algorithm for searching to an arbitrary depth within the game tree.
- Alpha-Beta Pruning: Implementing alpha-beta pruning to enhance the efficiency of the minimax search as the tree depth increases.
- Expectimax Algorithm: Modeling probabilistic behaviors of opponents through the expectimax algorithm, using chance nodes to simulate suboptimal decisions made by opponents.
Evaluation of the project was conducted through:
- Game Simulation: Using a provided GUI to simulate the game and test the performance of the implemented algorithms.
- Algorithm Testing: Running adversarial searches within the game, with the AI agent playing as the MAX player against different opponent types.
- Functionality Verification: Ensuring the algorithms correctly execute game strategies and make optimal decisions based on the game state.
- Successful integration and functioning of minimax, alpha-beta pruning, and expectimax algorithms in the game environment.
- Effective modeling of opponent behaviors and decision-making processes in the game.
- Enhanced gameplay experience and strategic depth achieved through the implementation of advanced AI algorithms.
- Complete Project Development: Solely responsible for the entire project development, including the implementation of all algorithms and integration with the game environment.
- Algorithm Design and Optimization: Designed and optimized the minimax, alpha-beta pruning, and expectimax algorithms for effective gameplay.
- GUI Integration and Testing: Integrated the algorithms with the provided GUI and conducted extensive testing to ensure optimal performance and user experience.
- Evaluation and Analysis: Analyzed the performance of AI agents in various game scenarios, refining the algorithms for better efficiency and strategic depth.
This project achieved its aim of creating sophisticated AI agents for 'Four in a Row', demonstrating the effectiveness of advanced algorithms in game strategy development and AI decision-making. The project showcased the potential of AI in enhancing gameplay complexity and providing challenging and engaging experiences for players.
- Clone the repository to your local environment
- To run the game, use the following command:
python four_in_a_row.py