====== FYP IK0802 Game On iPhone (Semester 1) ====== ====== Title ====== Wonderful Blue ====== People ====== Supervisor: [[king@cse.cuhk.edu.hk|Prof. KING Kuo Chin, Irwin]] Student: [[hctsang6@cse.cuhk.edu.hk|Tsang Hing Chung]], [[hktang6@cse.cuhk.edu.hk|Tang Hing Kon]] ====== Game Description ====== * Wonderful Blue The game will simulate a aquarium. There will several kind of marine creatures, such as fish, shark, octopus, lobster, etc.\\ Initially, there will be only two or three fish. Players need to buy food to feed the fish. Then the fish will grow and when they become bigger and bigger, they will drop emerald, ruby, sapphire, diamond, etc according to the size of the fish. Different gem give different amount of point and the player need to touch the gems in order to collect them. The point is used to buy thing like food, fish and used to upgrade food, weapon and more important, to proceed to the next level.\\ Why do we need weapon? Since monsters will appear periodically, we need weapons to destory them and protect the marine life. If all the fish are eaten by the monster, game is over.If the player can earn a target amount of point, he can proceed to the next level.\\ In the next level, there will be one more kind of marine creature or may be more weapons. Also, after completing each level, there will be a pet that can help playing the game, e.g. can make the fish dropping more gems, can protect the fish fromt the monster, can help attacking the monster, can help collecting the gems, etc.\\ ====== Draft Interface ====== {{fyp:design.jpg?600x375|}} ====== Game Features ====== * Use multi-touch to release food * Use gesture to change the type of food to feed different kind of creatures * When monster appear, use accelerometer to control the movement of the fish to keep away from the monsters * Use gesture to make a special attack to the monster ====== Techniques applied ====== * Multi-touch * Gesture * Accelerometer * Sound * 2D graphics ====== Schedule (Sem 1) ====== ^ Week1 | Game design and Scheduling | ^ Week2 | Game design (Work on the details and Story line) | ^ Week3 | 1. Design the class(modeling) \\ 2. Learning of Objective-C | ^ Week4 | 1. Design the class(modeling) \\ 2. Learning of SDK (Multi-Touch) | ^ Week5 | Learning of SDK (Accelerometer) | ^ Week6 | Learning of SDK (Audio) | ^ Week7 | Implementing the Model classes | ^ Week8 | Implementing on the Model classes | ^ Week9 | Implementing on the main game logic | ^ Week10 | Testing and Debugging | ^ Week11 | Testing and Debugging | ^ Week12 | Testing and Debugging | ^ Week13 | Documentation | ^ Week14 | Documentation | ====== Modeling ====== ===== Class Creature ===== ^ **Property** | **Type** | **Details** | ^position | float[2] | position on the screen | ^velocity | float[2] | velocity of the creature | ^acceleration | float[2] | acceleration of the creature | ^size | float[2] | size of the creature, defined by the surrounding rectangle | ^imageName | NSString* | the name of the its image | ^texcoords | GLshort* | the texture coordinate | ^foodEaten | NSDictionary* | the number of each type of food that the creature eaten | ^gem | Gem | the gem that the creature release periodically | ^lastMealTime | int | the last time that it ate | ^timeTillHungry | int | the amount of time that it will be hungry | ^timeTillDead | int | the amount of time that it will die if it hasn't be fed | ^state| enum kCreatureState | the state of the creature, e.g. HUNGRY, FULL, ILL, DEAD | ===== Class Item ===== ^Property | Type | Details | ^imageName | NSString* | the name of its image | ^price | float | how much does the item cost | ^hiden | BOOL | the items are hidden unless some condition met | ===== Class Gem ===== ^Property | Type | Details | ^imageName | NSString* | the name of its image | ^value | float | the value of the gem | ===== Class Food ===== ^Property | Type | Details | ^size | float[2] | size of the creature, defined by the surrounding rectangle | ^position | float[2] | position on the screen | ^velocity | float[2] | velocity of the food | ^acceleration | float[2] | acceleration of the food | ^imageName | NSString* | the name of its image | ^nutritiveValue | int | the nutritive value of the food | ====== Comparison ====== ^ | Aquarium | Marine Aquarium | FreshWater Aquarium | Koi Pond | Spore™ Origin | Fish Tycoon | ^ Graphic | 2D, \\ simple cartoon | 2D, \\ realistic | 2D, \\ realistic | 2D, \\ Dynamic water simulation | 2D, \\ cartoon | 2D, \\ realistic | ^ Sound | 2D | 2D | 2D | 3D | 3D | 2D | ^Networking | No Networking / Multiplayer |||||| ^Multi-touch | ✘ |✘ |✘ | Touch to give water ripples |✘ |✘ | ^Accelerometer | ✘ |✘ |✘ | Shake | Tilt, Turn, Twist |✘ | ^Growth |✘ |✘ | ✔ | ✔ | ✔ | ✔ | ^Evolution |✘ |✘ |✘ |✘ |✔ |✘ | ^# Level |✘ |✘ |✘ |✘ |30 |✘ | ^Language | English |||||| ^# Reviews | 0 | 0 | 1 | 18 | 17 | 0 | ^Price(USD) | 0.99 | 1.99 | 0.99 | 0.99 | 9.99 | 1.99 | ^Rating \\ (Out of 5) | NA | NA | 4 | 3.5 | 4.5 | NA | ^Special | ✘ | Very Realistic | Information about fish \\ Realistic | Dynamic water simulation \\ Top view | Customize creatures \\ Evolution | ✘ | ====== UML Diagram ====== {{:fyp:ik0802:uml.jpg?640}} ====== Screen Shot ===== ^ **Screen Shot** ^ **Screen Shot** | | {{:fyp:ik0802:menu.jpg?320}} | {{:fyp:ik0802:game_over.jpg?320}} | | This is the menu of Wonderful Blue | When the player fail to achieve the goal, the game is over. \\ Player can continue at the previous level | | {{:fyp:ik0802:goal_mode.jpg?320}} | {{:fyp:ik0802:survival_mode.jpg?320}} | | This is one of the game mode: Gold Mode. \\ Player need to achieve the target points within the time limit. | This is another game mode: Survival Mode | | {{:fyp:ik0802:init.png?320}} | {{:fyp:ik0802:feed.jpg?320}} | | Initially, there are ten fish on the screen | Player can touch on the free space on the screen to release food. \\ Multi-touch is also supported. | | {{:fyp:ik0802:release_gems.jpg?320}} | {{:fyp:ik0802:evolve.jpg?320}} | | Some of the creatures are releasing gems! \\ Touch the gems before they disappear! | See the bubble? The creature is evolving! | | {{:fyp:ik0802:enemy.png?320}} || | Enemy appear! Attack them quickly ! \\ Multi-touch is also supported|| ====== Diary ====== | **Date** | **Thing done** | **Duration** | **Status** | ^ **Week 1** |||| | 08-09-08 | Game's features dicussion \\ 1.success of NDS related to our game design? \\ 2.what type of our game is? \\ 3.how to attract people? \\ 4.the price setting? | 2 hrs | Done | | 09-09-08 | Game's features dicussion \\ 1.Focus on the simulation game \\ 2.simple game rules and cute character \\ 3.Attract all age group \\ 4.have touch screen and sound detection | 3 hrs | Done | ^ **Week 2** |||| | 11-09-08 | iPhone Study Group Meeting\\ 1. Basic OpenGL ES drawing, texture mapping\\ - how to create a texture with different size of pricture\\ - draw different polygon by glVetexPointer and glDrawArray instead of glBegin and glEnd\\ - how to texture map to a object when it is moving?(Problem)\\ 2. Collision detection\\ - how to do a 2D collision\\ - only detect the x and y coordiantions\\ - how to do a 3D collsion\\ - need to detect the z coordination | 1 hr | | 12-09-08 | Adding other interest features\\ 1.Enemy will appear periodically and eat the creatures\\ 2.The game has two different modes\\ - Gold mode --- players need to collect the target amount of points within the time limit. The higher the level is, the larger amount and shorter time is\\ - Survival mode --- the number of enemies is more than the gold mode and the enemies appear more frequently. The goal of this mode is to protect the creatures from the attack of enemies. If all the creatures died within the time limit\\ | 2 hrs | Done | | 13-09-08 | Learing the syntax of Objective C \\ Thing Learned: \\ 1. Create Classes \\ 2. Create Interface \\ 3. Create Protocol \\ 4. Memory Management (Reference counting) \\ 5. @property, @synthesize contruct | 2 hr | Done | | 14-09-08 | Case learning about openGL\\ 1. How to display a photo\\ 2. Draw a polygon\\ Problem Encountered \\ 1. Want to draw a polygon after each touch, but failed | 3 hrs | ^ **Week 3** |||| | 18-09-08 | iPhone Study Group Meeting | 1 hr | Done | | 20-09-08 | The above problem Solved. Method: \\ 1. Using array in C instead of NSMutableArray in Obj-C | 2 hr | Done | | 22-09-08 | Discussion on Modeling | 1.5 hr | Done | | 22-09-08 | Problem on 14/9 is solved totally, using NSMutableArray \\ Bug found: \\ [NSMutableArray array] ✘ \\ [[NSMutableArray array] retain] ✔ | 0.5 hr | Done | | 22-09-08 | Learning of texture mapping | 1 hr | Done | ^ **Week 4** |||| | 25-09-08 | Searching for suitable picture for background and fish\\ 1.Should find a ocean background without anything or already decorated\\ 2. search "ocean" on the google and get two different pictures.\\ - one is for the start menu\\ - one is for the game background | 1 hr | | 29-09-09 | Use texture mapping to map the background. \\ Problem: The dimension of the background image is not in the power of 2, \\ so the original code for texture mapping doesn't work. \\ Solved: By studying the Crash Landing example from Apple | 4 hrs | ^ **Week 5** |||| | 01-10-08 | Learning about how to design the classes from apple's example: \\ 1. Crash Landing \\ 2. Touch Fighter II | 3 hrs | | 02-10-08 | Design of UML diagram | 2 hrs | ^ **Week 6** |||| | 08-10-08 | Design of game features\\ 1.Backup System \\ - support saving the current progress \\ - don’t want player losing all their playing progress \\ - save and load the progress record function must to be implemented \\ - autosave \\ - manual save mechanism \\ - pause and resume the game at anytime | 2 hrs | | 10-10-08 | Design of game features\\ 1.Sound System \\ - The sound system consists of two parts\\ - The first part is the background music \\ - the second part is other sound effect \\ - have different background music on each level\\ - when the player makes any action or there is any event occurred during the game, a sound effect will be produced\\ - we are going to implement a stereo sound system | 2 hrs | ^ **Week 7** |||| | 14-10-08 | Implementing the GameObject Class | 3 hrs | ^ **Week 8** |||| | 20-10-08 | Implementing the Creatures Class and the main game logic | 4 hrs | ^ **Week 9** |||| | 24-10-08 | Implementing gems releasing \\ Thing Done: \\ 1. Creatures can swim \\ 2. Release gems periodically \\ 3. Touch to release food \\ 4. Showing the playing time | 10 hrs | | 26-10-08 | Implementing how to trace a particular food \\ Possible Algorithm: \\ 1. Predict the location of collision and set the velocity once \\ 2. Keep adjusting the velocity until collision | 2 hrs | | 27-10-08 | 1. Learning of PhotoShop \\ 2. Designing the creatures | 10 hrs | | 28-10-08 | Implementing the vision of the creatures \\ The creature can only have a vision of 90 degree | 3 hrs | | 28 -10-08 | Implementing tracing the food with shortest distance that the creature can "see" \\ Problem : algorithm with time complexity O(mn) may not be efficient enough | 2 hrs | ^ **Week 10** |||| | 02-11-08 | Implementing the enemy system \\ 1. Enemy has life \\ 2. Touching reduce enemy's life \\ 3. Enemy can trace the creature and kill them | 6 hrs | | 03-11-08 | Implementing the Evolution feature \\ 1. A score system to calculate the nutrient value of food eaten \\ 2. Matching the score with the evolution type score to confirm the evolution type \\ 3. Creature can evolute to other type or enlarge their size | 6 hrs | ^ **Week 11** |||| | 10-11-08 | Learning Photoshop and making the start menu | 2 hrs |