Skip to content
This repository was archived by the owner on Nov 18, 2023. It is now read-only.

izman48/Unity-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Iesa Wazeer CS310 Final Project

This is our final year project for the year 2020/2021

Running the game on Unity

Download and Install Unity 2019.4.12f1 Open the package in Unity

Running the training

Download and install Python 3.6.1 or higher

Use the package manager pip

(Recommended) Create a Virtual Environment Install PyTorch using:

pip3 install torch~=1.7.1 -f https://download.pytorch.org/whl/torch_stable.html

Install the mlagent package using:

python -m pip install mlagents==0.26.0

Usage

The Final Game folder contains the Fighter.exe file. This runs the game with the most advanced brain we were able to create.

To test the multiple brains we created:

  1. Open the Fighter folder in Unity.
  2. In the Unity Hierarchy open Fight Scene > Environment > Enemy
  3. In the inspector scroll down to "Behaviour Parameters"
  4. From the project directory within Unity open Assets > Brains
  5. Drag any of the brains (the .onnx) files into the "model" section in the inspector
  6. Click play to play against that AI

To run training:

  1. Activate your Virtual Environment
  2. Run the game using the Unity Game Engine
  3. Go to the Fighter base directory and use the command
mlagents-learn config/FighterAI.yaml --run-id Test
  1. Training has begun and you can use Cntrl + C to stop the training

If any other errors please refer to the UnityMLAgents documents. For installation issues check the installation document

About

Final year project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published