FIT3094 : AI for Gaming
Assignment 1: Pirates!
non-player character controlSemester 1, 2011
Task
Design and implement controllers for a mobile, non-player character in the context of a simple multi-agent computer game, Pirates!
Rectangular Bay is, as its name suggests, a rectangular bay (doh — well, actually it is square!). It is surrounded on all sides and littered within by dangerous ship-smashing rocks. Word is out that Polygon Pete, the richest, meanest pirate that ever sailed the seas, has deposited marker-buoys around the bay and on its rocky islands. Beneath each of these is suspended a rope attached to a small chest of gold.
Whilst Polygon Pete is on holiday in the Bahamas, all the local pirates are out scouring the bay for his treasure. You are to join them on your own ship which you drop from a helicopter into the bay...
Details
Non-player characters
- Your pirate ship with a single front-facing cannon on board.
- Everybody else's pirate ship with a single front-facing cannon onboard.
Player character
- There are no player characters. All pirate ships are controlled by AI software that you and your peers will write for this assignment.
Environment
The game is played around Rectangular Bay.
- Rocks: At the edges of the bay and scattered around inside it are deadly rocks (see figure below). If your ship hits these they will damage its hull. Eventually this will cause your ship to sink. You can see these obstacles from a distance so that you can avoid hitting them.
- Marker buoys: These indicate that Polygon Pete dropped a box of gold. Markers are very small and float on the water surface. Your ship can only see one when it is right on top of it. After gold is collected from beneath a marker by a ship, the marker remains in the water... so not all markers will have gold beneath them when your ship arrives.
Aim: Using an AI controller that you write, your pirate ship must navigate around the bay, searching carefully for gold without hitting rocks or other ships. Other pirates will try to beat it to the treasure. Your ship will need to avoid their cannons but of course it can use its own cannon to try to sink them!
Specification:
- Implement this game within the C++, OpenGL/GLUT, Unix-based framework provided in the "exercises and assignments" column of the weekly schedule.* Implement strategies for the Ship to
- Sail around the bay without colliding with rocks or other ships (10%)
- Search (e.g. random, raster-scan, breadth-first search or better) the bay for gold (40%)
- Avoid being hit by cannon fire from other ships (20%)
- Fire on other ships (10%)
- Win games against opponents by maximising the amount of gold collected! (15%)
Component 5 will be assessed by playing 10 games against your class mates (and, possibly, the lecturer). For each game, your ship will be deposited at a different random location in the bay with all other ships. Any ship that plays the game sucessfully and collects some gold during at least 1 of the 10 runs receives 5%. Any ship in the top 10 overall after 10 games receives 10%. The winner overall receives a full 15% for this component of the assessment and their ship may (or may not) be adopted as Polygon Pete for assignment 2, Pirate Fleet.
Components 1-4 are assessed by (i) the lecturer examining the code (ii) a demonstration in which you place your ship into a bay filled with 10 (relatively stupid) enemy pirate ships designed by the lecturer as part of the framework.
- Write a document outlining (in plain English) the algorithms your ship follows to solve 1-5 above (5%)
Consult the assignment submission details for information on how to complete you work.
*Assignments that do not employ OpenGL / GLUT or build and run correctly under UNIX within the framework provided will receive a mark of zero! The framework will be posted online prior to week 5.