Is there a way to run the game when minimized?

Artille

Veteran
Veteran
Joined
Jul 23, 2012
Messages
51
Reaction score
40
First Language
French
Primarily Uses
RMMZ
Hello,

I have been searching for this and found a few topics talking about this issue going back to VX Ace.
Since the release of RMMV, I was led to believe adding the following :

JSON:
"chromium-args": "--disable-raf-throttling",

In the package.json file would solve the issue, however that is not the case.

Is there any way to keep the game (RMMZ) running when minimized (or out of focus)?
I mean, there must be since the music keeps on looping even when out of focus, so the program isn't 100% idle.

I read it was a software limitation, but since this is the new generation (JSON+JS), I figured, maybe there is a work around for this.

Thanks for your answers. :)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,346
Reaction score
8,389
First Language
German
Primarily Uses
RMMV
I mean, there must be since the music keeps on looping even when out of focus,
no, that is an exception because of the way how soundboards work.

I don't know if what you're asking for is even possible, because all RMs are using a double interpreter to run on. that eats away a lot of computer processing time and is likely to cause problems no matter the basis.

So another question: why would you want this? Most effects can be simulated by detecting time after the focus is regained, so there might be workarounds.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,606
Reaction score
1,988
First Language
EN
Primarily Uses
RMMZ
RMMZ games automatically pause their scene updates when not in focus.

I posted an answer here that might work:

Like Andar says, though, another approach might be better here.
 

Artille

Veteran
Veteran
Joined
Jul 23, 2012
Messages
51
Reaction score
40
First Language
French
Primarily Uses
RMMZ
So another question: why would you want this? Most effects can be simulated by detecting time after the focus is regained, so there might be workarounds.

I want players to be able to gain "actions" over time.
This by enabling a common event to wait X frames and adding 1 to the actions counter.

But when the game is minimized/out of focus, obviously the player gains no actions over time.

"Detecting time after the focus is regained."
Might be interesting enough for what I need, although, how am I supposed to do that?

RMMZ games automatically pause their scene updates when not in focus.

I posted an answer here that might work:

Like Andar says, though, another approach might be better here.

I will take a look, thanks. :)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,346
Reaction score
8,389
First Language
German
Primarily Uses
RMMV
although, how am I supposed to do that?
instead of making a complete independend frame-based time system, you include a sync with the computer's real-time-clock. There are javascript commands to check that.

then if there is a difference after coming back into focus, you calculate the difference and modify your own time (and the bonus gained) based on the skipped frames
 

Artille

Veteran
Veteran
Joined
Jul 23, 2012
Messages
51
Reaction score
40
First Language
French
Primarily Uses
RMMZ
I have written a plugin to simulate Afk/Idle(Unfocus/Minimized) from the game.

Thanks for the info @Andar, @caethyril .
 
Last edited:

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,297
Reaction score
1,498
First Language
English
Primarily Uses
Other
When I looked into the issue for Veno's Stream Arena I found that both chromium args and defaults scripts needed to be changed. (If you have any online elements in your game then auto-pause is likely auto-gamebreak)
If you have VS plugins then you can use the VisuMZ_0_CoreEngine > Quality of Life Settings > Require Focus? setting
For chromium-args I added --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-renderer-backgrounding

Here's my example
JSON:
{
    "name": "rmmz-game",
    "main": "index.html",
    "chromium-args": "--force-color-profile=srgb --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-renderer-backgrounding",
    "window": {
        "title": "Label performance test",
        "width": 816,
        "height": 624,
        "position": "center",
        "icon": "icon/icon.png"
    }
}

I don't remember the version I tested it for though.


P.s. for your specific case I don't think you need it, but putting it here in case it helps others.
*hugs*
- Zeriab
 

Artille

Veteran
Veteran
Joined
Jul 23, 2012
Messages
51
Reaction score
40
First Language
French
Primarily Uses
RMMZ
When I looked into the issue for Veno's Stream Arena I found that both chromium args and defaults scripts needed to be changed. (If you have any online elements in your game then auto-pause is likely auto-gamebreak)
If you have VS plugins then you can use the VisuMZ_0_CoreEngine > Quality of Life Settings > Require Focus? setting
For chromium-args I added --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-renderer-backgrounding

Here's my example
JSON:
{
    "name": "rmmz-game",
    "main": "index.html",
    "chromium-args": "--force-color-profile=srgb --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-renderer-backgrounding",
    "window": {
        "title": "Label performance test",
        "width": 816,
        "height": 624,
        "position": "center",
        "icon": "icon/icon.png"
    }
}

I don't remember the version I tested it for though.


P.s. for your specific case I don't think you need it, but putting it here in case it helps others.
*hugs*
- Zeriab
Thanks, I will try that to see if it fits my needs. :D
 

Latest Threads

Latest Posts

Latest Profile Posts

my girlfriend calls all my little chibi art cute lol... funny considering that wasn't the original art style of the game.
100 problems in RMMZ 100 more problems take one down pass it around 101 Problems in RMMZ
Made some progress on my game, mostly mapping. Learned quite a bit in the process!.

M6eUoTT.png
16 Hr Video Course on MZ? Huge DLC Pack from MZ's RTP Artist | RPG Maker News #110

I spent the past couple of days transferring my RM2K3 project over to RMMV. I upscaled everything 3x and it looks so cute I can't T_T

Forum statistics

Threads
113,767
Messages
1,077,308
Members
147,804
Latest member
Dracul_JOSHI
Top