3.General Class Setup

Useful things to know

Classes in this project are intended to be very reactive and interchangeable due to the wide range of game template examples.

All of the example games use logic derived in the base classes which have been placed into the CommonAssets folder. This also applies to any other assets such as meshes, sounds or textures that are used in more than a single game example.

This is to ensure that all of the classes that interact with each other and are the base requirements for a game to run are left in this folder and not removed from the project.

This then allows you to safely remove any of the template types that you know you won’t be used without worrying about any dependency issues.

One important thing to note in most classes is that the Start With Tick Enabled has been set to false by default.

This is to try to maintain performance and also force development approaches to consider whether the class needs the Tick function at all.

Most classes are therefore highly reactive and make use of Interface classes to handle much of the communication between classes to try and keep the class dependencies on each other to a minimum.

If you do need to re-enable the tick event for a given class, you can do so by going to the Class Defaults section and setting it back to enabled from here.

Another concept that doesn’t seem to be covered very often when Blueprinting and is much more common in coding languages such as C# and C++ is class secure variables.

To avoid variables being accidentally changed outside of the class they’re implemented in, the project has many of the variables set to private.

This means that in many cases even if you have valid reference to a class inside of another, you won’t be able to get or set these private variables.

Instead if you need to get or set variables between classes there are a number of examples to reference using Interfaces to implement getter and setter functions.

Last updated