Artificial Intelligence Coursework by RohanMenon92 - 1

AIGames & Projects

AI Coursework demonstration I created to have a Finite State Machine AI and ML Agent trained AI enemies for an arcade tank combat game in Unity

Unity 2018.3.12f1Unknown LicenseUpdated 15 days agoCreated on February 21st, 2020
Go to source

Tank FSM and ML Agents

For the AI course I decided to write a program that generates an enemy tank AI which isable to respond to player actions and figure out how to fire and block projectiles. The player decides the movement of the tank, firing a bullet and using a shield to block anattack.

The FSM agent patrols and attacks when the player is in range. If it has low health, it will try to run away and shield after shooting.

For training and using the ML-Agents algorithm and to generate a usable Neural Network, I am using the “ml agents” package provided by Unityto use Tensorflow provided by google with Python as the primary scripting language.

The key learning for the AI should be to move towards the player and when looking at the player, it should try to shoot. The game is relatively straight forward but defining an AI that does these movements in a “non predictable” fashion is quite challenging due tothe simplicity of the game.


Report: (Updated).pdf


There are 3 scenes:

  • FSMScene: Play against a tank controlled by a finite state machine
  • MLAgentFSMScene: To train a ML agent against the FSM
  • MLAgentMLScene: To train an ML Agent against another ML Agent
  • MLPlayingScene: Play against an ML agent


  • W,A,S,D to move
  • SPACE to shoot
  • Shift to shield


Agent fighting FSM Scene Training

Show all projects by RohanMenon92