IMGD 400X (B 09)
Homework Assignment #4
Due by Web Turn-In: Midnight, Sunday, November 8
(See general homework instructions for turn-in details.)
The purpose of this assignment is to start the process of developing your personal soccer team implementation, which will eventually be submitted as Homework #7 for entry into the soccer tournament.
- First you need to make your own modifiable copy of the code for Buckland's team:
- The name of your team will be your last name, e.g, "Smith", with "Team" appended, e.g., "SmithTeam".
- Create a new folder with your team name in SimpleSoccer/Teams and add a corresponding new node in VS Solution Explorer under Teams (right click > Add > New Filter).
- Copy all the files from Teams/BucklandTeam to your new folder.
- Change the name of all the files in your new folder by concatenating your last name on the front, e.g., "SmithFieldPlayerStates.cpp", etc. In VS Solution Explorer, add these files to your new team node (right click > Add > Existing Item).
- Modify all includes in your new folder which refer to files in BucklandTeam to instead refer to the corresponding file in your new folder.
- In your new file corresponding to SoccerTeam.h, concatenate your last name on the end of the strings "Blue" and "Red", e.g, "BlueSmith" and "RedSmith".
- In your new file corresponding to SoccerTeamMaker.cpp change the string "BucklandTeam" to your team name, e.g, "SmithTeam".
- At the end of Params.ini, change the name of the blue team to be your team name, e.g, "SmithTeam".
- Now, to test your work:
- Build and run (in debug mode) the SimpleSoccer solution.
- The game window should display your team's name as the blue team.
- If you get a run-time error, check that the blue team name in Params.ini is exactly the same as your team name in your version of SoccerTeamMaker.cpp.
- Of course, your new team just does exactly what Buckland's team did, because it uses all the same state objects. In order to head off in your own strategic directions, you need to systematically rename all of the states in your new folder, as follows:
- In all your new files, concatenate your last name on the front of every state name, e.g., change "Dribble" to "SmithDribble", etc. It will be easier if you start with your new files corresponding to TeamStates.h, FieldPlayerStates.h and GoalKeeperStates.h. (Use the Find and Replace edit command in Visual Studio to help you.)
- As a trivial first strategy change, choose different home positions for your field players on offense and defense by modifying the two arrays in the Enter methods of the states corresponding to Attacking and Defending in your version of TeamStates.cpp. (Mark your changes with "//*" comments.)
- Build and run (in debug mode) the SimpleSoccer solution to confirm that your team is using the new home positions. (Note that the kickoff positions will not change, since these are set by the arguments to the player constructors in SoccerTeam.cpp.)
- If your players suddenly revert to using the original home positions, it is because somewhere you have a state transition that uses one of the original state names, rather than the new one.
- In preparation for Monday's discussion and Homework #5, spend some time carefully observing and analyzing the Simple Soccer game play between Buckland's Team, your team and Burke's Team (which is also included in the source distribution)
- You can easily change team assignments (without recompilation) by changing Params.ini.
- Use the P key to pause and resume play.
- You can slow down the frame/update rate by changing FrameRate in Params.ini
- The soccer simulation itself has some bugs. Occasionally the ball will leave the field, with unpredictable consequences. Occasionally, all action will just stop, for no apparent reason. There's nothing you can do except restart using the R key.
- Does your new team play better or worse than Buckland's team? Why?
- What is the most severe deficiency that you see your team exhibit? How do you think it could be solved?
What to Turn In
- Zip file containing new team folder only.
- Text file containing answers to questions in last two bullet points above.
Please post any questions to the myWPI forum for the course.
- 2 points - Correct new team execution with new home positions.
- 1 point - Answers to questions
Acknowledgement: I would like to thank Robin Burke for allowing the reuse of this assignment.