Is there a way to run the game when minimized?

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. 🙂
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.
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.
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. 🙂
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
I have written a plugin to simulate Afk/Idle(Unfocus/Minimized) from the game.

Thanks for the info @Andar, @caethyril .
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
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. 😀
Jus add this to Package.json

"chromium-args": "--force-color-profile=srgb --disable-raf-throttling",

Works perfectly on MZ

Im using the plugin VisuMZ core engine > Quality of life settings > require focus to false

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-run-the-game-when-minimized.137343/