My question is this:
How would one store global context data, ie. world data information, current world time, etc in an entity component system?
I'm think of working towards building a Dwarf Fortress-style open ended world simulation game in C++. I've build up an entity component style game engine just for fun, and I'm currently trying to figure out how I am going to work in all the features I want. In addition to standard game play (rendering, physics, entity-specific component data, etc), I would also like to have some global contextual data that all relevant systems would have access to (ie, the world data like what year it currently is, whether global warming is happening, Any kind of thing that would be relevant to simulating a world). I had originally thought of making a "world" component, but this seems pointless and difficult if a lot of different systems need access to this logically "global" data.
Would it make sense to have a "world" component or should I store this data some other way?
I'd also thought of simply making this data global, thus giving access to any systems that would want to use it; it seems like a violation of entity-component principles in general, and maybe messy for other reasons, but I thought that it might really work.
The other thing I'd thought of would be to actually embed relevant world-context data directly into the systems themselves. For example, if I had an
AgeSystem that "aged" all entities that have a
getsWeakerAsTimePasses component or whatnot, then maybe this system could store relevant time data for the world directly as member data that it would use to calculate the passage of time and how much to age and weaken people, etc. This third option was my least favorite, but something that had occurred to me in brainstorming.
Can anyone advise?