Introduction

This project was an opportunity for me to improve my C++ skills in Unreal Engine while keeping a focus on blueprints. I wanted to create a template that does most of the "heavy lifting" in C++ while being fully customisable via blueprints. In terms of support, all classes are commented, and several tutorials on how to use the template are available at the bottom of this page.

Link

Data driven gameplay

The entire template relies on databases (which can be exported out as spreadsheets) that makes it quite easy to add, remove or simply edit content with or without the editor. The database is then accessible at runtime via Unreal's API and a couple of other functions more specific to this application. In addition of being used for gameplay purposes, it is also used to automatically generate the interface. 

Player camera

The template comes with a strategy game style camera and controls. Here again, most of the logic is handled via C++ while being accessible via blueprints. Parameters such as input bindings, movement speeds and basic interactions with the grid can all be changed via blueprints to facilitate testing.

Grid Maker

The template also comes with a grid maker object that enables the creation of square grids. Several variables such as size of the grid, tiles and the sprite to use can be customised through blueprint.

The grid uses sprite instances, an optimisation process that enables the engine to handle up to thousands of tile at once without affecting killing the performances. This is by no means the most optimised method but serves as a decent testing solution.

Block spawning

The templates also includes the logic behind placing down buildings. This aspect can be very tricky to implement especially if you allow buildings of various sizes to be placed down. The template takes care of making the building follow the mouse, allowing the player to rotate the building and automatically allocates tiles to whatever is being placed down so that nothing else can be spawned on top.

Pathfinding

Finally, the template includes a pathfinder component accessible from blueprints. Although it was originally made to allow the building of roads and path on the grid, the fact that it was made into a component allows us to use for any other mechanics that would require path-finding on the grid. It contains an implementation of A* and Dijkstra's algorithms that behave slightly differently.

 

Documentation

This documentation should be enough to get you started using the template. It goes over every class explaining what each one does and how to use them. Moreover, all blueprint classes were commented to showcase their features, make sure to check it out first.  

Introduction

Last updated: March 2020
  • GitHub
  • Sketchfab
  • LinkedIn
  • Twitter