Fog of War
#18
Okay i must see this. :D

EDIT:
I tested Your code and yea it work better but still we have two problems:

1. I signalized you earlier:
   

Change in Game_Character method update_move to

Code:
  def update_move
    # Calling the original method
    wachunga_fow_gch_update_move
 
    if $game_map.fow
      if $game_map.fow_dynamic && (@x != @last_x || @y != @last_y) && self != $game_player
        # Let's assume that `$scene` is the scene of `Scene_Map` and `spriteset`
        if $scene.is_a?(Scene_Map) && $scene.spriteset
          # Checks if a character has entered or left the player's line of sight
          $scene.spriteset.update_event_transparency(self)
        end
      end
    end
 
    @last_x = @x
    @last_y = @y
  end


2. When player reveal fog then fps still drops but it is level up because in my project fps drops only then player move and reveal fog.

Change Class Game_Player < Game_Character to this

Code:
class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Frame Update (jump)
  #--------------------------------------------------------------------------
  def update_jump
    # Inherit original method statements from the Game_Character superclass
    super
   
    # Update fog of war when jump is completed and FOW is active
    if $game_map.fow && @jump_count == 0
      $game_map.update_fow_grid(@x, @y, $game_map.fow_player_range)
      $scene.spriteset.update_event_transparency if $game_map.fow_dynamic
      $scene.spriteset.update_fow_tilemap
    end
  end

  #--------------------------------------------------------------------------
  # * Frame Update (move)
  #--------------------------------------------------------------------------
  def update_move
    # Update fog of war if player moved to a new position and is not jumping
    if $game_map.fow && (@x != @last_fow_x || @y != @last_fow_y) && !jumping?
      $game_map.update_fow_grid(@x, @y, $game_map.fow_player_range)
      $scene.spriteset.update_event_transparency if $game_map.fow_dynamic
      $scene.spriteset.update_fow_tilemap
    end

    # Inherit original method statements from the Game_Character superclass
    super

    # Update last recorded FOW position
    @last_fow_x, @last_fow_y = @x, @y
  end
end
Reply }


Messages In This Thread
Fog of War - by Tepe - 11-05-2024, 12:42 AM
RE: Fog of War - by DerVVulfman - 11-05-2024, 05:06 PM
RE: Fog of War - by DerVVulfman - 11-05-2024, 06:15 PM
RE: Fog of War - by Tepe - 11-06-2024, 04:11 AM
RE: Fog of War - by Tepe - 11-06-2024, 02:49 PM
RE: Fog of War - by DerVVulfman - 11-09-2024, 08:21 PM
RE: Fog of War - by DerVVulfman - 11-12-2024, 01:13 AM
RE: Fog of War - by Tepe - 11-12-2024, 04:54 PM
RE: Fog of War - by DerVVulfman - 11-12-2024, 05:10 PM
RE: Fog of War - by Tepe - 11-12-2024, 05:58 PM
RE: Fog of War - by DerVVulfman - 11-12-2024, 08:58 PM
RE: Fog of War - by Tepe - 11-12-2024, 09:53 PM
RE: Fog of War - by DerVVulfman - 11-13-2024, 04:02 AM
RE: Fog of War - by Tepe - 11-14-2024, 01:27 AM
RE: Fog of War - by DerVVulfman - 11-14-2024, 02:19 AM
RE: Fog of War - by Tepe - 11-14-2024, 02:29 AM
RE: Fog of War - by DerVVulfman - Today, 01:57 AM
RE: Fog of War - by Tepe - 8 hours ago
RE: Fog of War - by DerVVulfman - 5 hours ago
RE: Fog of War - by Tepe - 2 hours ago



Users browsing this thread: 2 Guest(s)