How can I make it so RPG Maker MV runs even when minimized?

Discussion in 'RPG Maker MV' started by Crysillion, Jul 14, 2019.

  1. Crysillion

    Crysillion Veteran Veteran

    Messages:
    117
    Likes Received:
    19
    I recently challenged myself to create an idle game in MV. To my surprise, the final result was more than satisfactory. However, what I didn't anticipate is that MV pauses all operation when it's minimized, which is a problem given the kind of game this is.

    Would there be a way to make it so the game works even when minimized?
     
    #1
  2. Poryg

    Poryg Pixie of the Emvee kingdom, Ham of a Hamster Veteran

    Messages:
    3,662
    Likes Received:
    9,216
    Location:
    Czech Republic
    First Language:
    Czech
    Primarily Uses:
    RMMV
    No. Browser reduces the speed of Javascript engine from 60 fps to ridiculously low speeds.
     
    #2
  3. Restart

    Restart Veteran Veteran

    Messages:
    67
    Likes Received:
    39
    First Language:
    English
    Primarily Uses:
    RMMV
    Not really feasible, easier to have a heartbeat system that detect whenever a time skip occurs and quickly makes up for lost time.
     
    #3
  4. Crysillion

    Crysillion Veteran Veteran

    Messages:
    117
    Likes Received:
    19
    I'm not playing it through the browser.
     
    #4
  5. Crysillion

    Crysillion Veteran Veteran

    Messages:
    117
    Likes Received:
    19
    That's interesting to me because I know other game engines pretty much run out of focus by default. I'm not sure a heartbeat system would work when a core part of the idle "gameplay" involves going through a series of automated battles.
     
    #5
  6. Poryg

    Poryg Pixie of the Emvee kingdom, Ham of a Hamster Veteran

    Messages:
    3,662
    Likes Received:
    9,216
    Location:
    Czech Republic
    First Language:
    Czech
    Primarily Uses:
    RMMV
    nwjs is a web browser. More or less.
     
    #6
    Engr. Adiktuzmiko likes this.
  7. Andar

    Andar Veteran Veteran

    Messages:
    28,007
    Likes Received:
    6,330
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    it can only work if you replace the automated battles with simulated battleresults.

    But do you really think any idle game does it differently? they automate the battles while the game is running and mark the second it gets shut down on the server. Then when it starts again they simply calculate how much money/EXP/whatever you would have made on average in the time since then and give you that sum instead of calculating every battle since.
     
    #7
    Engr. Adiktuzmiko likes this.
  8. Crysillion

    Crysillion Veteran Veteran

    Messages:
    117
    Likes Received:
    19
    I can see this being the case, but not so much when the game is simply minimized. I understand it not working when the game is closed, but if all operation is ceased when the game is minimized then I'm not sure if I could work around that. Perhaps making an idle game in RPG Maker is a fun idea, but not something that can reasonably happen, which is a shame.

    Altrernatively, is there any way I can detect when the game is minimized and when it's brought back into focus? At least then I could work in some variables.
     
    #8
  9. Andar

    Andar Veteran Veteran

    Messages:
    28,007
    Likes Received:
    6,330
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    you just have to use a javascript command to load current system time into a variable, compare that variable with the last time stored and then decide how big the difference has to be to trigger a summary.
     
    #9
    Engr. Adiktuzmiko likes this.
  10. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,407
    Likes Received:
    2,822
    Location:
    Philippines
    First Language:
    Tagalog
    Yeah, as long as you simply make it check the current time against the previously saved time for the progression (probably you'd do it per second), it should work even when you minimize then return later.

    Basically, even if the game is open, you will still consider it as being in "idle" mode.

    You can make it such that if the difference is small (like 1 second if the game is actively being played) then it just adds the resources, but if the difference is large then it shows a summary of the obtained resources.
     
    #10

Share This Page