Tuesday, December 27, 2011

Unity 3D: Tidal Fury

single player
two player split-sceen

Tidal Fury is a game that pits two boats against each other in head to head combat. The game was coded in Java using the Unity 3D game engine. This was a group project, my part was coding the game play, and modeling and animating one of the boats (the red one).
   The project presented many unique programming challenges; Realistic buoyancy for the boats, split-screen multiplayer, a mini-map, a cannon that adjusts for the rocking of the boat using a counter weight, a homing missile that locks on to a player when they are within range, and cannon bullets that skip off the surface of the water.
   One of the more interesting challenges was handling the 3D sound for both players. Unity 3D has built in code for handling 3D sound.  There is a sound source, an object that emits a sound from a specific location, and a sound listener, the object that picks up that sound and outputs it to the left and right speaker channels in a way that simulates depth. But, add another player, and you need 2 sound listeners, which is not allowed by Unity. To get around this we had a single sound listener for both players. When a sound is played, it spawns a sound source relative to the sound listener. So, if there is an explosion between player1 and player2, the closest player to that explosion is found, then the relative distance from that player to the explosion is calculated. This relative distance is then given to the sound listener object, which spawns a sound source in an equivalent relative distance from itself.

Player 1: Air-Boat Tank


No comments:

Post a Comment