This repository implements an adversarial AI agent for the Pacman game, focusing on decision-making under competition between Pacman and multiple ghosts.
The project includes:
- A Minimax-based Pacman agent with heuristic evaluation
- Greedy ghost agents that pursue Pacman while avoiding collisions
- A clean separation between AI logic and an external game engine
The repository is intentionally kept minimal and focused, containing only the source code authored by the developer and visual material necessary to demonstrate gameplay behavior.
/
├── src/
│ └── gr/auth/ee/dsproject/
│ ├── node/
│ │ └── Node.java
│ └── pacman/
│ └── Creature.java
│
├── images/
│ ├── pacman.gif
│ └── ghosts.gif
│
└── README.md
Pacman’s behavior is implemented using a depth-limited Minimax search:
- Pacman acts as the maximizing player
- Ghosts collectively act as the minimizing opponent
- The search tree alternates between Pacman and ghost turns
- Decisions are based on heuristic evaluation of future game states
The evaluation function considers:
- Manhattan distance from ghosts (risk avoidance)
- Distance to remaining flags (objective completion)
- Captured vs non-captured flags
Ghosts follow a greedy pursuit strategy:
- Each ghost independently minimizes its distance to Pacman
- Wall collisions and illegal moves are avoided
- Ghost-to-ghost collisions (same cell or position swap) are prevented
This design provides a strong adversarial environment without introducing unnecessary complexity.
This repository does not include the Pacman game engine.
The AI agents are designed to run on top of an external Pacman engine, which provides:
- Maze generation
- Game rules and state updates
- Rendering and simulation control
This separation ensures that:
- The repository contains only original work
- The AI logic remains reusable and engine-agnostic
To run the project:
- Obtain a compatible Pacman game engine (
pacman.jar) - Place it locally (not included in this repository)
- Import the
src/directory into an IDE such as Eclipse - Run the game engine and select the provided AI agent
- Java
- Minimax Search
- Heuristic Evaluation Functions
- Adversarial Game AI
- Object-Oriented Design
- Compiled binaries and external dependencies are intentionally excluded.
- The repository focuses solely on AI logic and behavior.
- Visuals are provided only to demonstrate gameplay outcomes.
Ilias Korompilis
Educational and research use.
