• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Change Movement Speed [Pokeemerald]

  • 14
    Posts
    6
    Years
    • Seen Apr 28, 2025
    Anyone have any idea how to edit the default movement speeds of the player?

    The game seems to have several set movement speeds (PlayerWalkNormal, PlayerRun, PlayerWalkFast and PlayerWalkFaster), and all the tutorials in the simple modifications thread seem to do is change it so that, for example, the game uses PlayerRun when it would otherwise use PlayerWalkNormal. What I am talking about is actually editing the speed each of these movements uses, so that you could do things like have the player move twice as fast as the default Mach Bike speed.
     
    Anyone have any idea how to edit the default movement speeds of the player?

    The game seems to have several set movement speeds (PlayerWalkNormal, PlayerRun, PlayerWalkFast and PlayerWalkFaster), and all the tutorials in the simple modifications thread seem to do is change it so that, for example, the game uses PlayerRun when it would otherwise use PlayerWalkNormal. What I am talking about is actually editing the speed each of these movements uses, so that you could do things like have the player move twice as fast as the default Mach Bike speed.
    If you look at the implementations of the different player movement functions (PlayerWalkNormal, PlayerRun, PlayerWalkFast and PlayerWalkFaster), you'll see that they just apply different movement actions to the player object. Those actions are the same as the ones used by object events and are defined in src/event_object_movement.c and in src/data/object_events/movement_action_func_tables.h.

    If you look at event_object_movement.c, you can find the different MOVE_SPEED_ constants, and see how they're used in the functions of the different movement actions. You can change those functions to use different MOVE_SPEED_ constants to change the speeds of those actions, but that will also affect all NPCs and the animations for the actions might break.

    The speeds themselves are defined in terms of these step function lists that describe how the action moves the object over the 16 pixel-sized metatiles. As an example, the running speed MOVE_SPEED_FAST_1 (sStep2Funcs) moves the sprite for 8 frames in steps of 2 pixels. Knowing that, you can also modify the existing speeds or add new ones if needed.

    If as an example you wanted to make walking twice as fast as the Mach Bike without editing the speed at which NPCs move, you'd want the player's walking function to start a movement action that's twice as fast as the Mach Bike. Coincidentally the sliding movement is just that so you could just do:
    Diff:
     void PlayerWalkNormal(u8 direction)
     {
    -    PlayerSetAnimId(GetWalkNormalMovementAction(direction), COPY_MOVE_WALK);
    +    PlayerSetAnimId(GetSlideMovementAction(direction), COPY_MOVE_WALK);
     }
    [PokeCommunity.com] Change Movement Speed [Pokeemerald]
    The sliding animation is perhaps not ideal so you might want to create a new movement action with the desired speed and animation and use that instead.
     
    If you look at the implementations of the different player movement functions (PlayerWalkNormal, PlayerRun, PlayerWalkFast and PlayerWalkFaster), you'll see that they just apply different movement actions to the player object. Those actions are the same as the ones used by object events and are defined in src/event_object_movement.c and in src/data/object_events/movement_action_func_tables.h.

    If you look at event_object_movement.c, you can find the different MOVE_SPEED_ constants, and see how they're used in the functions of the different movement actions. You can change those functions to use different MOVE_SPEED_ constants to change the speeds of those actions, but that will also affect all NPCs and the animations for the actions might break.

    The speeds themselves are defined in terms of these step function lists that describe how the action moves the object over the 16 pixel-sized metatiles. As an example, the running speed MOVE_SPEED_FAST_1 (sStep2Funcs) moves the sprite for 8 frames in steps of 2 pixels. Knowing that, you can also modify the existing speeds or add new ones if needed.

    If as an example you wanted to make walking twice as fast as the Mach Bike without editing the speed at which NPCs move, you'd want the player's walking function to start a movement action that's twice as fast as the Mach Bike. Coincidentally the sliding movement is just that so you could just do:
    Diff:
     void PlayerWalkNormal(u8 direction)
     {
    -    PlayerSetAnimId(GetWalkNormalMovementAction(direction), COPY_MOVE_WALK);
    +    PlayerSetAnimId(GetSlideMovementAction(direction), COPY_MOVE_WALK);
     }
    View attachment 174449
    The sliding animation is perhaps not ideal so you might want to create a new movement action with the desired speed and animation and use that instead.
    That's exactly what I was looking for, thank you.

    I went down the route of changing the sStepFuncs for now. Currently I have sStep2Funcs set to move the sprite for 4 frames in steps of 4 pixels (which I think is the same as the Mach Bike), although I might change this later. This has worked as far as getting the desired speed but has broken the running animation

    I thought I might be able to fix the animation by editing object_event_anims.h and changing the length of the animation frames, but am not entirely clear on the logic. Do you have any idea how that works?
     
    Back
    Top