top of page

Platform:

Windows PC

Language:

C++

Tools Used:

Unreal, Visual Studio

Completion:

May 2018

Team Size:

1 Programmer (myself)

2 Artists

2 Designers

Manny the Manx

A 3d adventure / exploration game built with C++ in the Unreal engine as the final Major Project for the University of Bolton

This game involves exploring a large open map in search of collectibles, while avoiding hazards like enemies and poisonous water. The game consists of a small linear tutorial level to explain the many features of the game, which leads into the larger main level. The end goal of the game is to get as many collectibles as you can before the timer runs out, and your score is then posted to a leaderboard.

As the sole programmer on the team it was my responsibility to create the vast majority of the game's features using C++, while also managing the source control for the project.

Collectibles

Since the core game play is essentially picking up collectibles, I spent a good amount of time deciding on and implementing an efficient method for this feature. I settled on using a subscribe/broadcast messaging system to allow for many different classes to know when collectibles are picked up (whether that be the game mode for tracking the score or classes like doors to react when specific numbers have been collected). I used a collectible base class to hold the generic functionality that all collectibles would use such as having certain components (mesh and collision components for example) as well as overlap detection functions.

The generic collectible message would hold a value which changes based on what type of collectible it is. For example the standard value is the amount of points the collectible is worth while a health pickup's value is the amount of health it restores. The sent message also contains a reference to the collectible that sent it, so that this can be compared in the game mode to determine which response is appropriate.

The message is sent with a collectible reference and value:

The message is received and interpreted by the game mode class:

Using JSON for saving / reading scores

One of the features I am most proud of is the high score table, made using JSON. I had never used JSON prior to this project and so spent a good amount of time researching and learning how best to use it. For this system the JSON object to be saved needed an array of the top 10 score objects, which themselves contained an FString name and a double score.

JSON object structure:

In order to save a recorded score, first the old scores would need to be collected if there are any. These are initially stored as an FString but are then converted into a JsonObject. This is shown here:

A new JsonObject is created to store the individual score values, and is added to the end of the array of scores here:

The complete JsonObject is then serialized into an FString value to be stored in the file. 

The end result looks like this:

Reading the file back in to display the leaderboard works in mostly the same way. The main difference being that the array of JsonObjects is converted into an array of the UStruct Score objects shown earlier. This allows for the individual values of the score objects (name and the score value) to be accessed much easier. This also helps to sort the scores.

I am very pleased with how this project went. I learnt a great deal about working as part of team with varying skill sets, which will certainly help with future projects. I also picked up skills in the use of JSON and further messaging experience. 

  • Facebook - Grey Circle
  • Twitter - Grey Circle
  • Google+ - Grey Circle
  • LinkedIn - Grey Circle
bottom of page