I've been thinking of ways to save on save time/load time/memory usage in Epic Encounters, as it has a notable impact on these due to its massive scripted components.
One thought is to how the game is storing the local variables of functions. Since these variables are only ever initialized on script initialization, I am lead to infer that they are stored until the script is unloaded--not deallocated when the function execution is completed. If this is true, I would save by using a reusable common set of global variables for generic data manipulation (disgusting). At the very least, I could save by replacing use of local variables with actual data (making it less readable). Along with this, I think that each non-function event is handled (relatively) concurrently, let me know if I'm wrong.
Secondly, I could save by outsourcing each character's scripting to "control" scripts, held by a player (not story scripting, I won't even entertain the notion. Also it would break saves). This would mean that NPCs would only hold information unique to themselves, as well as some functions for interfacing with the control script.
Lastly, I could save by reviewing all global variables that I use for passing data between function calls and replace them with a set of common, reusable variables (because we cannot pass data through them implicitly. Why, we'll never know). Functions that would never impose risk of racing conditions with one-another would share variables.
Any ideas/input would be greatly appreciated, especially insight from Larian on how things work behind the curtain.
Last edited by Ameranth; 04/03/17 02:16 AM.