Welcome to the AI in Games Course! This university course focuses on applying reinforcement learning and pathfinding algorithms within the Unity game engine. The course is designed to give students hands-on experience with essential AI techniques and their applications in game environments.
This repository contains the project components for the course. The material is organized into three main sections:
- Rolling Ball Environment
Students will implement a custom Deep Q-learning (DQN) algorithm from scratch using Python, PyTorch, and OpenAI Gym. The objective is to train a rolling ball to reach a specific target on a square ground.
- Autonomous Car Environment
This section involves implementing and training a car agent using Unity'sml-agents
package. Students will apply the Proximal Policy Optimization (PPO) and Advantage Actor-Critic (A2C) algorithms to enable the car to drive autonomously around various tracks.
- Navigation System Creator
Building on the autonomous car project, students will implement a navigation system for the car agent within Unity. The task includes developing and experimenting with search algorithms such as Breadth-First Search (BFS), DFS, A*, and Dijkstra to navigate the car around obstacles and reach a destination.
AI_in_games_unity/
: Contains Unity scripts and scenes for both the rolling ball and autonomous car projects.Rolling_ball_Python/
: Includes Python scripts required for the custom Deep Q-learning implementation using PyTorch and Gym.results/
: Contains configuration files and performance graphs of the car agent.
To get started with the repository:
-
Unity Setup
-
Python Environment
- Make sure you have Python installed, along with the necessary packages:
pip install torch gym matplotlib
- Navigate to the
Rolling_ball_Python/
folder to run the Python code for the Deep Q-learning algorithm.
- Make sure you have Python installed, along with the necessary packages:
-
Rolling Ball
- Run the scripts in
Rolling_ball_Python/
to train the DQN model on the rolling ball environment.
- Run the scripts in
-
Autonomous Car
- Launch the Unity scene in
AI_in_games_unity/
and use theml-agents
package to train the car using PPO or A2C.
- Launch the Unity scene in
-
Navigation System
- Implement and test different search algorithms within Unity to guide the car's navigation.
- Custom Deep Q-learning implementation from scratch
- Autonomous driving using PPO and A2C algorithms
- Search algorithms for navigation, including BFS, DFS, A*, and Dijkstra
We welcome contributions! Please fork the repository and submit a pull request for any bug fixes or improvements.