MV Galv's CharacterFrames: framerate calculation?

I've been trying to understand this formula going on and I could use some help so that I can design my character sheets right.

If the default given is (9-this.moveRealSpeed())*3, how is the 1-6 speed (e.g.; x8 slower) calculated there?

Would that make the default frame wait time 30 frames for speed 3, 60 frames for speed 2, etc.?

And if I have a calculation in Galv's CharacterFrames which is supposed to be subtracted from the wait time like f*0.5+3.25 so that a 16-frame animation would come to (at normal speed) 15 (from the default) minus the formula result 11.25 = 3.75 wait time.

This is essentially creating a 60fps/3.75 = 16 fps for the character ?

Would the speed of the event containing the animation multiply the result?

I'm seeing something "go weird" (or maybe it's not weird, that's why I want to understand how it's calculated) like setting the wait time to 30 frames (for the 16 frame animation playing at 2X speed to complete) and the animation plays twice instead despite correct convention (e.g.; example%(16).png) does this mean I am dropping frames or have a weird framerate? Is 60fps what MV is attempting? If I set the wait time to 15 frames (which would be 4 times faster, not twice as fast) it plays once correctly.

So it seems like 2X speed is actually 4X speed?

Please help me wrap my poor brain around this!
I'm not familiar with Galv's plugin, but:
  1. realMoveSpeed usually increases by +1 when a character is dashing. E.g. normal player walk speed is 4, dash speed is 5. Check the Always Dash setting on the in-game options menu. Touch movement automatically dashes, regardless.

  2. You can press F2 in-game to show the framerate widget for an idea of the current framerate.

  3. If you're using a monitor with refresh rate over 60 Hz, this might be relevant:
Oh, that's helpful, thanks! I can now see that I am basically running 51-60fps and it should probably not be dropping frames then?

And thank you very much for providing insight about realMoveSpeed. It's super weird to think that the formula 9-realMoveSpeed (cited by Galv) is the full thing. Because let's say we have a basic 4-frame character (cycling between left, middle, and right, and middle again walk cycle frames). Then it wouldn't explain double speed. That would just calculate to (9-5 = 4)*3 = 12 gameframe wait. The wait should really end up being half of 15frames somehow if we're getting 8fps instead of 4fps with the increase of speed from 4 to 5.

If double speed made realMoveSpeed into 6.5, that would work out: (9-6.5=2.5)*3 = 7.5 gameframe wait (60/7.5 = 8fps)

So yeah, the Galv given formula is not the whole story, somehow. I hope someone will explain more about how it works. Thank you again for the clues!!
It's super weird to think that the formula 9-realMoveSpeed (cited by Galv) is the full thing.
Well, it's pretty simple to verify - you just search your js folder for "realmovespeed" and it should come right up:

1732423599014.png


Because let's say we have a basic 4-frame character (cycling between left, middle, and right, and middle again walk cycle frames). Then it wouldn't explain double speed. That would just calculate to (9-5 = 4)*3 = 12 gameframe wait. The wait should really end up being half of 15frames somehow if we're getting 8fps instead of 4fps with the increase of speed from 4 to 5.
I feel like you're connecting two things that are not connected: the distance a character moves per frame is not a direct corollary to how quickly their sprite animates.

They are both calculated off of the realMoveSpeed(), but they use completely different calculations. When a character moves twice as far in pixels, they are not animating twice as quickly.

The engine isn't designed to try to make the movement of the sprite's feet exactly match their movement across the ground.
They are both calculated off of the realMoveSpeed(), but they use completely different calculations.
Oh thank you! Great that you're always lending your knowledge and experience!

Are you willing to provide a clue into what that completely different calculation may be?

