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
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
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
BuildTool
is executed, and we generate the regular .hpp
and .cpp
files.ActorList
is read and preprocessedACTOR_SET_DEPLOY
macroBuildTool
returnsAt 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.
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.