#Shooter

by Lukas Jørgensen and Simon Jensen

Agenda

  • Reinforcement learning - our thesis
  • #Shooter and its mechanics
  • C# and how to write your AI

This slideshow is available at: http://lukasj.org/sharpshooter

Reinforcement Learning

What is Reinforcement Learning (RL)?

The RL model

What are we trying to do?

  • Build a RL-AI
    • Limited feature space (unlike e.g. Google)
    • Neural network
  • Remove implicit features -- see how it changes our results

The Game

The game world

  • The map is randomly generated
  • All obstacles are rectangles, and placed with the same rotation
  • The game is 50×50

The gameplay

  • You have 3200 ticks
  • The players' view is rendered by a red frustum
  • The player has 20 health, and deals 1 damage
  • The damage probability is a normal distribution with a stddev of 1

The model

The FeatureVector

  • Δ
  • Δ
  • Δ
  • - Increase in rotation
  • - Change in position
  • - Current velocity
  • - Probability of hitting
  • - Change in probability
  • - Distance to nearest obstacle in front
  • - Your health
  • - Opponents health
  • - Time elapsed
  • - Time since you saw the enemy
  • - Time since you took damage
  • - Time untill you can shoot again

The Actions

  • - Do nothing
  • - Move
  • - Rotate
  • - Shoot
  • - Prepare

Scripting your AI

C# vs Java

Setting up

  • Download the package from: deploy.zip
  • Extract the archive somewhere.
  • Open the solution "aiProject/GameAI.sln"
  • Open project settings and change the assemblyname and namespace
  • Build
  • Run the "Game.exe" file

Writing a simple obstacle-dodging AI

						
							using Torque3D;
							using Torque3D.Engine.Util.Enums;

							namespace GameAI
							{
							   public class AIClass
							   {
							      [ConsoleFunction]
							      public static PlayerAction MyThinkMethod(FeatureVector vector)
							      {
							         // Implement your AI logic here, compile and then run Game.exe
							         return PlayerAction.MoveForward;
							      }
							   }
							}
						
					

Writing a simple obstacle-dodging AI

						
              using Torque3D;
              using Torque3D.Engine.Util.Enums;

              namespace GameAI
              {
                public class AIClass
                {
                  [ConsoleFunction]
                  public static PlayerAction MyThinkMethod(FeatureVector vector)
                  {
                    if (vector.DistanceToObstacle < 1.5f)
                      return PlayerAction.TurnRight;

                    return PlayerAction.MoveForward;
                  }
                }
              }
						
					

Tournament information

  • The tournament starts after dinner
  • Each round is best of 5, finals are best of 7
  • The tournament will be livestreamed on Twitch
  • Standings will be published on Challonge

Special rules

  • If the game ends in a draw, no player gets a point
  • If the round ends in a draw, we will play sudden death
  • We may choose to decide for a rematch, if there are technical issues
  • You are allowed to update your AI between rounds
  • Do not attempt to invoke the other player's AI functions or in any way game the system. We did not put in security measures, so there's a lot of ways to game the system in an anti-fun way.

Final notes

When you want to submit an AI, share it with file.pizza and send the link to lpjoergensen@gmail.com or via Facebook.

Questions?