• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!

[SOLVED][Pokemon Essentials v21.1] Player Movement

SARGØN

Novice
Member
Joined
May 29, 2023
Posts
10
Hi, I recently switched from Pokemon Essentials v20.1 to v21.1.
I've noticed a change with player movement/animation against obstacles.

In v20.1, movement against obstacles was fluid, moving forward while bumping into walls without losing fluidity.
Here's an example video:

[Pokemon Essentials v20.1] PLAYER MOVEMENT

However, in v21.1, I've noticed that the character completely loses that fluidity when colliding with walls. When moving in a straight line and colliding with a wall, the character remains stuck until the animation of moving toward the wall is completely completed and the "player_bump" is played.
Here's an example video:

[Pokemon Essentials v21.1] PLAYER MOVEMENT

This could be a problem on certain narrow indoor maps where a certain fluidity of movement is required, such as the Sky Pillar in Pokemon Emerald:

pokemon-emerald-1027-small.webp


I don't know if this is due to:
  • Some kind of Player Movement refactoring
  • Movement animation management + DeltaTime
  • Anything else I'm not familiar with.

Honestly, I'd like to be able to regain the fluidity of movement against obstacles from v20.1.
I hope someone can enlighten me on this issue and where I should touch so I don't break anything new.

Thank you very much.
 
Since this post took almost a week to be published (waiting for approval), I even had time to find the answer myself xd...

For those who might be interested, I did some more testing and realized that this problem DOES NOT occur when you WALK, ONLY when you RUN into a wall.

That's why, reviewing the code, I saw these two running functions:

[POKÉMON ESSENTIALS v20.1] RUNNING FUNCTIONS | can_run() & set_movement_type():
Ruby:
Expand Collapse Copy
class Game_Player < Game_Character
  def can_run?
    return @move_speed > 3 if @move_route_forcing
    return false if $game_temp.in_menu || $game_temp.in_battle ||
                    $game_temp.message_window_showing || pbMapInterpreterRunning?
    return false if !$player.has_running_shoes && !$PokemonGlobal.diving &&
                    !$PokemonGlobal.surfing && !$PokemonGlobal.bicycle
    return false if jumping?
    return false if pbTerrainTag.must_walk
    return ($PokemonSystem.runstyle == 1) ^ Input.press?(Input::BACK)
  end

  def set_movement_type(type)
    meta = GameData::PlayerMetadata.get($player&.character_ID || 1)
    new_charset = nil
    case type
    when :fishing
      new_charset = pbGetPlayerCharset(meta.fish_charset)
    when :surf_fishing
      new_charset = pbGetPlayerCharset(meta.surf_fish_charset)
    when :diving, :diving_fast, :diving_jumping, :diving_stopped
      self.move_speed = 3
      new_charset = pbGetPlayerCharset(meta.dive_charset)
    when :surfing, :surfing_fast, :surfing_jumping, :surfing_stopped
      self.move_speed = (type == :surfing_jumping) ? 3 : 4
      new_charset = pbGetPlayerCharset(meta.surf_charset)
    when :cycling, :cycling_fast, :cycling_jumping, :cycling_stopped
      self.move_speed = (type == :cycling_jumping) ? 3 : 5
      new_charset = pbGetPlayerCharset(meta.cycle_charset)
    when :running
      self.move_speed = 4
      new_charset = pbGetPlayerCharset(meta.run_charset)
    when :ice_sliding
      self.move_speed = 4
      new_charset = pbGetPlayerCharset(meta.walk_charset)
    else   # :walking, :jumping, :walking_stopped
      self.move_speed = 3
      new_charset = pbGetPlayerCharset(meta.walk_charset)
    end
    @character_name = new_charset if new_charset
  end
end

However, in v21.1, I saw that there are 2 additional lines:
return false if @bumping # CAN'T RUN
self.move_speed = 3 if @bumping # LOWERS SPEED

[POKÉMON ESSENTIALS v21.1] RUNNING FUNCTIONS | can_run() & set_movement_type():
Ruby:
Expand Collapse Copy
class Game_Player < Game_Character
  def can_run?
    return @move_speed > 3 if @move_route_forcing
    return false if @bumping   # <===================================================== CAN'T RUN
    return false if $game_temp.in_menu || $game_temp.in_battle ||
                    $game_temp.message_window_showing || pbMapInterpreterRunning?
    return false if !$player.has_running_shoes && !$PokemonGlobal.diving &&
                    !$PokemonGlobal.surfing && !$PokemonGlobal.bicycle
    return false if jumping?
    return false if pbTerrainTag.must_walk
    return ($PokemonSystem.runstyle == 1) ^ Input.press?(Input::BACK)
  end

  def set_movement_type(type)
    meta = GameData::PlayerMetadata.get($player&.character_ID || 1)
    new_charset = nil
    case type
    when :fishing
      new_charset = pbGetPlayerCharset(meta.fish_charset)
    when :surf_fishing
      new_charset = pbGetPlayerCharset(meta.surf_fish_charset)
    when :diving, :diving_fast, :diving_jumping, :diving_stopped
      self.move_speed = 3 if !@move_route_forcing
      new_charset = pbGetPlayerCharset(meta.dive_charset)
    when :surfing, :surfing_fast, :surfing_jumping, :surfing_stopped
      if !@move_route_forcing
        self.move_speed = (type == :surfing_jumping) ? 3 : 4
      end
      new_charset = pbGetPlayerCharset(meta.surf_charset)
    when :descending_waterfall, :ascending_waterfall
      self.move_speed = 2 if !@move_route_forcing
      new_charset = pbGetPlayerCharset(meta.surf_charset)
    when :cycling, :cycling_fast, :cycling_jumping, :cycling_stopped
      if !@move_route_forcing
        self.move_speed = (type == :cycling_jumping) ? 3 : 5
      end
      new_charset = pbGetPlayerCharset(meta.cycle_charset)
    when :running
      self.move_speed = 4 if !@move_route_forcing
      new_charset = pbGetPlayerCharset(meta.run_charset)
    when :ice_sliding
      self.move_speed = 4 if !@move_route_forcing
      new_charset = pbGetPlayerCharset(meta.walk_charset)
    else   # :walking, :jumping, :walking_stopped
      self.move_speed = 3 if !@move_route_forcing
      new_charset = pbGetPlayerCharset(meta.walk_charset)
    end
    self.move_speed = 3 if @bumping   # <===================================================== LOWERS SPEED
    @character_name = new_charset if new_charset
  end
end

Not to be ungrateful, but I'm personally going to comment these two lines of code, as I think it could hinder the player's experience, hindering its fluidity and even diminishing certain mechanics that may be included in the development.
 
Last edited:
Back
Top