(Sorry if you feel the clue is already obvious! I'm not quite getting there.)
Are you willing to provide a clue into what that completely different calculation may be?

(Sorry if you feel the clue is already obvious! I'm not quite getting there.)
It kind of is? 😛 Since you already have the name of the function, all you have to do is what I said in my last post and search the js folder for realmovespeed. There are a very small number of hits...just look at them until you see the right one 🤣

(in fact, you'd see the function for moving the sprite before you saw the animation frames you've been talking about)

1732468427113.png
It kind of is? 😛 Since you already have the name of the function, all you have to do is what I said in my last post and search the js folder for realmovespeed. There are a very small number of hits...just look at them until you see the right one 🤣

(in fact, you'd see the function for moving the sprite before you saw the animation frames you've been talking about)

View attachment 323763

Okay, interesting. I see. So when Galv wrote in the plugin:

* Frame Speed Modifier
* ----------------------------------------------------------------------------
* This is an equation for you to use to change the speed that the frames play
* at when you are not using the normal amount of frames (3).
*
* The normal equation in RPG Maker default code is:
* (9 - this.realMoveSpeed()) * 3;
*
* The equation in the settings of this plugin allow you to create another
* equation that is SUBRACTED from the above result. In this equation you can
* use the variable 'f' for amount of frames the charactersheet uses.
*
* Example:
* f * 0.8 number of frames multipled by 0.5
* f / 2 number of frames divided by 2
* f * 0.5 - 1 number of frames multipled by 0.5, minus 1
*
*/

You're suggesting maybe that he is confusing two completely different calculations?

Even if that's so, I would prefer to use the plugin as designed, hence the reason for my OP.

I didn't mean wait time to cross a tile, I mean the wait time before updating character frame (i.e.; on a single spritesheet).

Maybe you're kind of saying that I should just ignore the speed multipliers like 1 (8x slower) through 6 (4x faster) but it definitely impacts the animation speed and I'm just trying to figure out how. Since that part isn't explained in the plugin and it's not totally clear from experimentation with it for many days.

PS: Sorry for any miscommunication! I'm still learning all the lingo.
You're suggesting maybe that he is confusing two completely different calculations?
...no, I'm not? I don't know where you got that from.

You said:
Because let's say we have a basic 4-frame character...Then it wouldn't explain double speed. That would just calculate to (9-5 = 4)*3 = 12 gameframe wait. The wait should really end up being half of 15frames somehow if we're getting 8fps instead of 4fps with the increase of speed from 4 to 5.
I have no idea where you're getting the conclusion that anything is double speed unless you're talking about the speed multipliers that are shown in the MZ editor, which are referring to the movement speed.

Thus, my explaining in the first place that the speed at which the sprite moves is not proportional to how quickly the sprite frames animate. Then you asked me for the formula that dictates how the sprite moves.

Maybe you're kind of saying that I should just ignore the speed multipliers like 1 (8x slower) through 6 (4x faster) but it definitely impacts the animation speed and I'm just trying to figure out how.
You were already told how. You posted it in your first post. And the plugin gives you a plugin parameter to modify it.

I'm kind of confused as to what the question still is 😛
OK, I just downloaded Galv's Character Frames (link to thread) and checked its code. As expected of Galv, it is programmed exactly as documented: the custom formula is evaluated for spritesheets with a non-standard pattern count, and gets subtracted from the original animationWait value.

More ideas:
  1. Holding the action button while a non-Parallel event is running causes the map to update twice per frame. Could that be the issue?

  2. Galv has a demo for this plugin. Do you see the problem in that project as well?

  3. You could try turning off all other plugins (Ctrl+A -> Turn OFF, then right-click GALV_CharacterFrames and turn it back on), save your project to apply Plugin Manager changes, then test, selecting New Game from the title screen.
Sorry, but in response to ATT_Turan let me say: I have so many questions whose answers still elude me! Defeating my own ignorance is a constant effort.

This is the question that I was trying to ask again, and my first question in the post:

If the default given is (9-this.moveRealSpeed())*3, how is the 1-6 speed (e.g.; x8 slower) calculated there?

I need to unpack why I consider it unanswered and some would consider it answered already.

The closest answer I received so far is from Post #2: https://forums.rpgmakerweb.com/inde...mes-framerate-calculation.173421/post-1483133

I think it might be because I thought I was asking a more general question that would lead to a lot of detailed answers. Let me try again with a more precise question, which requires a full scenario:

In the command editor of an event, you can assign a picture, which is the spritesheet. Next to that is a drop down menu that allows one to select a Speed (and by that a Frequency, which I am concerned is also involved in a core calculation so let's just assume we are leaving that at normal for now, to make this question as precise as possible).

When we select Speed 4 Galv's animation modifier works as expected. They are not completely different calculations but rather extremely related calculations as expounded in Galv's help file. But when selecting Speed 3 or Speed 5 (to be perfectly clear, any other speed besides 4) something happens to the calculation and I wasn't sure what. The question is: what?

However post #9 has helpfully dug in: https://forums.rpgmakerweb.com/inde...mes-framerate-calculation.173421/post-1483218

OK, I just downloaded Galv's Character Frames (link to thread) and checked its code. As expected of Galv, it is programmed exactly as documented: the custom formula is evaluated for spritesheets with a non-standard pattern count, and gets subtracted from the original animationWait value.

More ideas:
  1. Holding the action button while a non-Parallel event is running causes the map to update twice per frame. Could that be the issue?

  2. Galv has a demo for this plugin. Do you see the problem in that project as well?

  3. You could try turning off all other plugins (Ctrl+A -> Turn OFF, then right-click GALV_CharacterFrames and turn it back on), save your project to apply Plugin Manager changes, then test, selecting New Game from the title screen.

It is plausible that "OK"/action button "pressed down" is exactly what's doubling that.

By the way, I am also delighted to learn from both of you responding that the wait time between frames is called "animationWait"! I am thinking of making a spreadsheet for myself that explains all the most useful variables and functions to play with but I am still not quite sure if I need that or just need more time playing with and exploring the code.

I will check on these questions and get back to this thread! I appreciate the help on the investigation.
This is the question that I was trying to ask again, and my first question in the post:
If the default given is (9-this.moveRealSpeed())*3, how is the 1-6 speed (e.g.; x8 slower) calculated there?
I thought it was answered by caethyril's first reply, as you gave an example using it correctly.

The this.moveRealSpeed() portion is the 1-6 speed, +1 if you're currently dashing.

When we select Speed 4 Galv's animation modifier works as expected. They are not completely different calculations but rather extremely related calculations
Again, I never said Galv's plugin parameter was completely different from anything. 😉

But the way you were repeatedly going back to the core engine's method and questioning it made me think you had a problem, misunderstanding, or incorrect assumption regarding that.

It is plausible that "OK"/action button "pressed down" is exactly what's doubling that.
Do you have the problem when you're just walking/running around, or only when trying to fast-forward an event?

There's a little code snippet floating around dozens of threads to disable the latter if you end up needing to.
Oh, right on!
I thought it was answered by caethyril's first reply, as you gave an example using it correctly.

The this.moveRealSpeed() portion is the 1-6 speed, +1 if you're currently dashing.

That is how some variable is fed into the formula, but since the result doesn't calculate to observed animation speed it doesn't seem like I should assume the value of whatever is passed to that is actually the numerical name of the speed turned into a number.

If I just try dashing around in a default game with no plugins, this is the thing: for example Speed 5 is apparently 2X faster but (9 - 5) * 3 results in a frame wait time of 12, not half of 15 (7.5).

In order for it to be 7.5 the value passed to that formula ought to be 6.5 so that it goes (9 - 6.5) * 3 = 7.5.

So there's something I'm missing or mistaken already. Like does holding dash also update the character framerate faster, not just the OK button?

I am testing now so I will reply soonish!
So there's something I'm missing or mistaken already. Like does holding dash also update the character framerate faster, not just the OK button?
Only in accordance to the above formula. And, again, holding OK doesn't do anything unless you're in an event.
Oh! I've just recalled that the animation count advances by an extra 0.5 per frame when moving:
JavaScript:
Game_CharacterBase.prototype.updateAnimationCount = function() {
    if (this.isMoving() && this.hasWalkAnime()) {
        this._animationCount += 1.5;
    } else if (this.hasStepAnime() || !this.isOriginalPattern()) {
        this._animationCount++;
    }
};
I feel like this is probably the discrepancy you're seeing. 😅

Note that if the character does not have "Stepping" animation enabled, then when they stop moving their pattern will reset instead (cf updatePattern).

As-is, Galv's plugin does not change this: moving still updates 50% faster. The value is evaluated when the character is assigned, so it can't vary as the character walks/dashes. Here's some untested plugin code in case you want to try to unify the cases:
Spoiler: plugin code
JavaScript:
/*:
 * @target MV MZ
 * @plugindesc Character pattern no longer updates faster when moving.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/173421/
 * @help Free to use and/or modify for any project, no credit required.
 */
// Override - make move animation increment count by same amount as step.
Game_CharacterBase.prototype.updateAnimationCount = function() {
  if (
    (this.isMoving() && this.hasWalkAnime()) ||
    this.hasStepAnime() ||
    !this.isOriginalPattern()
  ) {
    ++this._animationCount;
  }
};
(Paste into a text editor, then Save As -> File Type: All Files, Filename: whatever.js. Then stick that in your project's js/plugins folder and import as usual.)

for example Speed 5 is apparently 2X faster but (9 - 5) * 3 results in a frame wait time of 12, not half of 15 (7.5)
Let's say character A moves at speed 4, and character B at speed 5. Without plugins:
  • Frames necessary to travel 1 map tile (2 ** (8 - speed), cf distancePerFrame):
    • A: 16 frames;
    • B: 8 frames.
    This is why speed 5 is named "2x faster" in the editor.

  • Frames between pattern updates (3 * (9 - speed), cf animationWait):
    • A: 15 frames;
    • B: 12 frames.
    I.e. 3 frames faster, not "2x faster".
The Frequency field, seen on map events, determines wait time between autonomous moves (cf checkStop/stopCountThreshold). Like "frames to travel 1 tile", it is completely untouched by Galv's plugin.

The custom formula in Galv's plugin affects the pattern update rate. In your case:
I have a calculation in Galv's CharacterFrames which is supposed to be subtracted from the wait time like f*0.5+3.25
So your pattern update rate reduction for a 16-pattern spritesheet is, as you deduced:
  • 16 * 0.5 + 3.25 = 8 + 3.25 = 11.25 frames.
Therefore, continuing the example, the pattern update rates would be:
  • A: 15 - 11.25 = 3.75 (stationary), or 3.75 / 1.5 = 2.5 (moving);
  • B: 12 - 11.25 = 0.75 (stationary), or 0.75 / 1.5 = 0.5 (moving).
However, the animation count has to exceed animationWait to cause a change in pattern, and the count is reset to zero when that happens (cf updateAnimation). So, in practice, a fractional result "rounds up" to the next integer:
  • A: 4 frames (stationary) or 3 frames (moving);
  • B: 1 frame (stationary or moving).
So a full 16-frame sequence would be expected to take:
  • A: 48~64 frames (moving/not);
  • B: 16 frames.
Hopefully I haven't missed anything in all that. 😴
Wow! I found that 1.5 area last night when I searched "animation" in the objects javascript, and I was like, "How the heck can I trace this and decipher what's going on?"

Thank you for doing it! Thank you so much! It's such a relief to see the actual math. That's exactly what I was asking for. I could cry, thank you. Having a recipe feels so much less like being on an amateur baking show. Now it makes sense!!
You're welcome! Hopefully the numbers match the readings now~ 👋

Original thread: https://forums.rpgmakerweb.com/threads/galvs-characterframes-framerate-calculation.173421/