The cheat manager in Unreal Engine 4 is a class that handles commands useful for making testing much easier. In fact it’s a container for most of the exec functions. Those functions can be implemented in many places – GameInstance classes or PlayerController classes but it’s good to keep them in one place in order to have the project more organized.
There are plenty of commands in the base Cheat Manager already – You can check all of them in the Engine \ Source \ Runtime \ Engine \ Classes \ GameFramework \ CheatManager.h file. But if You want to extend the Cheat Manager in Your game there are few steps that must be followed.

The Cheat Manager is an integral part of the Player Controller, so there are two classes to override: APlayerController and UCheatManager.

MyPlayerController.h

Here we are overriding the PlayerController class. In fact we need to override only an AddCheats function. Remember to set this Player Controller to be used by the game’s Game Mode!

MyCheatManager.h

This is an extended Cheat Manager class. It overrides the Initialization function and have the exec function just for easy test if this class works.

MyPlayerController.cpp

Here we’ve got the function in the Player Controller that creates an instance of our Cheat Manager. From now on it is ready to use.

For Unreal Engine 4.16 and higher (Updated in 21.05.2017)

In a newer version of the engine the CheatManager object is created automatically. You only have to override the CheatClass inside the APlayerController:

MyCheatManager.cpp

And this is an implementation of our CheatManager class. At this point it doesn’t need any initialization steps. When we type testmycheatmanager (commands are case insensitive) into the console (press ` on PC or tap the screen with four fingers on mobile device) the nice message should appear on the screen:

mcmmsg

The Cheat Manager is one of the simpliest tools that simplifies the testing routine. The other ones are the Console Manager or Command-Line Arguments. For debugging – we have even more awesome tools. I’m gonna write about them next time.