IPhone Game pauses and resumes, is it worth it to implement?

Let me describe my situation:

I want to develop the game, that is, a round base and pay for the game. This means that you pay one coin for one round of the game, for example, Pinball, etc.

The problem is that when there is an interruption, ideally the game should pause and resume whenever the user wishes. Realization of this task is a difficult task. Say my game was placed in the background, I would save the state of the game in ApplicationDidEnterBackground. However, the game may or may not be terminated in the background. Thus, the next start may be a “new start” or “resumption of the last saved state”.

If the application remains in the background for a long time, say, 1 week, it is almost certain that other applications fighting for memory will lead to the termination of the game at some point. When the user starts my application again, they will play in a new round, which means that the previously unfinished game has disappeared.

From the client’s point of view, this is unfair.

I can think of implementing it so that whenever my application comes to the fore, I would see if the game was saved. If it were, I would come back instead. This creates a security issue:

A saved game, either in most primitive plist formats or in other formats, is saved and creates security problems. (What if the players edit the state of the game and score 10 million points as a starting point ... etc.)

Are there any recommended solutions to these problems?

I see that some applications simply refuse to save the game, and a new round starts when it resumes. They don’t pay for games, otherwise I can imagine that users are very angry.

I saw some applications that keep the state of the game for a while, but when it ends, the next time it starts, it will start a new round. Which seems equally unacceptable when the players really paid money for the round.

And given the possibility of failures, I can’t come up with a good solution to guarantee that the client will be able to play the full round of the game. It would really help me if someone with relevant experience could share their thoughts and how they make their decisions.

+4
source share
2 answers

Why not link round trim to pay? If the round does not end, payment is not made. If, at the end of the round, user loans are insufficient, you can give them the opportunity to immediately purchase more loans (through purchase through the application) to complete the current round.

This simplifies your task as a developer, and also makes it possible to request additional payment from the user in a non-interactive way.

+3
source

Here's a great tutorial on using NSCoding to save game states. He will not have any problems with the player who is going to edit the file, as is done in NSCoding. If the user REALLY wants to figure out how to non-encode the file and change the contents, which is crazy, you can do something like encryption from the data before you write them to the file so that the user cannot change it. Hope this helps!

+2
source

All Articles