The purpose of this lab is as follows:
- Create a team of multiple, cooperating agents.
- Learn how to use internal states for coding intelligent behavior.
- Tie together many of the ideas learned so far in class.
- Play games on the computer while under the guise of education.
For this lab, you will be the green team, and you will control five agents. One of these agents will start out frozen in enemy territory. Your mission is to send one of your agents to thaw your teammate (by tagging it), while your other agents protect your flag and retrieve the TA’s flag. You must also tag at least one of the TA agents.The TA team also has five agents. Two TA agents will attempt to steal your flag, two will guard the TA flag, and the other will wander aimlessly.
In bulleted form, to passoff you must:
- Thaw your frozen teammate
- Demonstrate a change in state/behavior by reassigning the agent that thawed your team mate to another task (e.g. - attack or defend)
- Freeze a TA agent
- Protect your flag from the TA agent
- Attempt to steal the TA flag and return it to your base
- Show a good-faith effort to beat the TA agent team. Winning is not required for this lab, but will be for the final lab (against this TA team).
- Pass off to a TA and show the TA your strategies
- Send a well-written, formatted (e.g. title, section headings, etc.) write-up in PDF or other well-known format to cs470ta@cs.byu.edu (do not include write-up in message body). Make the write-up longer than a couple of paragraphs. The write-up must include the following:
- Declaration of time spent by each partner
- What internal states you defined
- How your agents behave in each state
- Rules you used to determine when an agent changes roles -- attacker to defender, defender to attacker, defender to thawer, ... You can either report these as a series of if-then rules, or as a state machine.
- Which of the CS 470 algorithms and tools you used
- What you plan to improve on for the final project (class tournament)
IMPORTANT: Use the lab1_world map. Run your agent using the green team script, and the TA agents using the red team script.
If an agent is tagged while carrying a flag, the flag is sent back to the base.
In addition, obstacle information will only be available through the noisy occupancy grid, and the sensor readings from the BZFlag server contain noisy data with standard deviation of 5. These include flag positions and agent positions (excluding your own agents).
You are not allowed to "puppy-guard" your base, i.e. you cannot come within 50 units of it unless you are carrying your opponent's flag or they are carring yours. (To get the base information, send command "bases" to BZRC server. If you are using Python or C++, just add the method to your BZRC class. Or you can just remember your flag's starting position and not worry about it.)
For this lab, you will need to keep track of the state that an agent is in. You are free to define whatever states you want, and whatever rules you want for transitioning from one state to another. Your list of states might look something like this:
- State 0: Determine which agent is frozen
- State 1: Move towards a frozen teammate
- State 2: Wait for a teammate to unfreeze me
- State 3: Move towards an opponent to freeze him
- State 4: Move towards the flag to capture it
- State 5: Wait for an opponent to be frozen before I move towards the enemy base
- State 6: Carry opponent’s flag towards my base
- State 7: Loiter around flag to defend
Of course there can be other states, as well as sub-states. For example, in State 3, it might be important to store the callsign of the opponent you are attempting to freeze, so your agent doesn’t keep switching between two opponents, and freeze neither one of them. Within each state, your code should implement the appropriate behaviors for each agent, probably coded as potential fields. For example, in State 4, you probably want to have an attractive field around the opponents flag, and a repulsive field around enemy agents and obstacles.
- TA agent
- Run the server with sslab5.sh using lab1_world
- Run the TA team with redteam5.sh (occupancy grid and noise turned off, 5 agents)
- Run your agent with greenteam5.sh (occupancy grid and noise turned on with standard deviation of 5)
- Pass off Sheet