Disable auto pause?

Get help using Construct 2

Post » Wed Jun 20, 2012 12:46 pm

Is there a way to disable the auto pause functionality when the game loses focus (e.g. when the user goes to another tab in the browser)?

Sometimes it would be nice to allow the user to browse the web (collect information, for instance) or do other stuff while the game is running - and be able to have a timer ticking all the time.

I know it's possible to compare 'real time' using wallclocktime, but I find it tedious to implement (or change) all the timers and counters using this.
B
20
S
5
G
4
Posts: 51
Reputation: 4,139

Post » Wed Jun 20, 2012 1:13 pm

It's not really possible. Modern browsers like Firefox and Chrome effectively pause hidden tabs anyway, or reduce them to one frame per second (which is such a low framerate the runtime will switch itself in to paused mode anyway). This is important to ensure hidden tabs are not draining CPU or wasting battery life on mobile devices. Also many users desire automatic pausing because they don't want the game to carry on while they can't see it.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Wed Jun 20, 2012 1:28 pm

Ok, I understand. Thank you for the answer!
B
20
S
5
G
4
Posts: 51
Reputation: 4,139

Post » Sat Feb 09, 2013 11:54 am

then how do other games not pause ? in a real-time multiplayer game the pausing messes up the logic and even times out the connection. in games with multiplayer sockets need to not pause. castlot doesn't pause, evony doesn't pause, Farmville doesn't pause. so why must construct pause ?
B
6
S
1
G
1
Posts: 19
Reputation: 664

Post » Wed Sep 11, 2013 5:20 pm

Cookie Clicker style games need to not pause when losing focus... there has to be a way to make this happen.
B
14
Posts: 20
Reputation: 945

Post » Wed Sep 11, 2013 6:10 pm

I'm pretty sure those games use the "suspended/resumed" action to reconnect/refresh the info in the game like the time and all...

Sadly like I said in another psot those actions don't work in iOS brwoser-based games, I tested them, worked in IE and Firefox but not in iOS (Safari)... : (
I made 2 games so far: www.ID-Games.net
B
9
S
2
Posts: 47
Reputation: 1,315

Post » Mon Nov 18, 2013 5:50 pm

I'd also like to disable this somehow. Working on an incremental game (cookie clicker style) and need to figure this out.

The desktop workaround is to keep the tab in a separate window or browser since it still activates for tabs when disabled, however this is not viable for mobile and I'd like this functionality (continuing background process) to be available for all/most platforms.
B
24
S
6
G
3
Posts: 197
Reputation: 3,300

Post » Mon Nov 18, 2013 5:57 pm

maybe the wallclocktime could work for some games, I don't know, I didn't tested it.

wallclocktime:
The number of seconds since the game started, not taking in to account the time scale (i.e. the real-world time).
https://www.scirra.com/forum/viewtopic.php?t=152506

And that is why you shall respect the bug reports guidelines, not only giving a capx is making the bug reproductible in one click in a situation they can work with (less time wasted trying to reproduce vague instructions) but also it helps filtering false positives.

Game design is all about decomposing the core of your game so it becomes simple instructions.
B
42
S
17
G
17
Posts: 2,094
Reputation: 15,855


Return to How do I....?

Who is online

Users browsing this forum: Colludium and 27 guests