ICCS Coursework 2: Game AI

Zack Lyons

 

Brief

In this coursework you will be designing an Artificial Intelligence to play the game Unreal Tournament 2004. Using the set of behaviours provided, along with any further action or sense primitives you wish to implement, you will put together at least one POSH (Parallel-rooted, Ordered Slip-stack Hierarchical) plan which will be executed at run-time by your agents. Three bots will be running on your team; you should strongly consider giving each its own plan and working out how they will complement each other. Everything you need is installed on the lab computers in EB0.8; if you want to get this running on your personal machine you will need to acquire your own copy of Unreal Tournament 2004, which is available cheaply online. The tournament will be run on the lab computers.

 

Tournament

Your game AI will be assessed through a tournament (30%) and a written report (70%). The tournament will consist of two parts:

 

 

Tournament Marking

You will get:

        If the winner of the tournament has previous experience with POSH or Behaviour Trees (whether from last year or their dissertation project), the highest-scoring person without such an advantage will also receive a discretionary 5%.

 

Getting Started

  1. Download the POSH UT2004 source code from the repository. Git and SmartGit are installed on all computers in EB0.8.
  1. Git command line: git clone https://code.google.com/p/posh-sharp/
  2. SmartGit GUI: Go to Project -> Clone and enter https://code.google.com/p/posh-sharp/ in the Remote Git Repository URL field. Click Next and select Git as repository type. Set the Local Directory path to somewhere on the C: drive (if you use the H: drive you will need to copy it to C: before you can run), then click Next. Enter a name for your project then click Finish.
  1. Go to the source folder you have just cloned and look for POSH-sharp.sln. Right click and select Open With “Microsoft Visual Studio 2010” (not 2012). You may be asked if you want to open untrusted projects: click yes (they can be trusted!).
  2. Right-click on the POSH-sharp project and click Properties. Go to the Debug tab and check that -v -a=PoshBot.dll POSHBot is in the Command Line Arguments field.
  3. Right-click on the POSH-sharp.core project and click Build. Then do the same for POSHBot, and finally POSH-sharp.
  4. Run Unreal Tournament 2004 and select Host Game. Double-click on GameBots CTF Game as the game type, and then choose CTF-Bath-CW3-small for the map. Click Dedicated and a console window will appear. The server is now running and available to join. You can configure the server name (there will be lots of servers running on the LAN during this coursework) under [Engine.GameReplicationInfo] in C:\UT2004\System\UT2004.ini.
  5. Run Unreal Tournament 2004 again and this time select Join Game. Find your server from the LAN list and join it, then select Spectate.
  6. In Visual Studio click Start Debugging. Your bot should appear in the game and can be observed from spectate mode. (The solution contains breakpoints for debugging but these can be toggled off.)
  7. Finally go to http://code.google.com/p/abode-star/ and download “Abode-star vs 004” to a convenient location. ABODE is an IDE to be used for writing your bot’s POSH plan.

 

The Coursework (Getting More Started)

After inevitably spending some time shooting the bot, you may realise that the bot could be smarter. This is where your coursework comes in. You will be improving bots in several ways: programmatically implementing actions and senses, and altering its plan.

  1. Implementing actions and senses.
  1. In the POSHBot project you will see the Combat, Movement, Navigator and Status classes. These contain all the current actions and senses the bot has; spend some time having a look at these but do not modify them.
  2. Template.cs contains comments that explain the contents of these behaviour classes, and provides you with a template to make your own. Try to add a new action or sense.
  3. You may have as many additional classes as you like, each with any number of actions and senses. Changes to the pre-existing classes will not be used in the tournament or marking. Your new behaviours will be automatically added to the bot’s library the next time you compile POSHBot.
  1. Modifying the plan.
  1. Open ABODE, then go to File -> Open and navigate to YourFolderName/POSHBot/plans. Select the .lap plan there and it will be displayed.
  2. After making changes, save as <username>.lap (e.g. ab123.lap).
  3. In Visual Studio, open POSHBot_init.txt in the POSH-sharp project (under library -> init). Change [PoshBot] to [<username>] and change the bot name to <username> A.
  1. Making a bot team
  1. You can add more bots simply by adding more entries in the plan file. An example is commented out by default. You can specify the plan to be used by each bot by just changing [POSHBot] to the plan you want to use for that bot, e.g. [MyPlanA].
  2. Note that all the agents can share the same behaviour library (senses & actions), they will behave differently because of their individual memories (variable state) and individual motivations (plan file)

 

Notes

You are now ready to begin. When developing your bot, keep in mind the following (these will make more sense after you’ve gotten started):

 

Good luck!

This document is a help resource intended to explain everything you need to know to get your bot(s) working and competing. Usual Moodle and lab support will be available as always so if you are struggling just ask on the forums or in person.