Skip to content

A Unity webGL game featuring an AI mouse, following cheese placed by the player to solve puzzles

Notifications You must be signed in to change notification settings

Davo0416/MouseAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Description

A Unity WebGL game made using Unity2D, VSCode and Krita. The games goal is to help the AI mouse that is trained to follow the cheese placed by you to solve puzzles. It features 5 levels increasing in difficulty and utilising gameplay elements like switches, buttons and enemies.

How the AI works

The AI agent was trained using the deep reinforcement learning framework provided by the MLAgents package. To analyze its surroundings, the agent is equipped with ray-vision configured to differentiate the goals and the hazards. After a couple hundred iterations of training in the training environment, the agent was ready to be deployed.

Training Enviroment

image
The training environment consisted of 4 walls, the AI agent and the goal. Every time the agent collided with the wall it would receive a penalty, and every time it collided with the goal it would receive a reward. This reward was greater when the agent completed the task faster, thus rewarding it for its speed. A time limit was also added to encourage the agent to move instead of doing nothing or moving in circles.

The Neural Network

NNDiagram
The underlying Neural Network consists of the Input Layer, the Hidden Layers and the Output Layer. The Input Layer contains the 11 ray sensor inputs, the hidden layers contain the neurons with the weights and biases configured during the training and the Output layer contains the 2 possible output values that the Neural Network can produce (The amount to rotate in the Z axis and the amount to move forward).

About

A Unity webGL game featuring an AI mouse, following cheese placed by the player to solve puzzles

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published