The Dr Arm Game

This learning path is based on the video workshop Using Unity’s Machine Learning Agents on Arm and uses the same Dr Arm game project files (provided in the supporting zip file you extracted earlier).

In the game, you control a fighting character (a Paladin) in battle against an AI opponent (a Vampire).

The battle takes place in a small 3D arena. Both characters can perform the following actions:

  • Move (left, right, forward, backward)
  • Roll
  • Sword attack
  • Fireball attack

Use the on-screen touch controls to control your character on mobile. The AI opponent is driven by an AI “brain” created with the ML Agents Toolkit.

Open and test the game

Before diving into machine learning in Unity, look at the game. There is a ready-to-play version in the Unity scene called Level_DevSummit2022_ReadyToPlay.

Later sections of this learning path explain how the model was pre-trained and plugged into the game.

Dr Arm is intended for mobile play but you can test it within the Unity editor first to ensure everything is present and correct. To do this, run the game in demo mode, which shows two AI characters battling each other.

In the default editor layout:

  1. Navigate to the Assets/#DevSummit2022/Scenes directory in the Project panel

  2. Double-click the scene file Level_DevSummit2022_ReadyToPlay (depending on your platform or settings, it may show the .unity file extension)

  3. The scene should open inside the Scene tab

  4. Click the play button

  5. You may some some warnings in the Console tab but these can be ignored as we haven’t done all the machine learning steps yet

  6. You should be presented with a simple title screen with a menu of Easy, Medium, Hard and Demo options

Image Alt Text:Dr Arm Title ScreenFigure 1. Title screen with menu options

  1. Click Demo to run a battle between two AI characters

Image Alt Text:Dr Arm Demo ModeFigure 2. Demo mode running two AT characters against each other

The screenshots above show a working version. If you see something similar, you know everything is working as expected.

The next section dives into machine learning and how ML is leveraged in Dr Arm.