Object oriented programming Space Navigator

"Space Navigator" was developed in fewer than 8 weeks during a college course in game development. The topic of the course was object oriented programming. During this project I was able to strengthen my abilities in C# programming and built up my knowledge in game logic and the mathematics behind games. A working build can be downloaded -> here <-.

Design & Concepts

Space Navigator is a space shooter in which players have to gather fuel pickups to continue flying and to score points. Meanwhile enemies are chasing down the playership. During development, I was ahead of the deadlines, which gave me the opportunity to include more and more features.

Features

Originally I planed to build a basic flight model and a highscore system with some very simple game play mechanics. However while working on my project I was able to include the following features: Advanced Ship controls and a mouse controller as well as full physic based ship movement. A fuel and pickup system, a health controller and a shield system was implemented. I also added enemies and an enemy target system. Players can choose between two ships. The game uses procedural generation to create many variants out of the one asteroid mesh.

Level design

My intention was to create a level in which planets and objects behave physically accurate. I used skybox and placed planet meshes inside. It is possible to control each planet directly. Planets rotate around themselves and moons can rotate around planets.

1st person & 3rd person

"Space Navigator" can be experienced in first person or third person perspective. I implemented the first person mode by adding a camera into the cockpit. By this, players are able to switch between exterior and interior cameras at any time. Both ships have a unique cockpit and hum sound.


Mouse controls

One of the most exiting features to develop was the mouse controller. My aim was to build a controller that behaves like a joystick, with no force applied when the mouse is centered on the screen. The mathematics behind it is quite simple, I split the view frustum into 4 quadrants, adding torque and force to the rigid body depending on the mouse position on screen. A class named "ShipBehaviour" is used to determine how much force and torque gets applied. Another class "ShipMovement" is used to manage the player spacecraft. And "PlayerMovement" holds the functions for yaw, pitch, roll and thrust.

Weapon systems

Every ship comes with a variety of weaponry, such as laser guns, rockets and target tracking missiles. All weapon systems are build up modularly. Meaning, that any combination of weapon is possible within the system. Lasers developed to be fully accessible within the editor and are attached to the ship at spawn points. Range, rate of fire, color and of course the damage each shot can cause are all individual values, unique for every ship.

Rockets and target tracking missiles

Besides the laser guns, ships can cbe mounted with launchers. The game features target tracking hardpoint missiles as well as pod launchers. Inheritance has been used to keep the code efficient, while giving the possibility to implement any other type of launcher based weaponry as addition to the existing ones. The target is passed to the missile at the time it's fired. As long as the target is within the seeker cone angle, it will be followed. Players can fire all weapons at any time, but without having a target missiles will fly straight.

Enemies

Enemies only purpose is to follow and ultimately chase down the player. The original design had them cycle around the playership while shooting lasers. However once advanced flight controls, mouse input and weapon systems were developed enemies were no challenge anymore. Therefore enemies behavior has been changed to be more aggressive upon the player, colliding with the playership in kamikaze style. Effects, lights and sounds are spawned on impact when an enemy is hit.

Taking damage

The player can be damaged too, either caused by enemies or by collision with objects like asteroids or debris. Any time the taken damage is greater than 20% an alarm sound will get triggered. Serious ship damage will spawn effects like flames, flares and smoke along with audio clips and lights near the point of impact. Shields are recharging, but when all shields are down, the game is lost.

Visuals and graphics

Only the object oriented programming aspects of the software did matter for grading. I focused on coding and didn't spend too much time on the visuals. Several skyboxes, an asteroid mesh, planets and space debris as well as a handful of other objects have been quickly created over the course of the project. I also used several 3rd party assets. Within the limited time of 8 weeks I didn't want to get distracted by creating beautiful visuals. Still, it was my aspiration to develop a visually pleasing game.

Final words

The development of "Space Navigator" has been a very exciting experience. I was able to learn a new game engine in very short time, while greatly extending my skills in object oriented programming.