How do I run the game in background crosswalk

Get help using Construct 2

Post » Mon Jan 05, 2015 10:23 pm

How do I run the game in background - crosswalk? It's made to count while the user can do different stuff. But when the Android phone is minimized the game, it stops counting. So i made a plugin to run crosswalk in background : https://github.com/katzer/cordova-plugi ... background
But still negative results, what am i doing wrong ?

Plugin & CAPX : http://www.weebe.nl/BackgroundPlugin.zip
APK Demo : http://www.weebe.nl/Timer.apk
B
31
S
10
G
2
Posts: 310
Reputation: 5,516

Post » Tue Jan 06, 2015 1:06 pm

@Ashley is it not possible to run Construct2 games in background ?
B
31
S
10
G
2
Posts: 310
Reputation: 5,516

Post » Tue Jan 06, 2015 2:42 pm

It's not supported because it's a terrible idea: it will rapidly drain the user's battery. Imagine if all the apps on your phone did that.

Instead when the app resumes, measure how long it was suspended, and then advance the counter according to how much time had passed.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Tue Jan 06, 2015 5:18 pm

Yes if the whole game is running in background it can drain the users battery. But is it not possible in construct2, to do certain functions in background ?
B
31
S
10
G
2
Posts: 310
Reputation: 5,516

Post » Tue Jan 13, 2015 7:33 am

@Ashley

In official multiplayer plugin, runtime.js, line 125, 318. It looks like the host player could run while suspended, i.e. in background.
B
108
S
26
G
259
Posts: 4,431
Reputation: 145,681

Post » Tue Jan 13, 2015 11:21 am

rexrainbow wrote:@Ashley

In official multiplayer plugin, runtime.js, line 125, 318. It looks like the host player could run while suspended, i.e. in background.


It has been discussed and the awnser was that it was the only exception, made to not break multiplayer games, still not supported everywhere else though.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Tue Jan 13, 2015 1:03 pm

Yes, the host of a multiplayer game will keep the game active since they are acting as a server, and if the server suspends then all connected peers will hang too, even if their games are active. This is the one valid exception to the rule. I do not believe there are any other good reasons to use up power and system resources in the background.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Tue Jan 13, 2015 3:53 pm

@Ashley
@Aphrodite

I agree that suspending when application is in background, to save battery.

But it could not cover all cases.
For example
- A game/application which running at PC only, it does not have battery problem.
- A game/application need to have running in background feature in spec.
- Designer does not know how to do when game resumed, and the deadline is coming...
B
108
S
26
G
259
Posts: 4,431
Reputation: 145,681

Post » Thu Aug 13, 2015 4:13 pm

Ashley wrote:It's not supported because it's a terrible idea: it will rapidly drain the user's battery. Imagine if all the apps on your phone did that.

Instead when the app resumes, measure how long it was suspended, and then advance the counter according to how much time had passed.


How do we measure how long the game was suspended to have a similar feature to the build/upgrade time in a game like Clash of Clans and other MMORPG game apps?
B
7
S
1
Posts: 17
Reputation: 495

Post » Thu Aug 13, 2015 8:38 pm

Apex General wrote:
Ashley wrote:It's not supported because it's a terrible idea: it will rapidly drain the user's battery. Imagine if all the apps on your phone did that.

Instead when the app resumes, measure how long it was suspended, and then advance the counter according to how much time had passed.


How do we measure how long the game was suspended to have a similar feature to the build/upgrade time in a game like Clash of Clans and other MMORPG game apps?


User connection disconnects -> register server date 22/10/2015 12:55 as time for user xxx
User connection connects -> register server date 23/10/2015 13:33 as time2 for user xxx
Compare time & time2.
Your answer.
B
31
S
10
G
2
Posts: 310
Reputation: 5,516

Next

Return to How do I....?

Who is online

Users browsing this forum: Manubis, Ryan Kocourek, TheSupreme, TylerJS and 10 guests