Overview

Go Fish! is a simple 3D video game developed in C++ with OpenGL and a few other basic technologies. While the core gameplay mechanics are fairly simple, wherein the user plays as a shark in a third-person perspective swimming around trying to eat fish, the develpoment process was rather invovled.

The player's view. The shark remains in the same general spot on the screen, rotating with the camera so as to avoid being too static.

The terrain was generated using a DEM height map with water caustics textured atop to better solidify the idea that the user is underwater.

The schools of fish and seaturtles were simiulated using boids. Additionally, they will try to evade the shark (i.e. player) when it gets within "striking" distance. This mechanic made the game rather difficult, so I tuned the range down a fair bit.

Technologies

  • Lighting based on the Blinn-Phong model to illuminate the terrain, fish, seaweed, etc.
  • Hierarchical modeling for the shark's caudial fin. Unfortunately not based on the movement, rather just a mapping of time through sine and cosine functions.
  • The fish and seaturtles are brought to life using boids. There are 50 flocks, each with 10 members. The boids have basic collision detection to avoid the terrain and skybox and, as mentioned earlier, avoid the shark when within a rather small range.
  • Water caustic simulations are a notoriously difficult problem as it involved an immense amount of physics and compute power to resolve the lighting. To avoid these issues, I used a caustic texture map for the terrain and transformed it based on time using sine and cosine functions to simulate moving water overhead.
  • A skybox to give the illusion that the user is underwater and in an infinite-ish world.
  • The shark has collision detection with each fish. When the sharks' bounding box enters the fish's bounding box, the two geometries have collided and we deduce that the shark ate the fish.
  • The terrain was generated using a height-map. The particular terrain is a random selection of the Pacific Ocean's floor.

Resources