The Actor List is a file header file located in Generated/ActorList.hpp it is generated by the Build Tool and is used to instantiate the set of Actors created by the user

Why

The Actor List is needed to allow for gameplay programmers to have a better user experience when making actors. The main problem is that we don't want to use a scripting language for many reasons, including but not limited to:

With that out of the way, we can now move to why the ActorList exists. It's reason for existing is to instantiate all unique Scriptable Objects created by the gameplay programmers, add them to a set and then add the given instance to the event pools for every matching Actor in the scene.

Since we are using C++ the engine cannot automatically instantiate every Scriptable Object derived class. Which leads to us needing to find a way to go around this problem, and the most performant way is to make the ActorList

How does it work

We know that the gameplay programmers won't create their Scriptable Object from scratch, but will use the UVKBuildTool CLI or GUI. With that knowledge we do the following

  1. The BuildTool is executed, and we generate the regular .hpp and .cpp files.
  2. The ActorList is read and preprocessed
  3. An include statement is added to the bottom of the include chain
  4. A new line is placed below it
  5. The file is read until a new empty line is found
  6. If one is found, the code for creating an instance of the class is added to the ACTOR_SET_DEPLOY macro
  7. The file stream is closed and the BuildTool returns

At this point, all that is left is for the user to do is recompile the engine. Because the BuildTool updated that macro, the code generated in ActorManager.cpp is updated to add the newly generated Scriptable Object to the set, which results in the events being called at the appropriate places.

Performance

This method has almost no performance costs due to the fact that it's equivalent to instantiating stack variables in the entry point and pushing their pointers to an array.