How do Facebook games "keep running" ?

Get help using Construct 2

Post » Mon Feb 25, 2013 4:56 am

I was wondering.. How do many of those "... -Ville" and similar games seem to run while you aren't on the page?

You plant a flower, you come back and it has turned into a tree!


Do they cache the time between your visits and do a sort of fast forward? Or is the game running on a cloud?
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Mon Feb 25, 2013 6:40 am

Maybe they store a birth variable. A grow equation could be used with (today-birth)
B
20
S
8
G
6
Posts: 176
Reputation: 8,047

Post » Mon Feb 25, 2013 12:51 pm

I'm guessing a cron job is being used?
B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Mon Feb 25, 2013 8:55 pm

It would be a waste of resources to have the game running whilst you're not there so I guess it would do the fast-forward trick that you mentioned.

Terraria used the same trick when they introduced the plague biome.
Because it constantly spreads, but it would use too many resources to keep the whole level in memory and constantly update it, the onscreen and surrounding areas are kept up to date and when you scroll around, as other parts are loaded, they are checked against a timer from when they were last saved, and updated accordingly ;)
B
11
S
2
G
3
Posts: 22
Reputation: 2,595


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, Draconinho, luisgmolina, Magistross, nedzad, nimos100, R0J0hound, Rezzon71 and 27 guests