by Graf Zahl » Mon Dec 05, 2016 3:53 am
Global variables come with the problem that they need to be serialized and the system is not equipped for that. They need to be stored in a place where the serializer can reach them and at the moment that does not exist. The main issue here is that the management of global data in the game engine is rather messy.
We have the global level struct and we have the global pointers for sectors etc. Right now the only global game elements that got exported are the level and the players because they were needed somewhere.
Before going any further here, the global level data needs to be come a Level object that obeys the same rules as other objects, and once that exists, a Game object that encapsulates an entire game session. And once that exists, you can have your global variables.
I can outright tell you that this is a MAJOR job to refactor, but absolutely necessary to make the engine future proof. And before that isn't done there won't be any global variables.
Global variables come with the problem that they need to be serialized and the system is not equipped for that. They need to be stored in a place where the serializer can reach them and at the moment that does not exist. The main issue here is that the management of global data in the game engine is rather messy.
We have the global level struct and we have the global pointers for sectors etc. Right now the only global game elements that got exported are the level and the players because they were needed somewhere.
Before going any further here, the global level data needs to be come a Level object that obeys the same rules as other objects, and once that exists, a Game object that encapsulates an entire game session. And once that exists, you can have your global variables.
I can outright tell you that this is a MAJOR job to refactor, but absolutely necessary to make the engine future proof. And before that isn't done there won't be any global variables.