Hog Wars

Introduction

As the first game I designed and coded from the ground-up, Hog Wars was an extremely challenging project. The neuroevolution for artificial intelligence was the single hardest algorithm I have programmed. Through Hog Wars, I learned how to manage time and memory in order to handle graphics, artificial intelligence, and user input in real-time. I also learned a great deal about designing code for large-scale programs. All of the code is completely modular and designed to support any number of players and enemies.

Concept

Hog Wars is a simple 2D game in which 1 to 4 players control a Warthog and must kill as many enemies as possible before losing all of their lives. Hog Wars also includes a versus mode in which up to 4 players can battle each other.

Gameplay

Players will face Elites, Grunts, Ghosts and Wraiths. Each type of enemy has its own health, speed, shot range and shot damage.

Players can use either a keyboard or an Xbox 360 controller to play Hog Wars. An Xbox 360 controller is recommended. Controls for the game can be found in the readme file included with the installer.

Graphics

The graphics in Hog Wars are all 2D images. The images are all taken from Halo 3 screenshots.

Artificial Intelligence

Elites and Grunts simply approach the closest player and begin shooting once within range.

Ghosts and Wraiths use evolved neural networks to find the player. These networks were evolved offline and stored for loading during run-time. The neural networks have seven inputs: four radar sensors and three rangefinder sensors. The radar sensors are responsible for locating the player while the rangefinder sensors are responsible for finding walls or other obstacles. The inputs from these sensors propagate through the hidden layer (consisting of three nodes) to the output layer. The output layer of the network contains three outputs: forward, left and right. These outputs determine the movement of the enemy. Once the player is within range of the enemy ammunition, the enemy begins shooting.

Note: XNA Game Studio 2.0 is required to play Hog Wars and open the Hog Wars Visual Studio project.

Download Game

Download Source