First Assignment Computer Game AI COMP09041 Issue Date: Tuesday, February 23rd, 2021 Due Date: 5pm, Monday, March 15th, 2021 Steering In this assignment you are provided with the C++ source file (gameai-assignment1.cpp) and CMakeLists.txt project file for an interactive 2D steering program which uses the Raylib game library and its corresponding C++ wrapper library: raylib- cpp. The scenario follows from previous labs, and involves two coloured trian- gular ships, with one (red) as the predator; and the other (blue) as the prey. Assignment Brief You should develop the following behaviour classes (described in the lectures, and in the “AI for Games” book by Ian Millington (2019)): a. Wander b. Align c. BlendedSteering Apply the Wander behaviour to the (blue) prey ship, and combine the Align behaviour with the provided Seek behaviour using the BlendedSteering class to make the predator (red) align towards, and seek the prey. Ensure the prey has a lower speed than the predator. When the prey is caught, play a sound, and respawn the prey at a random location on the screen. If either of the ships goes off the edge of the screen, ensure they reappear at the opposite side of the screen (screen wrapping). 1 Tips The following randomBinomial function may be useful in your definition of the Wander behaviour. f l o a t randomBinomial ( ) { std : : random device rd ; std : : mt19937 gen ( rd ( ) ) ; s td : : u n i f o r m r e a l d i s t r i b u t i o n
d i s ( 0 . 0 f , 1 . 0 f ) ; r e turn d i s ( gen ) − d i s ( gen ) ; } ; To play a sound, first create a raylib::AudioDevice object and a raylib::Sound object constructed from a file in the resources directory provided. Call the raylib::Sounds::Play method when a prey is caught. Group Project You should work in a team of two. Submit the code you develop; including the resulting executable; along with a short pdf report of approximately 500 words; as a single zip to myUWS (Moodle) by the date noted above. Marking Scheme The assignment is worth 30% of the marks awarded for the entire COMP09041 module. The following provides a breakdown of the marking scheme: Written report 5 Wander Steeing Behaviour 5 Align Steering Behaviour 5 Blended Align and Seek Behaviour 5 A Sound when the Prey is Caught 3 Prey and Predator respawn after being Caught 3 Screen Wrapping 4 Advice You are encouraged to take inspiration from the descriptions and pseudocode of the “AI for Games” book, but you need not follow its guidance to the letter. It does contain mistakes, and you may yourself have a better way of organising your code to achieve the high-level predator-prey behaviour which is the true objective of the assignment. 2 Plagiarism Ensure your team’s work is yours alone. You can discuss ideas with your fellow students regarding how to prepare a solution, but the copying or sharing of code is not permitted . (Distinctive work is encouraged and rewarded.) Anonymity Please use only your Banner ID to identify yourself in your submission. 3 欢迎咨询51作业君