I. The Behind Story...
The red bird from Angry Birds had exuberant dreams: to be reborn as a powerful truck, to fly in a spacious 3-d world, and to revenge the police (not those green pigs). These dreams come true in Angry Trucks -- your goal is to launch the truck and hit as many objects as hard as you can.
II. How to build and run program
- Need iOS SDK and Xcode (Xcode 3.2.5 and iOS SDK 4.2 or similar will do)
- Build and Run! (To load onto device, you’ll need developer provisioning profile)
- Tested on the following devices:
- iPod Touch, 4th generation (iOS 4.2.1)
- iPad, 1st generation (iOS 3.2, 4.2, 4.3)
- iPad, 2nd generation (iOS 4.3)
III. Advanced Features & Implementations
- Mobile Devices - creating the game on iOS devices [Difficulty: hard]
- We implemented our project using OpenGL ES 2.0
- We ported over Bullet and Assimp and modified/ compiled to work with iOS.
- We leverage multi-touch gestures for game control
- We use dual-view design: the front view is for the main game play; the flip view is for miscellaneous settings.
- We synthesize audio by accessing the mobile device’s audio buffer (see below)
- Physically-based sound [Difficulty: hard to very hard]
- Using MoAudio from the Mobile Music Toolkit -- which Nick and Jieun are among its authors -- and the Synthesis Toolkit, we synthesize audio on iOS devices by directly manipulating samples of the stereo audio buffer.
- We implemented 3-D Doppler shift to simulate the sound of passing by a police siren, flying through the air.
- We performed real-time synthesis of police siren using FM synthesis: square carrier waves are frequency-modulated by triangle waves. Multiplying and dividing the frequencies of the carrier wave by factor of 8 is used to simulate 3 different siren types.
- The total impact of the collision against objects is used to adjust the gain of explosion and impact sound effects.
- In addition to the above, the total impact of the collision against various objects is used to adjust various parameters of a Resonant Biquad filter that emulates how physically hard/soft an object sounds as it is hit.
IV. Basic Game Controls
- Launch
- To launch the truck, touch on the truck, drag back, and release touch. (a) Setting azimuth: The horizontal offset in the pull-back gesture determines the azimuth angle of the launch. The angle of the rendered truck changes with the angle setting.
- In this way, we are able to control all 3 dimensions of the launch using multi-touch gestures.
- Camera Views
- Different camera views are available based on context and can be changed by touching the blue camera icon in upper right corner.
- Available views before launching: (a) Launch View: Default view in which players launch the truck
- Available views after launching: (c) 1st Person View: view from inside the truck
- Interpolation is used to smoothly transition from one camera view to another.
- Miscellaneous
- Game levels can be changed or reset in the application’s flip view. Currently, players can choose between three different levels.
- Time of day (night time vs. day time) can also be changed in the application’s flip view.
(b) Setting initial velocity (magnitude): The amount of vertical pull-back gesture determines the magnitude of initial velocity. The vertical status bar on the upper left corner rises with increasing velocity.
(c) Setting ramp height: Optionally, use a second touch (while the first touch is on the truck) to manipulate the ramp height for the truck: touch-drag up to raise the ramp, and touch-drag down to lower the ramp.
(b) Browse View: Browse the scene. Single-touch-drag moves camera forward/backward/left/right within a given height level; Double-touch pinch gesture changes the camera height; Touch-on-hold along the edges of the screen rotates the camera up/down/left/right.
(d) 3rd Person View: view from a spectator
V. External Sources & References
- Angry Birds: our inspiration!
- Bullet: physics engine - modified the code to work on iOS
- Assimp: import models - modified the code to work on iOS
- Google Sketchup & 3D Warehouse: for obtaining and editing 3D models
- Synthesis Toolkit: audio signal processing and algorithmic synthesis classes written in the C++
- Customized Progress View: subclass of UIProgressView that allow customization of color
- Doppler Effect on Wikipedia: calculations
VI. Obtaining 3D models
All of the models were found using 3d Warehouse, and further modified using Google Sketchup. Some of the frequently performed modifications included reducing the size of the model, separating a group of meshes into individual objects (i.e. oil barrels), and creating a fragmented/ crushed version of the models to use in collision.