Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Why do RPG Maker files take such a long time to boot up?

Mechz

Member

When I boot any RMXP or RMVX executable file, I get a lengthy black screen before I get any content.

At first I thought it was because the game was 'loading a lot of data', but I've done a little experiment to test that.

I stripped the program down to the bare components needed to pull up a the title screen (I'm not that good at scripting, so there was probably an easier way of just loading a bitmap in the window):

Code:
module Cache
  def self.system(filename)
    load_bitmap("Graphics/System/", filename)
  end
def self.load_bitmap(folder_name, filename, hue = 0)
    @cache = {} if @cache == nil
    path = folder_name + filename
    if not @cache.include?(path) or @cache[path].disposed?
      if filename.empty?
        @cache[path] = Bitmap.new(32, 32)
      else
        @cache[path] = Bitmap.new(path)
      end
    end
    if hue == 0
      return @cache[path]
    else
      key = [path, hue]
      if not @cache.include?(key) or @cache[key].disposed?
        @cache[key] = @cache[path].clone
        @cache[key].hue_change(hue)
      end
      return @cache[key]
    end
  end
end
Code:
class Scene_Base
  def main
    start
    perform_transition
    post_start
    Input.update
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.update
    pre_terminate
    Graphics.freeze
    terminate
  end
def start
  end
  def perform_transition
    Graphics.transition(10)
  end
  def post_start
  end
  def update
  end
  def pre_terminate
  end
  def terminate
  end
  def snapshot_for_background
    $game_temp.background_bitmap.dispose
    $game_temp.background_bitmap = Graphics.snap_to_bitmap
    $game_temp.background_bitmap.blur
  end
  def create_menu_background
    @menuback_sprite = Sprite.new
    @menuback_sprite.bitmap = $game_temp.background_bitmap
    @menuback_sprite.color.set(16, 16, 16, 128)
    update_menu_background
  end
  def dispose_menu_background
    @menuback_sprite.dispose
  end
  def update_menu_background
  end
end
Code:
class Scene_Title < Scene_Base
  def start
    super
    load_database
    create_title_graphic
  end
  
  
  
  def perform_transition
    Graphics.transition(20)
  end
  
  
  def load_database
    $data_system        = load_data("Data/System.rvdata")
  end
  
  
  def create_title_graphic
    @sprite = Sprite.new
    @sprite.bitmap = Cache.system("Title")
  end
  
end
Code:
begin
  Graphics.freeze
  $scene = Scene_Title.new
  $scene.main while $scene != nil
  Graphics.transition(30)
end

I wasn't sure how to code the Scene_Base from scratch, so I just copy/pasted it from the original script list.


WHY is there so much lag? Guild Wars, GunZ, Half Life 2, Emulators, or any software really, loads instantly for me. Is there a way around this?

Also note that I get approximately the same speed when compiling the data in the editor, when running the .exe, and when running it from an "encrypted archive".
 

khmp

Sponsor

If you look at the requirements for either RMXP or RMVX you'll notice one very important thing missing that is on all those games you listed. Graphic Card. RMXP and RMVX are both software rendered and running on interpreted "line by line" script code. Where as Guild Wars is just terrible, ;), actually Guild Wars is compiled code C/C++ executable that uses hardware acceleration. It will run faster. Think of it this way, and I'm going to use shopping carts in this analogy. With a compiled code executable that utilizes components other than just the processor its like pushing one shopping cart with all the wheels working together. With RMXP/VX its like pushing four together at one time. And the furthest one wants to steer right all the time. Them's the breaks with RMXP/VX.

Encrypting doesn't compile the code. In fact for the longest time I thought the script code was compiled just before it ran. :lol:

I hope that clears things up for you.

Good luck with it Mechz! :thumb:
 

Mechz

Member

Oi, I think I understood what you said (wow, I feel like a failure); You're saying that RM was built to run primarily on the CPU, while games like Guild Wars are optimized to take advantage of chipsets and vcards?
 

khmp

Sponsor

Mechz":1jogj4v2 said:
Oi, I think I understood what you said (wow, I feel like a failure); You're saying that RM was built to run primarily on the CPU, while games like Guild Wars are optimized to take advantage of chipsets and vcards?

Precisely, RM is purely processor driven. And don't feel bad about it. I used to have the same misconceptions about RMXP/VX. Most likely I still do. I just hope that no one takes notice :). Also the code for the commercial games gets compiled into Machine Assembly. So its spoon feeding the processor what to do. Where as with scripting the lines of code must first be interpreted into something the processor can handle. This also adds to the latency it takes for instructions to be executed. I hope that helps.

Good luck with it Mechz! :thumb:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top