Hatchlings - Sherry Lin, Xavier Graham, Adam Ross


Overview

For the final project, we created a game called Hatchlings, in which the player plays as a mother sea turtle, who must save her hatchlings from where they hatched inland all the way back to the sea, all the while avoiding the enemies. The player's camera uses the mouse to control pitch and yaw rotation, and the WASD keys allow for left, right, forward, and backward movement. Also, we use an infinite skybox to wrap around our world.

Fig 1. A bird's eye view of our map.
Fig 2. A quick demo of gameplay.

Height Map & Spatial Data Structure

Our game uses a spatial data structure to check collision between different types of objects. This SDS prevents us from having to check all of our objects each render pass. We also store the height map in our SDS to prevent confusion.

We used quad interpolation to get the height at a specific position. As you can see in the video above, the player's height, as well as the enemies heights', are calculated using an interpolation function, which accounts for the smoothness of motion.

Fig 3. A picture of the different heights at which objects in the world spawn.
Fig 4. Code for height interpolation.

Texture Mapped Objects & BP Lighting

We used texture mapping to color the crabs and the rails, as well as some of the car's shapes. For other objects, such as the gun and the water bullets, are drawn with a simple Blinn-Phong shader using a single directional light.

Fig 5. An example of Blinn-Phong shading on the gun and bullets.

Interactions & Collisions

As stated above, we used a spatial data structure to test our collisions. Every render pass, we check hatchlings against the enemies that exist in the same unit of the map. With this, we only test hitboxes that are near each other. However, this still created some problems at te bounds of the structure, because the hitboxes would sometimes spill over the edge. A solution to this would have been to add the hitbox to both map sections if the hitbox fell on the edge, but we unfortunately did not have enough time to finish that.

In order for our game to feel entertaining, we needed some user feedback when something happened in our game, so, we added sound interactions on hatchling death, hatchling rescue, and enemy death. Hatchlings also explode when they are hit by an enemy.

Fig 6. Collision testing using the SDS.
Fig 7. Hatchling explosion on enemy collision.

Hatchling Pathing

The hatchlings were using bezier curves to control their movement earlier in the class. However, after the 90%, we received user feedback that having pre-determined paths for the hatchlings wasn't too great, and that they would prefer being able to control the hatchling movement on their own. Thus, we changed the movement so that the player can nudge the hatchlings along instead.

Dynamic HUD

Our game also features a dynamic HUD, which changes based on the player's ammo and the amount of turtles they have saved. The bar on the left of the screen keeps track of ammo, while the turtle pictures in the top-right keep track of the saved hatchling count. The HUD also provides cross-hairs for better aim ability. We used texture-mapping to create the HUD overlay and then simply culled out the black fragments in the shader program.

Fig 8. Initial look of the HUD when the player starts the game.
Fig 9. After using the gun and saving a turtle, we can see that there is now less ammo remaining and a turtle in the top right.

Sound

Last, but certainly not least, we also included sound design in our game. As talked about above in the Interactions & Collisions section, we use our game's sound as a way to provide user feedback on interaction with the hatchlings, enemies, or both. Below is a quick demo of some of the sound effects.

Sound 1. The sound when a hatchling is saved.

Sound 2. The sound when a hatchling is lost.