Department of Information Technology
Higher Diploma in Game Software Development (IT114107) Year 2 Semester TWO
(2021/2022)
ITP4712 Logical and Artificial Intelligence in Games ASSIGNMENT
Copyright By PowCoder代写 加微信 powcoder
Due Date: 25 April 2022 (Monday) 9:30 am is a Java programming game, where the goal is to develop a robot battle tank to battle against other tanks. The robot battles are running in real-time and on-screen. The motto of Robocode is: Build the best, destroy the rest!
In this assignment, you are required to build some Robocode robots to accomplish different tasks. You will also need to have a design document on each robot you made.
To make the game more interesting, we are using a modified version of Robocode that can create obstacles in the battlefield before starting a game. In order to adapt to the customized version of Robocode, you need to download the Robocode setup file posted in the Moodle site. You robot must implement the following interfaces also:
robocode.robotinterfaces.IObstacleRobot and robocode.robotinterfaces.IObstacleEvents.
In IObstacleRobot interface, you need to implement the following method:
public IObstacleEvents getObstacleEventListener() { return this; }
The method will return an object that implements IObstacleEvents.
In IObstacleEvents interface, you need to implement the following methods: public void onHitObstacle(HitObstacleEvent event) { … }
public void onScannedObstacle(ScannedObstacleEvent event) { … }
The two methods will be implemented by the robot accordingly if the two events are to be handled. The HitObstacleEvent and ScannedObstacleEvent can give you the bearing of the obstacle and the distance between you and the obstacle (for ScannedObstacleEvent only) through the getBearing() and getDistance() methods form the event object.
Design a Chasing Robot
In this task, you will need to model a robot that chases and attacks TWO ObstacleEvader robots until they die in a map that contains a number of random obstacles of a size of 50×50 pixels. While your robot is making line-of-sight chasing to the enemy, it may encounter obstacles also. You will need to figure some ways to go around the obstacles and try to chase the same target after passing the obstacles.
Deliverables:
– A brief description how your robot avoids the obstacles and locks the same target while passing the obstacle.
– The robot’s java file.
Design a Robot as a Finite State Machine
In this task, you will need to model a robot using a finite state machine. There will be big blocks of obstacles (with size of 250×150 pixels) placed in the battlefield. There will be 6 other enemies in the battlefield also. Your robot should try to walk along the wall while attacking other robots. Your robot should also avoid being stuck into an obstacle or a corner. If there is only one robot left, your robot should turn into a chasing robot to destroy your last enemy. Your robot should have at least SIX different states. You may divide the states into sub-states if you want to. Here are some state suggestions:
• Idle (starting state)
• Finding Wall
• Avoiding Obstacle
• Avoiding Corner
• Moving Along Wall
You can add other states to improve your robot. Your robot will use its senses (radar or hit events) (i.e., onScannedRobot(),onBulletHit(), onHitByBullet() and etc.) and its own attributes (e.g., getBattleFieldWidth(), getBattleFieldWidth(), getX(), getY(), getOthers() and etc.) as the condition of state transition. You may also need to apply guessing and/or calculation to make your robot more robust.
Your current state can be stored as an instance variable. Try using switch case statement in your run() method. Each case represents the action for each state of your robot. The state transition should be triggered by the onXXX() methods and/or inside your run() method when you are checking your robot’s status.
Deliverables:
– A diagram representing the state transition of the robot.
– A brief description of the states and transition.
– The robot’s java file. You should try your best to implement the robot as the state machine
designed by yourself. Marks will be deducted if the robot does not implement as designed.
Design a Robot to Fight with your Classmates
In this task, you are free to use whatever approach to implement your robot. You will use the most recent version of Robocode (downloadable from Robocode website) for your Task 3. The ultimate goal is to defeat all other robots made by your classmates to earn bonus. If you do not have enough time to implement this part in your project, you may use the same robot in Task 1 or 2 (skipping the obstacle specific parts); but make sure you have renamed the robot and the package before you hand in.
During the battle with your classmates, sampleSentry.BorderGuard robots will be added into the battle mix. These BorderGuards will try to locate and attack the robots located in the sentry border area (default size: 100 pixels from the walls). Robots outside the sentry border area will not get any HP reduction even if it is hit by the BorderGuard bullets. On the other hand, your robots will not get any bonus HP by hitting these BorderGuards. To avoid wasting HP on attacking BorderGuards, you should use the method isSentryRobot()in ScannedRobotEvent class to check if the scanned enemy is a BorderGuard and you should skip attacking it. Also, you may like to keep away from the border area – to check the width of the border area, you can use getSentryBorderSize()inside your Robot class.
Deliverables:
The robot’s java file. You can have any reasonable name for your robot, but the name of the package of your robot must be your s+studentID, e.g., “s202122234”. If you need to have other supporting classes to run your robot, you also need to submit the source code of such files, under the same “s+studentID” package.
Instructions to Students
1. The weighting of this assignment is 40% of Continuous Assessment.
2. This assignment is an individual assignment and each student has to submit his/her own work.
Plagiarism is a serious offence and any assignments that involve any plagiarism will be given ZERO marks. The award of Zero marks will apply to all parties, regardless of whether or not a student is the original author or the plagiarist. Further disciplinary action will follow.
3. All work is to be submitted through Moodle on or before 9:30 am on Monday 25 April 2022. Late submission without valid reasons may be given ZERO marks.
4. You must use J2SDK 1.8 and the customized version of Robocode (robocode-1.8.2.0-CS-1-setup.jar) to develop the programs for your Task 1 and 2; and the most updated version of Robocode for your Task 3.
5. Your programs must follow the coding standard stated in Java coding standard published by Sun Microsystems. Marks will be deducted if the coding standard is not followed.
6. You are required to hand in your deliverables in different tasks following these instructions:
Each task should have its own folder (i.e., Task 1, Task 2 and sXXXXXXXXX).
In each folder, it should contain the robot Java source code (the robot itself and all
supporting class you have written) and a Word document containing the written report as
described in each task (for Tasks 1 and 2 only).
The three folders should be submitted as a single zip file through Moodle.
You must have one individual robot for each of your tasks; even if you want to use your
robot in Task 1or 2 to join the competition in Task 3.
Students who do not have the folder for any task will be considered as forfeiting the mark
for that task.
7. Marks: Task 1
(You will get some marks even you lost all battles)
35 marks 10 marks
10 marks 10 marks 5 marks
45 marks 10 marks
15 marks 15 marks 5 marks
Design (with documentation) Implementation – Line-of-Sight Chasing Implementation – Obstacle Avoidance Efficiency
Design (with documentation) Implementation – FSM Functional Implementation Efficiency
Fighting against classmates’ robots
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com