Battle Hummer preview

Battle Hummer

Published: March 1st, 2020

The Battle Hummer involved creating an interactive game, where players could drive a "battle hummer" around a city. This project was a term project for CPSC3710 - Introduction to Computer Graphics.

Source Code

Tech Stack

Description

The design for the "battle hummer" was inspired by the Tesla Cybertruck. The project requirements stated that the battle hummer had to have an antenna, so we added a cube encircled by a triple ring constellation. Overall, we were very pleased with how the truck turned out!

battle-hummer-design

In addition to the battle hummer, we also had to model 3 types of buildings. These buildings had... odd requirements, but requirements are requirements, so 🤷‍♂️

When actually running the program, users can navigate around the city using the arrow keys. The blocks are generated randomly at compile-time, and include up to 3 buildings of any type. We devised a simple randomization algorithm to populate the blocks.

Additionally, users can change the camera angle by using F1 - F12, or Home for a Top-Down view

Challenges

While the scope of this project was relatively small (made smaller due to the COVID-19 pandemic closing down the University), there were still some challenges to overcome.

  • Performance: We worked extremely hard to write performant code for this project. Since we are using a very old version of OpenGL, a lot of the resources available were not that helpful. So we simply took some time to look closely at the code to figure out what components did and did not to be re-rendered each frame.
  • Animation: As you can see in the videos, the battle hummer does not move smoothly around the city. Rather, the truck moves in hardcoded increments. Furthermore, when the truck turns, it simply moves 90 degrees instantly. This is obviously not ideal. However, attempts at implementing a time-based animation system seemed overly complicated and far out of scope.
  • To OOP or not to OOP?: One design issue we ran into was trying to used Object Oriented Programming in conjunction with OpenGL code. Some resources said to do it, while others simply said to avoid it. However, we wanted to build a program that was more than simply a huge monolith of unreadable code. So a simple object oriented design was built for the hummer and the buildings that specified interaction logic in the header (.h) files, and presentational logic in the specification (.cpp) files. This provided a good separation of concerns, and kept the code clean and readable. s

Authors

This project was developed by Everett Blakley and Logan Wilkie