One of the main reasons for using Controllers is to implement in C++ actions that need to occur frequently, thus reducing the execution time in the Python virtual machine on the server. In order to do this, the CellApp has a mechanism to call back certain classes every game tick.
The relationship between the CellApp and its Controllers is depicted below:

CellApp and Controllers
The first step is to add the class Updatable to the list of the Controller's base classes:
#include "../cellapp/updatable.hpp" class EgController : public Controller, public Updatable
Updates on a Controller are usually run only on the real copy of the entity, and for this reason the class Controller exposes the methods startReal and stopReal (which can be overridden).
In these methods, the CellApp is requested to start or stop calling back the Controllers. The implementation would look as follows:
void EgController::startReal( bool /*isInitialStart*/ ) { CellApp::instance().registerForUpdate( this ); } void EgController::stopReal( bool /*isFinalStop*/ ) { MF_VERIFY( CellApp::instance().deregisterForUpdate( this ) ); }
We use the macro MF_VERIFY in stopReal to ensure that an error message is printed on failure ‐ this is an easy place to check for bugs in the Controller.
Now the update method can be implemented to perform any action required on the entity at each game tick.