RPG Maker MV

RPG Maker MV

LuN Jan 6, 2023 @ 3:23pm
how do i change the character speed
I want to change the speed of the main character but normal speed is too fast and the next slower option is too slow. How can i change the speed to something between normal and slower?
< >
Showing 1-4 of 4 comments
Donoghu Jan 6, 2023 @ 6:27pm 
Just to make sure, you're asking about the movement speed, right? (As in how fast a character move from one tile to the next one.)

In any cases and either way, you can edit the movements values (if you need something more precise) in the rpg_objects.js file located in your project folder. Search for the various instances where the lines of codes mention "moveSpeed" to see what kind of possible changes you can apply.
As an example, here's a bit of the code which controls the player (and other events) speed when running or not:

Game_CharacterBase.prototype.realMoveSpeed = function() {
return this._moveSpeed + (this.isDashing() ? 1 : 0);
};

In that function, the moveSpeed is raised by a value of 1 if the isDashing is ON (controlled either by the input, for the player, or the state set in the movement menu of an event).

While most of the values displayed in the codes seems a whole numbers (called integers), quite a few of them are actually decimal numbers (called floats).

For example, if you look (again in the rpg_objects.js file) the following function:

Game_CharacterBase.prototype.initMembers = function() {
this._x = 0;
this._y = 0;
this._realX = 0;
this._realY = 0;
this._moveSpeed = 4;
this._moveFrequency = 6;
this._opacity = 255;
this._blendMode = 0;
this._direction = 2;
this._pattern = 1;
this._priorityType = 1;
this._tileId = 0;
this._characterName = '';
this._characterIndex = 0;
this._isObjectCharacter = false;
this._walkAnime = true;
this._stepAnime = false;
this._directionFix = false;
this._through = false;
this._transparent = false;
this._bushDepth = 0;
this._animationId = 0;
this._balloonId = 0;
this._animationPlaying = false;
this._balloonPlaying = false;
this._animationCount = 0;
this._stopCount = 0;
this._jumpCount = 0;
this._jumpPeak = 0;
this._movementSuccess = true;
};

This function define the default values of ALL events/characters in a map, including the players prior to the moment where they receive their actual state. It's followed by 3 possible functions that states the less generic functions depending on if the event/character is the player or a "character" or a simple event.

For example, "_moveSpeed" controls the time it takes for a sprite (image) to move from 1 tile to another targeted tile. For example, 4 (which is actually 4.0 as, yes, you can put decimals in it) is the default movement speed. If you set it to 0.5, it will take the player a while to see the active character move from 1 tile to the next. Just a reminder that the movements, in RPG Maker MV is tile-based and, as such by default the player can't change the movements of an event (like the player character) while it's in transition between 2 tiles. With my example of 0.5 in move speed, if the player press a direction and the character initiate a movement in that direction, he or she can't cancel or add a new movement until the character has finished moved onto the next tile. This limitation can be overwritten in the codes, but that requires an understanding of said codes.

