COM S 229 - Project 2
Deadlines
Project 2: Project 2 Specification Codebase:

These are individual projects spanning several weeks. Start Early! Starting on a project the weekend before the due date is a common way to fail (or drop) this course.

Your code will be tested on one of the department's Linux machines, probably pyrite.cs.iastate.edu. Your code must compile and run correctly on this machine. Code that does not compile may receive a grade of zero points! The projects will require one or two thousand of lines of code to implement (give or take; your mileage may vary). These should be organized into more than one source file, with the appropriate supporting documentation (a README file). Part of your grade will be on programming style: code should be legible and well-documented.

You must use a Makefile, so that all your executables may be built by simply typing make in the shell.

You are responsible for understanding the project specifications. These are written in natural language (English), and may be vague or contradictory (it is not easy to describe what a thousand lines of code should do). There will be an online discussion forum for the course, where students may clarify any questions about the specifications. (This is another reason to start early.)

Compilation Requirements
You will only change ssbros.cpp in order to add your instances of the Actor extensions. Different test cases will be run by modifying the command-line arguments. In some of the test cases, you may see simplehero or smarthero appear as the hero for smartenemy. During grading, we will use different actor IDs that perform similar tasks
Command-Line Arguments
Simple Hero
This hero will eat all eatables, given sufficient time, no enemies, and no "fast" powerups. (This is the only strategy required to be done by Part A.)

Here are some examples of easy/medium/hard instances.

Easy: ./ssbros maps/basic.txt --hero simplehero --delay-powerup 2

Medium: ./ssbros maps/jetsons.txt --hero simplehero --delay-powerup 2

Hard: ./ssbros maps/stronglyconnected.txt --hero simplehero
Smart Hero
This hero will eat all eatables, given sucient time, "slow" enemies, and no "fast" powerups.

Here are some examples of easy/medium/hard instances.

Easy: ./ssbros maps/pacman.txt --hero smarthero --enemy random --delay-enemy 4

Medium: ./ssbros maps/lastresort.txt --hero smarthero --enemy pursuer --delay-enemy 4

Hard: ./ssbros maps/tunnels.txt --hero smarthero --delay-enemy 3
Smart Enemies
This enemy will have a coordinated strategy that will guarantee the enemies win (by eating the hero, or by making time run out).

Here are some examples of easy/medium/hard instances.

Easy: ./ssbros maps/pacman.txt --enemy smartenemy --eatable random --delay-eatable 4 --hero simplehero

Medium: ./ssbros maps/stoleebros.txt --enemy smartenemy --eatable random --delay-eatable 2 --hero simplehero

Hard: ./ssbros maps/tunnels.txt --enemy smartenemy --eatable random --delay-eatable 1 --delay-enemy 2 --delay-hero 4 --hero smarthero
Smart Powerup
This powerup will try to make the enemies win by avoiding the hero and "hiding" near the enemies.

Here are some examples of easy/medium/hard instances.

Easy: ./ssbros maps/pacman.txt --hero simplehero --powerup smartpowerup --enemy random --delay-enemy 3 --delay-hero 3

Medium: ./ssbros maps/pacman.txt -hero smarthero --powerup smartpowerup --enemy pursuer --delay-enemy 3 --delay-hero 3

Hard: ./ssbros maps/pacman.txt -hero smarthero --powerup smartpowerup --enemy pursuer --delay-enemy 2 --delay-hero 2
Fun With Actor Types
The actor types are very flexible. Have fun by testing the following command:

./ssbros maps/pacman.txt --hero random --enemy actor --powerup pursuer --eatable pursuer --delay-hero 2

Maps
Maps are specified by regular text files. It is not your job to read these from input! The GameManager will manage this based on the command-line arguments. The first line should contain a word and then a width and height. If the word is "TORUS", then the map will "wrap-around". After this, the map is given by reading all non-newline characters (hopefully split into lines for each row of the map) Here are the character meanings: Again: You can mostly ignore the types of the positions and focus on the graph structure given by the GraphMap.

Here is a list of the maps with screenshots of their initial configuration. Feel free to add more to Piazza or to email them to me to add to this list! I have also rated each map with a difficulty.

Those without enemies can be used to test simplehero. Those with enemies can be used to test smarthero, smartenemy, smartpowerup.
basic.txt jetsons.txt open.txt pacman.txt
Easy Medium Easy Medium
stoleebros.txt stronglyconnected.txt tunnels.txt lastresort.txt
Medium Hard Hard Hard
treadmills_test.txt teleporters.txt test_for_smart_path.txt stronglyconnected2.txt
Easy Easy Hard Hard
Grading
For grading your AI's, I will use the following breakdown for relative amounts between the different difficulties:
Grading for Part 2A

Part 2A focused on the simplehero, so all test maps had no enemies (or the enemies were disabled using --disable-enemies). Here is a list of commands that we ran to test your code:

tar xvf *.tar.gz

cat README 

make clean 
make 

wget https://orion.math.iastate.edu/dstolee/229/project2/grading2a.tar.gz --no-check-certificate
tar xvf grading2a.tar.gz

cat test2a.txt >> Makefile

make test

The grading tarball includes some updates to the object files to allow for extra grading info. In particular, it will assign partial credit if only some of the eatables are consumed. Type "Enter" to close the final message.

Two of the easy tests use valgrind and --render-off to check for memory leaks or memory errors.

Actor Types
Each actor in the game is assigned an int specifying its type. This is given as a bitmask using the following identifiers: Note that a type can include multiple of these flags! For instance, all powerups have both the ACTOR_POWERUP and the ACTOR_EATABLE powerups.
Debug Messages
This game uses ncurses to create the game map. This will cause problems with any writing to standard out if you are rendering the game board. You can use the --render-off command-line argument to turn off the rendering and then you can use printf as much as you want.

Another option is to use #include <ncurses.h> and use the line
waddstr(stdscr, "This is a message!\n");

This will write the message until the screen is wiped for a new render. If you plan to use this type of message, then you should use command-line arguments (such as --delay 1000000) to slow the game.