[VX Ace] GaryCXJk's Free Movement and distance_per_frame Sprite Bug

Robert-Character Creator

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
516
Reaction score
220
First Language
English
Primarily Uses
RMVXA
Hello! Let's get right into it. I've had this bug for the majority of the 2.5 years I've been developing my game, but I haven't asked about it up until now. Basically, I've isolated the problem down to one script, and one core script edit.

Let me explain. So, my game has a horror/suspense theme, so the player walks much slower than in normal RPG Maker games, and has a sprint when they are being chased. To make this smooth, I am using Gary CXJk's Free Movement script, which adds 8 directional pixel-based movement, free of the grid. To slow the player down to about a third of what is normal, I have changed a line in Game_CharacterBase, in the definition of distance_per_frame. This can be found on lines 135-137.

Ruby:
  def distance_per_frame
    2 ** real_move_speed / 768.0
  end
Normally, that 768 value is 256. By tripling it, it thirds the speed of the player. However, in doing this, the player's sprite will visually vibrate when walking in certain directions. The actual directions this occurs in vary considerably, and I have seen it occur on every direction, simply not all at the same time. There is always at least one direction that behaves normally, usually an orthogonal.

The only values at which I have not seen the vibrations occur is the default, 256, and double that, 512. However, 512 is still a bit too quick, and it makes the walking animations of the player look strange, in my opinion. This is also the reason I am not using the built-in functions to slow the player, as only x2, x4, and x8 speeds are offered, when I need a x3 option.

Thank you for reading this, and for any help you can offer solving this issue, of any other solutions you can offer.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,655
Reaction score
562
First Language
English
Primarily Uses
RMVXA
I need a x3 option
You can do that in a script call.
$game_player.move_speed = 3
Just set it at the start of your game.
There are also scripts to let you adjust the speed in different ways.
If I recall correctly, you can also use halves. i.e. 3.5
 

Robert-Character Creator

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
516
Reaction score
220
First Language
English
Primarily Uses
RMVXA
Really now? I didn't know such a thing was possible. Let me try it out.

...

Well then, it works. I had to set it to 2.5 to get it where I wanted it, for some reason, but it works! HOWEVER, the vibrating is still happening, which is strange. Any idea why? I have a custom sprite, but this happens even with a default one.

Edit: Also, when I test that script call in an empty project, the game crashes. Any idea why that happens, as well?
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,655
Reaction score
562
First Language
English
Primarily Uses
RMVXA
the game crashes.
Sorry, I just remembered that it was possible. Forgot that it is reliant on a script adjustment.
Ruby:
class Game_Player < Game_Character
  attr_writer :move_speed
end

Did you change the Distance_per_frame back to 256?
def distance_per_frame
2 ** real_move_speed / 256.0
end
 

Robert-Character Creator

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
516
Reaction score
220
First Language
English
Primarily Uses
RMVXA
Okay @Roninator2 . Sorry for the late reply, had to sleep. With that snippet, it works in the empty project. However, the sprite still vibrates. And yes, I set the number back to 256 on both projects. I made sure to do that first thing. The only script present is the Free Movement script. If I remove that script, the vibrating stops, but then I'm constrained to the grid again, which is not going to work in my project.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,655
Reaction score
562
First Language
English
Primarily Uses
RMVXA
Can you show the vibrating?
 
Last edited:

Robert-Character Creator

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
516
Reaction score
220
First Language
English
Primarily Uses
RMVXA
Yes, I can. I'll have to record it tomorrow now, because I didn't see your edit until now, and I work in the morning. Please reply if you see this, so I don't have to wait three days to not double-post.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,655
Reaction score
562
First Language
English
Primarily Uses
RMVXA
It would not be just for me, but for other people as well. I may not be able to find the answer.
 

Robert-Character Creator

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
516
Reaction score
220
First Language
English
Primarily Uses
RMVXA
A friend of mine messaged me with the answer last night! There's a script under Bug Fixes called 'Event Jitter Fix'. I never noticed it sitting there before, and I'm not sure where it came from, as it was in my blank project as well. Removing it fixed the bug! That's the solution!
 

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

Latest Threads

Latest Profile Posts

Yet another gaming question, i'm currently playing Last of Us 2 and want to get another game to play next but can't decide between Ghost of Tsushima, Miles Morales & Jedi Fallen Order. After the latest mandalorian i AM on a star wars kick, but i also LOVED the last spiderman game that prequels Miles Morales. Ghost of Tsushima is the bottom of my list but i heard it was AWESOME. Just want a good story & fun gameplay.
I checked out Genshin Impact gameplay out of curiosity. I can't believe it's available as a mobile game too. Smooth animation, great music, and stellar sound effects (the ambient sounds are pretty detailed).

I'm flabbergasted to see games have becoming more and more advanced. Maybe also because I'm oblivious to current trend for a long time, it almost feel like I'm being sent into distant future. xD
xDRAGOONx wrote on WaywardMartian's profile.
Your artwork is amazing!!!
:ewat:
Stream will be live shortly with a session of the Interactive Text Adventure! Feel free to drop by!
I should finish the cat video I'm editing and finish the indesign stuff. So far only 1 is done and 4 to go

Forum statistics

Threads
105,664
Messages
1,015,380
Members
137,341
Latest member
jasapembuatanwebsite
Top