Run "catch up" when the game reopens

What is a good way to deal with the “catching up” on all the actions that were supposed to happen during the close of the game?

Example: Tiny Towers. There are items, shops, customers. When a person closes the game and opens it the next day, the application should find out everything that happened.

We are trying to figure this out by simulating everything quickly, mostly fast forwarding from the moment we exit the game. Unfortunately, this can take 20 seconds or longer.

Any suggestions on a better way to handle this?

+4
source share
1 answer

This is a good but very open question.

, , , , . (: ) - .

, . , , , . , :

for (NSUInteger i = 0; i < numberOfTicksMissed; i++) {
    doGameStuffThatWeMissedForTick(i);
}

i - , , , , , .

, , , , , , .

. , , , - "", .

, , , - - , 1000000 . , , 1000000, 1000 , "1000-". , , , , , 0,5.

, , , "1000-", 1000 , , 0,48-0,52. , , .

, , , . .

Tiny Towers , , , , . , , X ​​ . , , , .

, , .

, , , ( - ). , , , . , ().

, / , , .

:

, - , .

10 , ...

  • : X gold
  • 1000
  • second 0: X gold
  • 1: X + 10 gold
  • 2: (X + 10) + 10 ...
  • second 1000: (10 + (10 + (10 +.... + (10 + X)))))...

1001, , X + 10 000 .

, . , :

  • 1000
  • : X + (1000 * 10)

, , , , , - . , , , 10 0 . , " " ..

, N . , , , , .

, , " , 99,7% ".

68-95-99.7 - , .

, :

  • 1000
  • : sqrt( 1000 * 0.5 * (1-0.5) 16
  • 1000 : X + (1000*0.5*10) + RANDOM(-1,1)*48*10

X + 5480.

, (0 10000) 99,7% (4520 5480). .

, . , , 6000. 99,7%, , .

, . : 1 , , .

: 1, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 0, 1,...

. , , 1000 , , , 10 , 100 , 200 , ?

, , , , , - , , .

Chunking

-, , - , , , , , , .

, , , . : ?

, , , . , , , .

:

  • (), , ?
  • , , ?
  • , ?

:

  • X,
  • 1000 X
  • , - 10 - 100 .
  • , 500 .
  • 10

:

  • -, .
  • ,
  • , , .
  • ,
+1

All Articles