关于算法:COMP222解答
COMP222 - 2022 - First CA AssignmentIndividual courseworkAsteroids-like GameAssessment InformationAssignment Number 1 (of 2)Weighting 12%Assignment Circulated Friday 4 February 2022Deadline Monday 28 March 2022, 17:00Submission Mode ElectronicLearning outcome assessed 2. An appreciation of the fundamental concepts associatedwith game development: game physics, game arti-ficial intelligence, content generation; The ability to implement a simple game using anexisting game enginePurpose of assessment To implement a simple 3D game using a game enginelibraryMarking criteria The marking scheme can be found in Section 3Submission necessary in order Noto satisfy Module requirements?Late Submission Penalty Standard UoL PolicyI enforce a “no error policy” in this module: If your code does not compile,your mark will be capped at 40%. Thus, you may get a higher mark for anincomplete solution than for an advanced sketch.1Figure 1: Before shooting asteroid Figure 2: After shooting asteroidObjectivesThis assignment requires you to implement a simple 3D game using the jMonkeyEnginelibrary. Optionally, you can use Unity 3D or Unreal Engine.Basic Game DescriptionThe objective of this assignment is to implement a game inspired by the classic arcade game“Asteroids”, see, for example, https://en.wikipedia.org/wiki...(video_game)and https://www.youtube.com/watch...The game is played on a rectangular “field” bounded by walls from above, below, left andright (the original game has no walls, but your game has). The game objects (“asteroids”)are positioned inside the field and can “float” in a linear movement (by translation). Whenan asteroid collides with a wall or another asteroid, it “bounces” (changes direction accordingto Newton Laws without gravity). A player controls a spaceship that is able to “fly” insidethe field and to “shoot” bullets. When a bullet strikes an asteroid, the asteroid “breaks”into a few smaller asteroids (at least 2 ) that float in directions and speeds different than thedirection and speed of the original (broken) asteroid. An asteroid can break into smaller onesat most 5 times, i.e. when an asteroid of minimum size gets shot by a bullet, the asteroiddisappears (is removed from the field). The player wins when all asteroids are removed fromthe field. The player loses when an asteroid collides with the spaceship.Figure 1 shows an example of the the game’s setup, i.e. within a field bounded by 4 walls,there exist 3 asteroids (large green balls) “floating” according to the blue vectors (arrows),as well as 1 spaceship (blue triangle) shooting towards one asteroid (red dashed line). Figureshows the effect of the bullet hitting an asteroid, i.e. it is removed from the game andreplaced by two smaller asteroids (smaller red balls) that float towards different directionsand speeds than the removed greed ball.2Marking SchemeThe assignment is split in a number of steps. Every step gives you some marks. You donot have to implement them in any particular order. Also, the steps below describe whatis expected from you in a bit more detail. It is up to you if you implement the followingfunctionalities using your game engine’s internal functions, or if you write your own functionsto do so. Neither choice will be favored with extra points.Step 1: Modeling the environment (10%)Model the playing field (4 walls), the asteroids and the spaceship. You can either use a 3Dmodeling tool like Blender or use the shapes of the game engine you implement the gamein. You must put at least 3 asteroids on the field, and exactly one spaceship. Make surethat the playing field is relatively large, i.e. if the size of the field does not facilitate smoothgameplay, marks will be removed.Step 2: Keyboard interaction (20%)In this step you should implement the control of the spaceship from input given by the humanplayer. Preferably the player should use the keyboard. However, using other input methods,such as the mouse, is not disallowed. The step is further divided into smaller sub-steps.Step 2.1: Implementing “fly” (15% / 20%)In this step you should implement the “flying” of the spaceship. The spaceship has someinitial direction and has its initial speed equal to 0. Assuming you take input from thekeyboard, you assign 4 buttons: button “forwards” increases the speed of the spaceshipalong the current direction; button “backwards” decreases the speed of the spaceship alongthe current direction; button “rightwards” rotates clockwise the direction of the spaceshipwith some fixed angular speed; button “leftwards” rotates counter-clockwise the direction ofthe spaceship with some fixed angular speed.Step 2.2: Implementing “shoot” (5% / 20%)In this step you should implement the “shooting” of the spaceship. Assuming you take inputfrom the keyboard, you assign 1 button “shoot” which releases a bullet from the positionof the spaceship and along the current direction of the spaceship. The speed of the bulletshould be relatively fast (at least faster than the spaceship). The amount of bullets is foryou to decide. The interaction of the bullet with the asteroids is described below in Step3.3.3Step 3: Physics 30% totalThe purpose of this step is to model the physical interaction of the game entities. The stepis further divided into smaller sub-steps.Step 3.1: Implementing “float” (5% / 30%)In this step you should implement the “floating” of the asteroids. They move linearlyaccording to a given initial direction and speed.Step 3.2: Implementing “bounce” (10% / 30%)In this step you should implement the “bouncing” of the asteroids. When an asteroidcollides with a wall, it should reflect off the wall. When two (or more) asteroids collide witheach other, they should reflect off each other. The bouncing should follow Newton’s Lawsand should not take gravity into account, because supposedly the game takes place in outerspace. When an asteroid collides with the spaceship, the player loses.Step 3.3: Implementing “break” (15% / 30%)In this step you should implement the “breaking” of the asteroids. An asteroid “breaks” intosmaller ones after it has collided with a bullet. “Breaking” means that the original asteroidis removed from the game and is replaced by 2 (or more) smaller asteroids. The direction andspeed of the smaller asteroids should be different than that of the removed asteroid. (I don’tpose any other restriction, it’s up to you how the smaller asteroids behave.) Also, breakingof an asteroid should be done at most 5 times, otherwise the game will never end. I.e. whenan asteroid of minimum size breaks, it is removed and not replaced by any asteroid(s).Step 4: Gameplay (20%)Add a visible points count and some kind of game levels. The point system is up to you todefine, for example every hit of a bullet with some asteroid gives 1 point, or you can have aspoints the percentage of bullets used to bullets that have hit asteroids. To get full marks forthis steps, you should have at least 2 levels and it should be clear when the player progressesto the higher level. Moreover, it is important that the levels have increasing difficulty. Howthis is achieved is again up to you, e.g. higher levels can have more asteroids, or fasterasteroids, or break into more asteroids, or can break more times, or combinations of theseoptions.Step 5: Creativity (20%)You can see that the marks for the steps described above add up to 80%. In order toget 20% extra you need to be creative and implement some nice features. Below are someideas: use textures, sound effects, lighting, power-up packs (making the spaceship immune4to impact with asteroids, or even able to function as a bullet itself), implement some systemon acquiring bullets, etc. Also, the above specifications do not define what happens if thespaceship or a bullet hits the wall. Typically, they should simply stop at the point of collision.However, you can be more creative here, and implement a weird bounce, or that they canexit the field from the point of collision and re-enter from the opposite side (like the originalgame).Deadlines and How to Submit Deadline for submitting the first assignment is Monday 28 March 2022, 17:00 Submission is via Canvas accessible fromhttps://liverpool.instructure... All submission must contain the source code, the executable, the necessary files for theruntime execution and a report.For jMonkeyEngine submissions you are advised to export your project (File →Export Project → To ZIP) and submit the ZIP file. Please ensure that the files yousubmit can be loaded into jMonkeyEngine.For Unity and Unreal Engine you are advised to build & export your game so thatit runs independently of these platforms; instructions are found online. To submit thecode you have scripted, copy it to a txt file. Please ensure that your submitted gameis playable.Please submit the report in the form of document (in pdf-format) containing acheck list indicating whether the above marking points have been implemented successfully.In the extra features part of the checklist, describe the features you haveimplemented.