Multiple Parallax Lag Reduction

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,268
Reaction score
1,422
First Language
English
Primarily Uses
RMXP
I was thinking of a loading screen when you start up the game.

The situation may be that you are missing an issue in your script. Without the concrete script we can guess and try to help you with the problem solving.

These bitmaps, do you change them at any point?
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
The script simply allows for unlimited parallax's to be displayed. the code is fairly simple. Just creates a plane that shows an image and loops it.

I should possibly mention that I have created a new game object (wrapper array) called $D13x_FOG, this is connected to a class created to store the required data from each fog setup within the customization of the script.

The script itself works fine, its just a small decrease in lag when the screen is shown.

I have provided the main parts that create the image(s)below:

Code:
#==============================================================================class Plane_FOG < Plane #==============================================================================  #-----------------------------------------------------------------------------  # Initialize  #-----------------------------------------------------------------------------  def initialize(fog_id)    return unless fog_id != nil    return if $BTEST    super(nil)    @id = fog_id    name = $D13x_FOG[@id].name    self.bitmap = Cache.dfog(name,0)    initialize_values    update  end    #-----------------------------------------------------------------------------  # Initialize Values  #-----------------------------------------------------------------------------  def initialize_values    self.z       = $D13x_FOG[@id].authority    self.opacity = 0  end  #-----------------------------------------------------------------------------  # Update  #-----------------------------------------------------------------------------  def update    return if self.disposed?    self.opacity = $D13x_FOG[@id].opacity    get_position_update  end  #-----------------------------------------------------------------------------  # Get Position Update  #-----------------------------------------------------------------------------  def get_position_update    self.ox = $D13x_FOG[@id].x * 32 + $D13x_FOG[@id].x_move    self.oy = $D13x_FOG[@id].y * 32 + $D13x_FOG[@id].y_move  end      #-----------------------------------------------------------------------------  # Dispose  #-----------------------------------------------------------------------------#  def dispose#    super#  end    end #==============================================================================module Planeset_FOG#==============================================================================  #-----------------------------------------------------------------------------  # Create Fog  #-----------------------------------------------------------------------------  def create_fog    @fog_size = Deki_FOG::Setup.size    @fog = []     create_fogs  end  #-----------------------------------------------------------------------------  # Create Fogs  #-----------------------------------------------------------------------------  def create_fogs    return unless $game_map.has_fog    @fog_size.times do |i|      @fog[i] = nil      @fog[i] = Plane_FOG.new(i) if $D13x_FOG[i].active #,:type_a)    end  end  #-----------------------------------------------------------------------------  # Dispose Fogs  #-----------------------------------------------------------------------------  def dispose_fog    @fog_size.times do |i|      next unless @fog[i] != nil        @fog[i].dispose        @fog[i] = nil    end  end  #-----------------------------------------------------------------------------  # Update Fogs  #-----------------------------------------------------------------------------  def update_fog    @fog_size.times do |i|#      next unless @fog[i] #!= nil      if $game_map.has_fog        if $D13x_FOG[i].active          @fog[i] = Plane_FOG.new(i) if @fog[i] == nil          $D13x_FOG[i].increase_opacity          @fog[i].update if (@fog[i] != nil)        else          $D13x_FOG[i].decrease_opacity# -= 1          @fog[i].update if (@fog[i] != nil)          if ($D13x_FOG[i].opacity <= 0) && (@fog[i] != nil)            @fog[i].dispose            @fog[i] = nil          end        end      else        if (@fog[i] != nil)          @fog[i].dispose           @fog[i] = nil        end      end    end  end end #==============================================================================class Spriteset_Map#==============================================================================  #-----------------------------------------------------------------------------  # Included Modules  #-----------------------------------------------------------------------------  include Planeset_FOG  #-----------------------------------------------------------------------------  # Alias List  #-----------------------------------------------------------------------------  alias :initializefogg :initialize  alias :disposefogg    :dispose  alias :updatefogg     :update  #-----------------------------------------------------------------------------  # Initialize  #-----------------------------------------------------------------------------  def initialize    create_fog    initializefogg  end  #-----------------------------------------------------------------------------  # Dispose  #-----------------------------------------------------------------------------  def dispose    disposefogg    dispose_fog  end  #-----------------------------------------------------------------------------  # Update  #-----------------------------------------------------------------------------  def update    updatefogg    update_fog  end   end 
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top