Project Title: Time Tanks
Development: C++
My Role: Gameplay Programmer, Designer
Programmers / Designers: Jak Tiano, Evan Schipellite
Time Tanks was a 5-week project worked on with Jak Tiano. While the majority of our goals were based in creating a polished architecture for the game, we also decided to include the design challenge of implementing a replay feature into the overall gameplay.
Instead of giving the player conventional lives, they are given a set number of time warps for each level. Every map tasks the player with destroying a certain amount of enemy tanks, and whenever their durability reaches a critical state their tank performs a time jump to the past. At this point, as they play through the level again, other versions of destroyed enemy tanks can be seen fighting against previous versions of the player tank.
Throughout the development process, I worked primarily in the areas of tank gameplay, enemy AI, and replay functionality. First of all, the tank gameplay wound up being relatively simple to create, as it mainly relied on collision checks with the world and enemies to prevent the player from wandering into undesirable areas. Rotation of the turret and projectile features relied on some essence of physics to create projectile launches that would perform reliably and according to the player's expectations. Overall, the basic mechanics revolving around the smooth movement of the player tank and level progression were relatively simply to program and design.
On a more challenging note, having little experience in developing AI in advance, creating the AI for the enemy tanks was a bit more challenging. First of all, they needed to be able to respond to the player's entrance and return fire in a believable manner. Second, they would eventually need to be mobile, both wandering around the map and chasing the player when required. The first step largely involved providing detection ranges for the enemies, therefore rotating the turret in the shortest direction toward the player when within range. Once the turret rotation was within a certain limitation, the tank could then fire normally.
Next, the enemy movement would require various states to indicate when they were firing, wandering, or chasing. Ultimately, we decided that the process of firing would meld with the chasing state, but having simple transitions between states would assist in encapsulating the commands for the enemy AI. Wandering wound up being simply a process of allowing the AI to move in a direction for a random range of time, resetting the direction upon collisions with walls. On the other hand, chasing would occur only when the player left the enemy's sphere of detection, inviting the enemy to move toward the player in an attempt to follow. If an obstacle wound up blocking the enemy's path, they would then stop chasing and proceed to idle or wander once more.
The replay feature was no doubt the trickiest part of programming this particular project. Every tank in the level would be required to keep track of the minimal amount of data to recreate the gameplay of any particular run-through. This meant that tank movements, turret rotations, and projectile launches would all be tracked and sent to a ghost unit that could be created based off of the provided data. These ghost units would then spawn when indicated and follow through the list of commands, taking note of when to move, rotate, and when to fire projectiles. Instead of keeping record of projectiles, noting projectile launches allowed us to fire ghost projectiles that would simply ignore collisions and de-spawn according to their logged destruction times. While this process in itself took a while to record, debug, and perfect, it was also designed to be saved into files so that the game could effectively be loaded entirely after being closed. The process of saving and loading information mid-game also took a bit of fine-tuning in order to perfect, but our overall game system made the process of maintaining the game's combat, replay, and functionality relatively simply and extensible throughout the project duration.