Is there a way to run the game when minimized?

Artille

Veteran
Veteran
Joined
Jul 23, 2012
Messages
52
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,376
Reaction score
8,395
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,640
Reaction score
2,011
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
52
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,376
Reaction score
8,395
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
52
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
52
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 Profile Posts

Fire-Emblem Style Level Up System, Boost on Class Change, And Animated Arrows | RPG Maker News #115

Why keyboards don't sleep? Because they have two shifts.
I realized a while ago my game was toooo big in scope. even now I wonder am I trying to do too much by myself. and that's after completely changing the format of the game.
Last week at SLC. Cali awaits. TBH I love SLC more than SF.
Back home now. I had a good time, but I had a checkup this morning so I had to come home for that. Now I'm just waiting for my therapist meeting tomorrow...
Decided to work on Wishful Wanda today. Since it's a BFB spinoff game, I decided to make the Huang brothers
Easter eggs! I'm actually pitching this to the BFDI team, btw.

Forum statistics

Threads
113,935
Messages
1,078,525
Members
148,044
Latest member
Sernyx
Top