[Dev] Speeder MV

In Ace, I wrote a tool that allows you to increase the speed of a game dynamically.


There was also a script version, but I can't remember where I put it.


Anyways, so now in MV I would also like to be able to speed up or slow down my games.


This resulted in a plugin called "Speeder MV" (name tentative) that basically allows you to do that with a few simple script calls.


You can see a preview of it here:




At the moment, it only supports speeding things up, but I'm looking at ways to also "slow down" the game speed.


This plugin can be used for both development purposes as well as unique game mechanics.
This plugin is helpful when talking about actor's memories.
I can see this being useful for situation where you have day/night cycles and/or time-based events. Looks good.
I don't think, that messing with the FPS to emulate faster game speed is a good idea. Depending on what's currently going on, it may put a good amount of strain on the PC (and especially on mobile devices). It might also be incompatible with FluidTimestamp, which is kind of a must-have plugin for all games.
I don't think, that messing with the FPS to emulate faster game speed is a good idea. Depending on what's currently going on, it may put a good amount of strain on the PC (and especially on mobile devices). It might also be incompatible with FluidTimestamp, which is kind of a must-have plugin for all games.
I'm not changing FPS, so it should be fine.
I'm not changing FPS, so it should be fine.
I assume it's being done by overriding the various update methods and scaling the value by a value stored in the plugin.

I'm looking at ways to also "slow down" the game speed.
If I'm right then wouldn't that work no matter what the timescale value is? I mean, if it's a multiplier of sorts.
I assume it's being done by overriding the various update methods and scaling the value by a value stored in the plugin.


If I'm right then wouldn't that work no matter what the timescale value is? I mean, if it's a multiplier of sorts.
What would "the value" be referring to?
What would "the value" be referring to?
Without knowing how the graphics logic is updating I can't give a real working example, but for argument's sake lets say Game_CharacterBase tracks the frame count for updating its graphic (cycling through the spritesheet), it'd look something like:

function(){ if (++this._frameCount == this._framesBetweenGraphicUpdates) { this._frameCount = 0; // redraw the bitmap from the spritesheet - advance by 1 frame }}Then "the value" in this instance would be the _frameCount variable. So if you want the graphics to update twice as fast, you multiply _frameCount by 2 - then adjust to account for overflow:

function(){ var framesPassed = ++this._frameCount * PLUGIN_MODIFIERl if (framesPassed >= this._frameBetweenGraphicsUpdates) { var numGraphicsUpdates = Math.floor(framesPassed / this._frameBetweenGraphicsUpdates); this._frameCount = framesPassed % this._frameBetweenGraphicsUpdates; // redraw the bitmap from the spritesheet - advance by numGraphicsUpdates }}I mean, that's probably how I'd do it (he says not knowing what's going on under the hood of RM). Would allow for speed up and slow down.

Edit: Though I totally concede that if logic and graphic update processing isn't centralised, this sort of implementation would take and age, overriding every single update function on every single affect class.
My approach is to just call update twice instead of once every frame, which would effectively double the number of updates that are performed.


Though, this results in some usability issues without implementing finer controls.
Benefit of doing it a that way is that you don't need to worry about when to call the logic updates. Though I guess it restricts you to only to integer value for speed.

Slowing down could be achieved by having a modulator (like in my previous example) to track how many frames have passed, only call update when that many frames have passed? (Using your current set up)
My approach is to just call update twice instead of once every frame, which would effectively double the number of updates that are performed.
You might reconsider this approach and check what the desync does. It was already mentioned above and can be found here:
http://forums.rpgmakerweb.com/index.php?/topic/50709-fluidtimestep-fix-the-game-speed/


The problem is that by default, the gamespeed is not sync'd to time but to the refresh rate of the display/graphic card.


Which means that if you get to a computer with a slow display refresh, the game is slowed and if you get to a computer with a high display refresh, the game is speed up - both cases have been reported, and the speed changes made the game unplayable.


For that reason, your speed plugin either needs to replace the current sync itself (like the script does) or it needs to be compatible to it.
Benefit of doing it a that way is that you don't need to worry about when to call the logic updates. Though I guess it restricts you to only to integer value for speed.


Slowing down could be achieved by having a modulator (like in my previous example) to track how many frames have passed, only call update when that many frames have passed? (Using your current set up)
Yes, that's the current logic I'm thinking.


1. If double speed means updating twice per frame, then


2. half speed means updating once per two frames


However, decimal speeds might be something to consider.


Like 1.5x speed. I'm not really sure how that might be done even with the modulator.


Assuming 60 FPS, then normal speed means you need to update 60 times per second.


Double speed means 120 times per second. Assuming frame rate is fixed, then you would need to double update count just to hit the quota.


For 1.5x speed, that means 90 updates per second.


This means one frame would have one update, and every other frame would have 2 updates.


That seems a bit weird.

You might reconsider this approach and check what the desync does. It was already mentioned above and can be found here:


http://forums.rpgmakerweb.com/index.php?/topic/50709-fluidtimestep-fix-the-game-speed/


The problem is that by default, the gamespeed is not sync'd to time but to the refresh rate of the display/graphic card.


Which means that if you get to a computer with a slow display refresh, the game is slowed and if you get to a computer with a high display refresh, the game is speed up - both cases have been reported, and the speed changes made the game unplayable.


For that reason, your speed plugin either needs to replace the current sync itself (like the script does) or it needs to be compatible to it.
The purpose of my plugin isn't to "sync" refresh rates or anything.


It's literally to allow people to speed things up 100x if they want to.


So no matter whether your monitor refreshes at 30, 60, 75, 125, 144, etc, double speed means doubling the base speed of the game.


Introducing the fluid time step plugin simply normalizes the "base speed", with which you could then double or halve or multiple by 100, and so on.
For 1.5x speed, that means 90 updates per second.This means one frame would have one update, and every other frame would have 2 updates.That seems a bit weird.
True that it might seem weird logically, but visually we're talking 3 updates in 120ms (at 60fps consistant). You'll probably be ok with that.One caveat of the general approach means you're putting more stress on the cpu by loading each frame with more logic updates.
The way you are doing it is not different from modifying the FPS of the game, like i mentioned above. That effect could easily be achieved by taking the FluedTimestamp plugin and make its hardcoded 60 FPS changeable. This would also allow you to modify the speed to be 1.5x times the base (or 90 FPS).
True that it might seem weird logically, but visually we're talking 3 updates in 120ms (at 60fps consistant). You'll probably be ok with that.


One caveat of the general approach means you're putting more stress on the cpu by loading each frame with more logic updates.
I guess the alternative would be to have each method take into consideration the current game speed, which wouldn't be a bad idea if someone wanted to implement speed changing without having to perform extra processing.

The way you are doing it is not different from modifying the FPS of the game, like i mentioned above. That effect could easily be achieved by taking the FluedTimestamp plugin and make its hardcoded 60 FPS changeable. This would also allow you to modify the speed to be 1.5x times the base (or 90 FPS).
Oh, I see.


Well, I suppose I could put in a request to have that kind of function implemented to avoid releasing a plugin that does basically the same thing except with a few extra things under my own name.
What happened with this plugin? I can't find it in Hime webpage.
@Zero_G The info under your avatar says that you are using VX Ace. If you have been looking on the VX Ace page of Hime's site, you won't find this, because it is a plugin for MV. It will not run in an Ace project.
No, I want it for MV. There is another plugin that cycles through speed on a button push, I was looking for a speed up only while pushed.

Original thread: https://forums.rpgmakerweb.com/threads/dev-speeder-mv.54338/