0
\$\begingroup\$

I wonder how idle games, games where players only make a few clicks to get a game progress, work. These games appear to be running in the background, even when the app is closed. Therefore these games may be implemented on the server side and run on it accordingly. I'm interested in the kind of implementation.

  • Is there a program running on the server that creates a separate instance for each player and performs the actions accordingly?

  • Or is this realised via a database?

Furthermore I ask myself where the data is stored, on the client (susceptible to manipulation) or on the server (high memory requirements).

Maybe one of you has experience in this area and can give me more information, insights or explain how it works. I am also happy about further reading or links.

\$\endgroup\$
3
\$\begingroup\$

You don't necessarily need to run such games server-sided. When the user exits the app, you save the game-state with the current time and date. When the player restarts the app, you reload the savegame, check the time and date of the device to see how much real-world time expired and simulate that time.

You could also do this server-sided if you want to. For example, because you have some multiplayer features in the game or you want to sell microtransactions and want to make sure the player doesn't cheat. In that case you would do the same thing: When a player connects to the server, you check how much time elapsed since the last session and advance the state of the game accordingly by simulating that time.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.