As such, if you want to implement a condition that only apply to the player character without affecting other events/characters without having to set the values every times a map/scene is loaded, you can set the parameters by adding a new variable parameter to the "Game_Player" function (which is unique to the player's character) and do a check that variable value on the moveSpeed (like with the isDashing) to adjust the move speed accordingly.

If you want to experience in those codes, I must highly suggest that, 1st, you store a copy of the codes before any changes just in case you break something. Keeping a backup of a functioning state of a script file is among the top of the early rules in coding 101.
LuN Jan 6, 2023 @ 7:23pm 
yes i just want to make my main character a bit slower (take more time to move from tile to tile). Im a bit scared of changing the code in the files isnt there a simpler way?
I am also a total noob at coding so can you maybe write a step by step guide where to go and put what line of code? ANd thx for the detailed answer.
Last edited by LuN; Jan 6, 2023 @ 7:40pm
Donoghu Jan 6, 2023 @ 10:46pm 
Originally posted by LuN:
yes i just want to make my main character a bit slower (take more time to move from tile to tile). Im a bit scared of changing the code in the files isnt there a simpler way?
I am also a total noob at coding so can you maybe write a step by step guide where to go and put what line of code? ANd thx for the detailed answer.

As I have previously mentioned, just doing a copy-paste of the "rpg_objects.js" file in the project folder allows you to reset all changes (by copying/pasting again back into the folder) if you make a mistake. While it's understandable that you fear making 1 or many mistakes, that's a necessary step to do what you want to do. Even if you forget to back up the file, creating a new project generate the exact identical file as that file is NOT relevant to the settings you put in the editor. That file is basically the canvas from which the engine look up into for data while also looking at the setup file generated by said editor.

One thing though that I can point out is that the in-editor values for movement speed are actually wrong. The default speed value are determined by flat values from the parameters.
For example, the speed values, in the editor, are written as :
1 : 8x Slower
2 : 6x Slower
3 : 2x Slower
4 : Normal
5 : 2x Faster
6 : 4x Faster

Those notes next to the 1-6 are actually wrong.
1 : is 4x Slower
2 : is 2x Slower
3 : is 1.75x Slower
4 : is 1x (normal)
5 : is 1.25x faster
6 : is 1.5x faster

That's because the value is set at the value displayed at the beginning (1 to 6) and the default speed is 4. (So 3 is not 2x slower, but 3/4 and 2 is 2/4 and 1 is 1/4).

As such, modifying the speed in the code also requires a bit of a work around since, whenever you change the speed in-game, it set the speed with the flat value determined by the parameter (which means it breaks any changes you might have done elsewhere).

There are quite a few things like that in the codes that need to be looked at and considered.

I looked into it myself (out of curiosity) and made my own little setup.

This is a GitHub containing a modified version of the file :
https://github.com/dongohu/RPGMakerVM-Mods/blob/main/rpg_objects.js

(I can't just copy/paste the code in here as we're limited to 18K character and the file contains over 10K lines of codes);

I made it so that you can modify the basic movement speed of the sprite/character/player in the game and any changes done like when you enter and exit a vehicle or if you change the speed through an event, it retains the speed relatively.

The script currently set the movement speed at a value of 3.5 so the middle ground between the original normal speed (4) and 1st slower speed (3).

You can edit it by searching for "Game_CharacterBase.prototype.initMembers" line (CTRL+F in note pad) and looking at the 1st line under it which looks like "this._moveSpeed = 3.5;"

Remember that 4 is the original "normal" speed so if you though it was too fast and the slow (value of 3) was too slow, stay in-between 3.00 and 4.00.

With that said, I didn't fix the wrong speed values of the dropdown for speed because a true 8x slow or 6x faster speed is just unplayable. I DID implement the adaptation though so if you set the speed at the original 3: 2X Slower, it will set the speed to 3/4 of the value you enter at the line mentioned above. The code to fix/correct the mistake in the editor is not in the project folder and as I previously mentioned, true 8x slower and 6x faster is just broken.

A special note, in the code above which also exists in the regular unmodified code is under the code line "Game_Vehicle.prototype.initMoveSpeed" (again, use CTRL+F to search that line in the codes).

Those lines of codes determine the speed of each types of vehicles named "boat", "ship" and "Airship" in the game settings. You can't really properly and automatically edit this speed in the editor, but can do it through the codes. (You can change the speed by applying a speed change once the player enter the vehicle, but it reset whenever the player quit and enter again or if the player load a save or something.)

By default, the values are as this :
Game_Vehicle.prototype.initMoveSpeed = function() { if (this.isBoat()) { this.setMoveSpeed(4); } else if (this.isShip()) { this.setMoveSpeed(5); } else if (this.isAirship()) { this.setMoveSpeed(6); } };

You can see that the boat has a speed of 4, the Ship has a speed of 5 and the Airship has a speed of 6. If you were to do, instead, a horse-pulled cart instead of a boat, you might want something like a 5 for its speed. Then you could want the ship to be as slow as the player, so a speed of 3 and the airship could have a speed of 4 instead of 6 (faster than on foot and more freedom, but not faster than the horse.) Just a few ideas if you wanted to change those.

This is the best I can do for you under the current circumstances. I also hope others might appreciate it too.
Last edited by Donoghu; Jan 6, 2023 @ 10:48pm
uzinald Nov 1, 2024 @ 3:19pm 
Originally posted by Donoghu:
Originally posted by LuN:
yes i just want to make my main character a bit slower (take more time to move from tile to tile). Im a bit scared of changing the code in the files isnt there a simpler way?
I am also a total noob at coding so can you maybe write a step by step guide where to go and put what line of code? ANd thx for the detailed answer.

As I have previously mentioned, just doing a copy-paste of the "rpg_objects.js" file in the project folder allows you to reset all changes (by copying/pasting again back into the folder) if you make a mistake. While it's understandable that you fear making 1 or many mistakes, that's a necessary step to do what you want to do. Even if you forget to back up the file, creating a new project generate the exact identical file as that file is NOT relevant to the settings you put in the editor. That file is basically the canvas from which the engine look up into for data while also looking at the setup file generated by said editor.

One thing though that I can point out is that the in-editor values for movement speed are actually wrong. The default speed value are determined by flat values from the parameters.
For example, the speed values, in the editor, are written as :
1 : 8x Slower
2 : 6x Slower
3 : 2x Slower
4 : Normal
5 : 2x Faster
6 : 4x Faster

Those notes next to the 1-6 are actually wrong.
1 : is 4x Slower
2 : is 2x Slower
3 : is 1.75x Slower
4 : is 1x (normal)
5 : is 1.25x faster
6 : is 1.5x faster

That's because the value is set at the value displayed at the beginning (1 to 6) and the default speed is 4. (So 3 is not 2x slower, but 3/4 and 2 is 2/4 and 1 is 1/4).

As such, modifying the speed in the code also requires a bit of a work around since, whenever you change the speed in-game, it set the speed with the flat value determined by the parameter (which means it breaks any changes you might have done elsewhere).

There are quite a few things like that in the codes that need to be looked at and considered.

I looked into it myself (out of curiosity) and made my own little setup.

This is a GitHub containing a modified version of the file :
https://github.com/dongohu/RPGMakerVM-Mods/blob/main/rpg_objects.js

(I can't just copy/paste the code in here as we're limited to 18K character and the file contains over 10K lines of codes);

I made it so that you can modify the basic movement speed of the sprite/character/player in the game and any changes done like when you enter and exit a vehicle or if you change the speed through an event, it retains the speed relatively.

The script currently set the movement speed at a value of 3.5 so the middle ground between the original normal speed (4) and 1st slower speed (3).

You can edit it by searching for "Game_CharacterBase.prototype.initMembers" line (CTRL+F in note pad) and looking at the 1st line under it which looks like "this._moveSpeed = 3.5;"

Remember that 4 is the original "normal" speed so if you though it was too fast and the slow (value of 3) was too slow, stay in-between 3.00 and 4.00.

With that said, I didn't fix the wrong speed values of the dropdown for speed because a true 8x slow or 6x faster speed is just unplayable. I DID implement the adaptation though so if you set the speed at the original 3: 2X Slower, it will set the speed to 3/4 of the value you enter at the line mentioned above. The code to fix/correct the mistake in the editor is not in the project folder and as I previously mentioned, true 8x slower and 6x faster is just broken.

A special note, in the code above which also exists in the regular unmodified code is under the code line "Game_Vehicle.prototype.initMoveSpeed" (again, use CTRL+F to search that line in the codes).

Those lines of codes determine the speed of each types of vehicles named "boat", "ship" and "Airship" in the game settings. You can't really properly and automatically edit this speed in the editor, but can do it through the codes. (You can change the speed by applying a speed change once the player enter the vehicle, but it reset whenever the player quit and enter again or if the player load a save or something.)

By default, the values are as this :
Game_Vehicle.prototype.initMoveSpeed = function() { if (this.isBoat()) { this.setMoveSpeed(4); } else if (this.isShip()) { this.setMoveSpeed(5); } else if (this.isAirship()) { this.setMoveSpeed(6); } };

You can see that the boat has a speed of 4, the Ship has a speed of 5 and the Airship has a speed of 6. If you were to do, instead, a horse-pulled cart instead of a boat, you might want something like a 5 for its speed. Then you could want the ship to be as slow as the player, so a speed of 3 and the airship could have a speed of 4 instead of 6 (faster than on foot and more freedom, but not faster than the horse.) Just a few ideas if you wanted to change those.

This is the best I can do for you under the current circumstances. I also hope others might appreciate it too.


Uhh no the editor values are correct. A movespeed of 5 is 2x faster than 4. Not sure where you got your info from.
< >
Showing 1-4 of 4 comments
Per page: 1530 50