Computers are very fast these days.
Entire statistics for the day can be generated indiscriminately, even without the use of discrete formulas - if the application is not open, then the pet does not need to "become hungry" and any changes in statistics or "daily events" can be generated as soon as the application is active again - No need to even worry about background events for an inactive application.
However, I suspect that for a more friendly game, additional βsoftβ logic will be used to encourage the user to play with the pet without having to starve to death during a business meeting: this is a game and games can create their own rules while the user continues to play.
Happy coding.
user166390
source share