1. Jester Blue

    Jester Blue Thread Author Rookie member

    Joined:
    May 6, 2017
    Posts:
    7

    Solved Movement stopping every tile

    Discussion in 'Pokémon Essentials' started by Jester Blue, May 15, 2017.

    When moving, the player character stops on every tile after moving. It's very noticeable when turning while running/biking.

    Has anybody else encountered/dealt with this issue?

    Using a fresh copy of Essentials 16.2, no additions.
     
    Last edited: May 19, 2017 at 5:11 PM
  2. Sparta

    Sparta Bronzong. With a hat. member

    Joined:
    Mar 28, 2017
    Posts:
    88
    Well, that's not much to go on. Are there any other details you can share? It's hard to figure out the problem when you only know what the issue is and nothing else.

    Honestly, the only thing that I could think is that maybe you have too many events on a single map and it's causing the game to lag.
     
  3. Tomix9tomix

    Tomix9tomix Just a casual dude member

    Joined:
    Mar 23, 2017
    Posts:
    31
    apart from lag, it could be something wrong with your keyboard not letting you hold down a key for too long or something
     
  4. Jester Blue

    Jester Blue Thread Author Rookie member

    Joined:
    May 6, 2017
    Posts:
    7
    I don't believe lag is the issue - it occurs just the same on an unconnected 15x20 map with no events.


    I think the issue is caused by the way movement is handled. This is the logic as far as I understand it: To start movement, the character is moved one pixel in the direction they're going to move. (ex: Game_Character 447) This causes the game to recognize them as moving (Game_Character 66), and it will then move them in the same direction, clamping their coordinate to their next tile position(Game_Character 264). When they are at this position (and thus considered 'not moving'), if they were moving in the previous frame, event handlers are fired (Game_Player 477).

    I've also found a solution which strongly masks the issue. In the move_{dir} methods (Game_Character 440), I altered the starting motion to be equal to the motion the character would make in a normal frame of the movement. While the 'pause' frame is still visible when the game is slowed to 10FPS, the feeling of it is all but gone. This might cause problems elsewhere, though I don't expect it to.
     
  5. Jester Blue

    Jester Blue Thread Author Rookie member

    Joined:
    May 6, 2017
    Posts:
    7
    Posting for posterity.

    Well, this was completely wrong. Those methods aren't even used by the player character, and the variables there are in terms of tiles. I discovered this when I pushed a boulder and it moved a mile.
    The actual 'solution' seems to have been commenting out a check on Game_Player 413:
    Code:
    if dir==@lastdir# && Graphics.frame_count-@lastdirframe>2
    I'm not exactly sure what the purpose of this check is, though it seems to be saying "We cannot do anything if we turned on the last frame" which would absolutely cause the issue I was having.
     
    Aki likes this.
  6. Maruno

    Maruno Pokémon Essentials dev ubessdev

    Joined:
    Apr 5, 2017
    Posts:
    11
    That bit of code is intended to let you turn on the spot. It gives you a 2 frame window to let go of a direction key (after you've turned in that direction) before you start moving in that direction. It shouldn't have any effect on continuous movement.

    What you haven't done is stated a) which version of Essentials you're using, and b) what you've done to it to cause your problem to appear in the first place. Since no one else has complained about this, I can only assume you've done something to your game which causes it.
     
  7. Jester Blue

    Jester Blue Thread Author Rookie member

    Joined:
    May 6, 2017
    Posts:
    7
    Having complained elsewhere about people not posting that sort of information before, I ought to have been better about it. I'm using a fresh copy of Essentials 16.2, and I just re-extracted it to make sure. As far as I can tell, that turning code is activating on each tile while moving, causing a pause when I change direction.

    Edited original post to include the info as well.