[Dev] Speeder MV

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,079
First Language
English
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.
 

hardqueen

Crazy Talker
Veteran
Joined
Oct 26, 2015
Messages
78
Reaction score
15
First Language
Chinese
This plugin is helpful when talking about actor's memories.
 

S_Rank_Crazy

Veteran
Veteran
Joined
Dec 30, 2015
Messages
78
Reaction score
47
First Language
English
Primarily Uses
RMMV
I can see this being useful for situation where you have day/night cycles and/or time-based events. Looks good.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
859
First Language
German
Primarily Uses
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,079
First Language
English
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.
 
Last edited by a moderator:

S_Rank_Crazy

Veteran
Veteran
Joined
Dec 30, 2015
Messages
78
Reaction score
47
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,079
First Language
English
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?
 

S_Rank_Crazy

Veteran
Veteran
Joined
Dec 30, 2015
Messages
78
Reaction score
47
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,079
First Language
English
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.
 

S_Rank_Crazy

Veteran
Veteran
Joined
Dec 30, 2015
Messages
78
Reaction score
47
First Language
English
Primarily Uses
RMMV
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)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,011
Reaction score
7,023
First Language
German
Primarily Uses
RMMV
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,079
First Language
English
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.
 
Last edited by a moderator:

S_Rank_Crazy

Veteran
Veteran
Joined
Dec 30, 2015
Messages
78
Reaction score
47
First Language
English
Primarily Uses
RMMV
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.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
859
First Language
German
Primarily Uses
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).
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,079
First Language
English
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.
 

Zero_G

Villager
Member
Joined
Mar 28, 2020
Messages
5
Reaction score
2
First Language
English
Primarily Uses
RMVXA
What happened with this plugin? I can't find it in Hime webpage.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,844
Reaction score
11,059
First Language
English
Primarily Uses
RMVXA
@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.
 

Zero_G

Villager
Member
Joined
Mar 28, 2020
Messages
5
Reaction score
2
First Language
English
Primarily Uses
RMVXA
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Posts

Latest Profile Posts

I based this on the armor of Actor 1_7 of the RTP. Hair is from Derex and Sythian Bard.
Stream will be live shortly! Going to do another art stream tonight so that I can finish my Fauna Focus piece~ Feel free to drop by!
Humans are fallible creatures, we all know that. It's when we're forced to look at ourselves that we start to disagree. :p
Expectation: Working on boss battle.
Reality: "Look at how awful are these code and database organization. Let me clean this mess", *yet, casually adding more modules that I have no idea if I would use it later*
Trying to learn to read Japanese so I read my manga. I like to buy them without all the edits made during translation.

Forum statistics

Threads
97,865
Messages
947,457
Members
129,089
Latest member
candutekno
Top