Hey guys!
I want to prototype some game ideas and I’d like to know what would be the best way to go about this. I’m not looking for specific code, but more of a high level overview on how to approach this. I want to build this as modular and as efficient as possible, this way I can build upon this core system and just add events as I go.
Basically what I want to do is:
-Have an internal “time” in the game that’s always ticking. This isn’t the computer clock, but an arbitrary time scale.
-Events happen at specific times. Example, if it’s 6pm in the game an NPC goes home or something. How often NPCs or objects check what time it is to behave accordingly?
-Turn on some lights at 8 pm.
-Have different days and different events happening on each one. For example, if it’s day 1 an NPC says X, if it’s day 2 an NPC says Y, etc…
I have a vague idea of how to make those things but my biggest question is: this timer also has to carry over when you load multiple levels, so I guess that instead of saving every NPC and objects states, I could just “rebuild” their states every time the map is loaded. I guess this would be safer and keep the environment more controlled?
Any thoughts and advice would be highly appreciated
Thanks!
Thiago