The Stack Overflow podcast is back! Listen to an interview with our new CEO.
2 Clarified title due to possible confusion: it's meant as daily routines, not as in code-routines (functions)
| link

NPC daily routines and scene loading

source | link

NPC routines and scene loading

I'm making a basic survival RPG in Unity 3d. I'm separating my world into different scenes to save memory but I'm not sure how I'm going to program NPC daily routines.

For example, if the player arrives in a town scene in the morning, how do I ensure that the NPCs are working in appropriate places with the appropriate equipment? I suppose I could hard code it so NPCs are in certain places at certain times. Therefore, if the player arrives at 9:00am then all the NPCs will move to their 9:00am places. I'm just wondering if there is a better way of doing it than that. I can see myself needing to write a lot of code to cover all the possibilities so it could get really messy. I was hoping there was some way I could have the NPC routines continue seamlessly in the background but this would be taxing on memory -if it's even possible.

Any ideas/pointers on this issue would be appreciated.