CS/IMGD 4100 (C 16)
Homework Assignment #8
My Bot
Due by Web Turn-In: 11:59pm, Wednesday, February 10
(See general homework instructions for turn-in details.)
The purpose of this assignment is to start the process of developing your personal Raven bot implementation, which will eventually be submitted as Homework #12 for entry into the Raven tournament.
Make sure you start with fresh (uncompiled) copy of the source files for this project!
- First you need to make your own modifiable copy of the code for a bot:
- The name of your bot will be your last name, e.g, "Smith", with "_Bot" appended, e.g., "Smith_Bot".
- In Windows Explorer, create a new folder with your bot name minus the underscore (e.g., "SmithBot") in Raven/Bots and then add a corresponding new node in VS Solution Explorer under Bots (right click > Add > New Filter).
- In Windows Explorer, copy all the files from Bots/RBBot to your new folder.
- Change the name of all the files in your new folder by replacing "RB" with your last name, e.g., "Smith_TargetingSystem.cpp", etc.
- In VS Solution Explorer, add all the files in your new folder to your new node under Bots (right click > Add > Existing Item).
- In all your new files, replace every occurrence of "RB" with your last name.
- Use the Find and Replace edit command in Visual Studio to help you.
- Make sure you select Match Case under options!
- If you make sure only your new files are open, you can use the 'Look In: All Open Files'
option to make the substitutions in one command.
- In your new file corresponding to RB_Bot.cpp, modify the definition of the GetName method to return your last name instead of "Burke".
- At the front of Params.lua, change the name of the third bot from "Raven_Bot" to your bot name, e.g, "Smith_Bot".
- Now, to test your work:
- Build and run (in debug mode) the Raven solution.
- The game window should display your bot name, e.g., Smith401, as one of the bots. (Set General Bot Info > Show IDs).
- If you get a run-time error:
- Check that the third bot name in Params.lua is exactly the same as your bot name in your version of RB_BotMaker.cpp
- Make sure you named your filesystem folder without the hyphen (second step above)
- Make sure you added all your new files to the VS project (fifth step above)
- Of course, your new bot just does exactly what Burke's bot did. In order to head off in your own strategic directions for the tournament assignment, you will eventually need to also copy some or all of the code under the "goals" node in the Solution Explorer to your new folder and make the appropriate modifications.
-
To get started, however, please make the following small modification to the targeting strategy of your bot:
- Instead of always targeting the lowest-health opponent in view, first check to see if there is an opponent within the range of your current weapon whom you could kill with a single shot, i.e., whose health is less than or equal to the damage inflicted by your current weapon. Otherwise target the closest bot.
- Note that there is unfortunately no field in a weapon which you can query to find out what kind of projectile it fires. You will have to code you own switch statement with this knowledge.
- Add a debugging print statement so you can tell when this special case is executed.
- See Buckland, Chapter 4, page 191 for use of debug_con.
- You will need to uncomment line 41 in Common/Debug/DebugConsole.h (#define DEBUG)
- Hint: You are allowed to temporarily change some of the weapon parameters to cause your special case to be executed more often.
- In preparation for the upcoming in-class brainstorming session and Homework #10, spend some time carefully observing and analyzing the combat between Buckland's bot, your bot, and Burke's Bot (which is also included in the source distribution).
- Does one of the three bot designs perform noticeably better or worse? Why?
- What is the most severe deficiency that you see exhibited? How do you think it could be solved?
What to Turn In
- Zip file containing:
- your new bot folder only.
- copy of DebugLog.txt demonstrating modification above
- text file containing answers to questions in last two bullet points above.
Grading
- 2 points - Correct bot execution and modification to targeting strategy.
- 1 point - Answers to questions.
Please post any questions to the myWPI forum for the course.
Acknowledgement: I would like to thank Robin Burke for allowing the reuse of this assignment.