Skip to content

AI agents for the EUTOPIA Pacman Capture-the-Flag contest, featuring Q-learning, Bayesian inference, and adaptive strategies for both offensive and defensive gameplay with pre-trained weights.

Notifications You must be signed in to change notification settings

apattichis/Contest-Pacman-Capture-the-Flag-EUTOPIA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

EUTOPIA Pacman Contest image

EUTOPIA Contest Banner

Overview

The EUTOPIA Pacman Contest is a competitive team-based challenge where participants develop intelligent agents for a capture-the-flag variant of Pacman. Based on Berkeley's CS188 course and adapted by UPF with contributions from RMIT and UoM, this Python-based framework provides a platform for implementing and testing advanced AI strategies.

image image image

Game Rules

  • Map Structure: The playing field is divided into two halves, with each team defending their side while invading the opponent's territory.
  • Objective: Collect food pellets from the opponent's side and return them safely to your territory.
  • Scoring: Each food pellet returned to your territory earns one point.
  • Victory Conditions: Win by collecting all opponent's food or having the highest score when time expires.
  • Constraints: Players must manage computational resources efficiently to ensure timely actions.

Repository Content

This repository provides implementations of advanced AI agents for the EUTOPIA Pacman Contest:

Getting Started

  1. Clone the EUTOPIA contest repository:
    git clone https://github.com/aig-upf/pacman-eutopia
  2. Replace team_name_X with your team's name
  3. Add the desired version file (v1.py or v2.py) to your repository

Agent Implementations

Version 1 (v1.py)

  • OffensiveQLearningAgent: Employs Q-learning for strategic offensive play with dynamic action selection, feature-based decision making, and Bayesian inference for tracking opponents.
  • DefensiveReflexCaptureAgent: Focuses on territory defense using patrol strategies around key chokepoints, with Bayesian belief distributions to track invaders when not directly visible.

Version 2 (v2.py)

  • OffensiveQLearningAgent: Enhanced Q-learning agent with weight persistence and adaptive strategy development.
  • DefensiveQLearningAgent: Q-learning defender that focuses on protecting territory and intercepting invaders, with patrol strategies around key entry points and Bayesian inference for enemy tracking.

Pre-trained Weights

The repository includes optimized weights for both offensive and defensive agents, enabling immediate high-performance gameplay without training:

  • default_offensive_weights.json: Optimized weights for offensive strategies
  • defensive_agent_weights_613de35e-a3b5-4f6b-bbe5-579884aa87f0.json: Refined weights for defensive play

Key Features

  • Reinforcement Learning: Both versions leverage Q-learning to improve performance over time.
  • Bayesian Inference: Used for probabilistic tracking of opponents even when not directly visible.
  • Adaptive Strategies: Agents dynamically adjust between offense and defense based on game state.
  • Strategic Patrolling: Defensive agents identify and monitor key map locations to intercept invaders efficiently.

About

AI agents for the EUTOPIA Pacman Capture-the-Flag contest, featuring Q-learning, Bayesian inference, and adaptive strategies for both offensive and defensive gameplay with pre-trained weights.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages