Hello,
in our project we have separated the logic and the loading of the objects it needs. The loading of the objects happens in different thread and after all the objects are loaded we start the execution of the logic. For example, we have gameplay code where we will need certain object (which can be seen only when reading the code, the object is not present in level file), we first load the object and after that we start the code (some function for example).
Our goal is to free the current thread, which executes logic, from the loading of objects.
Some objects depend on other objects - to load certain object, another object must be loaded first. Also, there is no established hierarchy (so we can traverse it and load child objects of a parent) and we don't know what has to be loaded, unless we read the code.
The current problem with this implementation is that it is hard to maintain - we have to read all the logic, see what is going to be needed and add it for loading.
Is there elegant solution to solve this problem?