While the player is offline..

Hi,

I’m currently planning on a game in which the players controls a factory. And as many games out there I want the factory to produce goods even when the player is not playing. Right now i have two solutions for this:

First:
My game is sever based and does all the calculation on the host. This guarantees me a secure gameplay but i need a server and online connection for this.

Second:
I’ll do it on the client side by using a timestamp. When the player comes back playing the game, the game calculates the progress first. But the client time can easily be manipulated.

What do you think of coding such a feature?

You’ve got a good handle on it. Those are both methods I would use; It really just comes down to which fits the design of your game better since they both have strengths and drawbacks. If you’re asking if they’re possible in Unity, both are totally doable.

if you want to save ressources on the server side.

do it locally and use the Time-cheat prevention asset.

This is mostly for android and iphone device but you can always ask the dev if it work on PC

anti time cheat is very important for your kind of game.
But server ressources are not always unlimited and if it is like an idle game with crazy huge numbers, you dont want that on your server