Hidden Game.exe Crash Debugger - Graphical Object Global Reference ACE

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Mithran, Aug 26, 2013.

  1. tiagoms

    tiagoms Veteran Veteran

    Messages:
    181
    Likes Received:
    4
    Hello, here I am also suffering from the problem of "Game.exe crash". I would be very happy to help me.

    Follows the gobj.txt attached (started over once the game) and Scripts.rvdata2.

    Since now, thank you for your attention =) (yes. .. I'm using google translator because my English is too fragmented)

    gobj.txt

    Scripts.rar
     

    Attached Files:

    #41
  2. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    Here are the fixes. Install below the original scripts.

    Code:
    # Fix for Mode 7class Spriteset_Map  alias dispose_tilemap_b4mode7 dispose_tilemap  def dispose_tilemap    @tilemap_mode7.dispose if @tilemap_mode7    @tilemap_classic ? @tilemap_classic.dispose : @tilemap.dispose  endend# Fix for Max Resolution Breakerclass Plane  # credit: Kaelan  alias :th_unlimited_resolution_dispose :dispose  def dispose    th_unlimited_resolution_dispose    @sprite.dispose if @sprite    @sprite = nil  endend# Fix for battle Engine Symphonyclass Scene_Battle    alias dispose_spriteset_mith_yamisymphonyfix dispose_spriteset  def dispose_spriteset    dispose_spriteset_mith_yamisymphonyfix     all_battle_members.each { |bat| bat.clear_icons }  endend
    The resolution breaker was previously posted so it should work. I have no way to test the other ones without all the files so let me know if there is a problem.
     
    #42
  3. tiagoms

    tiagoms Veteran Veteran

    Messages:
    181
    Likes Received:
    4
    What the solution for my case?
    Search the links of the sites of scripters and post here? or upload the complete project? or have patience?

    Sorry, i am lost LoL.

    This case, I'm not used the google translator. congratulations for me :)

    ps- Thank you for your attention again :D
     
    #43
  4. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    Use these fixes:

    # Fix for Mode 7class Spriteset_Map alias dispose_tilemap_b4mode7 dispose_tilemap def dispose_tilemap @tilemap_mode7.dispose if @tilemap_mode7 @tilemap_classic ? @tilemap_classic.dispose : @tilemap.dispose endend# Fix for Max Resolution Breakerclass Plane # credit: Kaelan alias :th_unlimited_resolution_dispose :dispose def dispose th_unlimited_resolution_dispose @sprite.dispose if @sprite @sprite = nil endend# Fix for battle Engine Symphonyclass Scene_Battle alias dispose_spriteset_mith_yamisymphonyfix dispose_spriteset def dispose_spriteset dispose_spriteset_mith_yamisymphonyfix all_battle_members.each { |bat| bat.clear_icons } endend
    Copy the code to a new script page below the other scripts. The patches need to be lower on the list than the script they modify. If it does not work, let me know of the new errors.
     
    #44
    Chaos17 likes this.
  5. tiagoms

    tiagoms Veteran Veteran

    Messages:
    181
    Likes Received:
    4
    its correct? The problem remains.
    ps- Yes, I add other scripts (is necessary) :)

    gobj.txt

    Scripts.rar
     

    Attached Files:

    #45
  6. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,362
    Likes Received:
    4,926
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    I just found another critical object for YEA - Battle Engine.
    It seems, Yanfly never consider if his popup never remain undisposed for certain cases. It's true that he update the popups and dispose it once the opacity reaches zero. But what if I switched the scene without wait for those the popups are being disposed? (e.g, to Scene_Gameover)
     
    Here is the small part of YEA Battle Engine

    Code:
    class Sprite_Battler < Sprite_Base    #--------------------------------------------------------------------------  # public instance variables  #--------------------------------------------------------------------------  attr_accessor :effect_type  attr_accessor :battler_visible  attr_accessor :popups    #--------------------------------------------------------------------------  # alias method: initialize  #--------------------------------------------------------------------------  alias sprite_battler_initialize_abe initialize  def initialize(viewport, battler = nil)    sprite_battler_initialize_abe(viewport, battler)    @popups = []    @popup_flags = []  end    #--------------------------------------------------------------------------  # alias method: update_bitmap  #--------------------------------------------------------------------------  alias sprite_battler_update_bitmap_abe update_bitmap  def update_bitmap    return if @battler.actor? && @battler.battler_name == ""    sprite_battler_update_bitmap_abe  end    #--------------------------------------------------------------------------  # alias method: setup_new_animation  #--------------------------------------------------------------------------  unless $imported["YEA-CoreEngine"]  alias sprite_battler_setup_new_animation_abe setup_new_animation  def setup_new_animation    sprite_battler_setup_new_animation_abe    return if @battler.pseudo_ani_id <= 0    animation = $data_animations[@battler.pseudo_ani_id]    mirror = @battler.animation_mirror    start_pseudo_animation(animation, mirror)    @battler.pseudo_ani_id = 0  end  end # $imported["YEA-CoreEngine"]    #--------------------------------------------------------------------------  # alias method: setup_new_effect  #--------------------------------------------------------------------------  alias sprite_battler_setup_new_effect_abe setup_new_effect  def setup_new_effect    sprite_battler_setup_new_effect_abe    setup_popups  end    #--------------------------------------------------------------------------  # new method: setup_popups  #--------------------------------------------------------------------------  def setup_popups    return unless @battler.use_sprite?    @battler.popups = [] if @battler.popups.nil?    return if @battler.popups == []    array = @battler.popups.shift    create_new_popup(array[0], array[1], array[2])  end    #--------------------------------------------------------------------------  # new method: create_new_popup  #--------------------------------------------------------------------------  def create_new_popup(value, rules, flags)    return if @battler == nil    return if flags & @popup_flags != []    array = YEA::BATTLE::POPUP_RULES[rules]    for popup in @popups      popup.y -= 24    end    return unless SceneManager.scene.is_a?(Scene_Battle)    return if SceneManager.scene.spriteset.nil?    view = SceneManager.scene.spriteset.viewportPopups    new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)    @popups.push(new_popup)    @popup_flags.push("weakness") if flags.include?("weakness")    @popup_flags.push("resistant") if flags.include?("resistant")    @popup_flags.push("immune") if flags.include?("immune")    @popup_flags.push("absorbed") if flags.include?("absorbed")  end    #--------------------------------------------------------------------------  # alias method: update_effect  #--------------------------------------------------------------------------  alias sprite_battler_update_effect_abe update_effect  def update_effect    sprite_battler_update_effect_abe    update_popups  end    #--------------------------------------------------------------------------  # new method: update_popups  #--------------------------------------------------------------------------  def update_popups    for popup in @popups      popup.update      next unless popup.opacity <= 0      popup.bitmap.dispose      popup.dispose      @popups.delete(popup)      popup = nil    end    @popup_flags = [] if @popups == [] && @popup_flags != []    return unless SceneManager.scene_is?(Scene_Battle)    if @current_active_battler != SceneManager.scene.subject      @current_active_battler = SceneManager.scene.subject      @popup_flags = []    end  end  end # Sprite_Battler 
    Here is the gobj.txt
    Code:
    Time: 2014-05-19 19:30:22 +0700CRITICAL OBJECT #<Sprite_Popup:0x8ffdbe4>In Scene Scene_BattleCreation Stack:: Script 0126 -- YEA - Battle Engine+, Line: 881:in `create_new_popup'Script 0126 -- YEA - Battle Engine+, Line: 865:in `setup_popups'Script 0126 -- YEA - Battle Engine+, Line: 854:in `setup_new_effect'Script 0045 -- Sprite_Battler, Line: 42:in `update'Script 0130 -- YEA - Enemy HP bar+, Line: 225:in `update'Script 0193 -- Implementation v1.3, Line: 2724:in `update'Script 0198 -- Addon - TSBS cursor, Line: 187:in `update'Script 0199 -- Addon - Multiple Animation, Line: 148:in `update'Script 0050 -- Spriteset_Battle, Line: 333:in `block in update_enemies'Script 0050 -- Spriteset_Battle, Line: 333:in `each'Script 0050 -- Spriteset_Battle, Line: 333:in `update_enemies'Script 0050 -- Spriteset_Battle, Line: 311:in `update'Script 0193 -- Implementation v1.3, Line: 3517:in `update'Script 0117 -- Scene_Battle, Line: 59:in `update_basic'Script 0126 -- YEA - Battle Engine+, Line: 2579:in `update_basic'Script 0193 -- Implementation v1.3, Line: 3623:in `update_basic'Script 0117 -- Scene_Battle, Line: 67:in `update_for_wait'Script 0193 -- Implementation v1.3, Line: 3642:in `wait_for_sequence'Script 0193 -- Implementation v1.3, Line: 370:in `judge_win_loss'Script 0126 -- YEA - Battle Engine+, Line: 3075:in `process_action_end'Script 0117 -- Scene_Battle, Line: 554:in `process_action'Script 0117 -- Scene_Battle, Line: 48:in `update'Script 0100 -- Scene_Base, Line: 14:in `main'Script 0121 -- Mithran - Graphics Obj Ref, Line: 229:in `main'Script 0006 -- SceneManager, Line: 23:in `run'Script 0224 -- Main, Line: 7:in `block in <main>':1:in `block in rgss_main':1:in `loop':1:in `rgss_main'Script 0224 -- Main, Line: 7:in `<main>'ruby:in `eval' 
    And here is my fix
    Code:
    class Sprite_Battler  alias yea_popup_dispose dispose  def dispose    yea_popup_dispose    @popups.each do |pop|      pop.dispose    end  endend 
    Or should I make topic instead?
     
    #46
    Chaos17 likes this.
  7. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    @tiagoms - Upload a full project and private message me the link so I can look at it myself.


    @TheoAllen - Thank you. This topic is fine, I like all fixes to be posted here for easy reference and searching. The fix you posted should work, since the popups are linked to the battler sprite and the battler sprite is disposed without fail (or else that would be showing up on the log too). I remember fixing a similar error in the VX version of Yanfly battle system.
     
    #47
    tiagoms likes this.
  8. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,362
    Likes Received:
    4,926
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Question!
    Is it fine to store the graphical objects in Game_Temp? Because this scripts tends to print out when the scene changed. And according to my observation, Game.exe would begin to crash if there is no variable which reference to graphical objects, yet it's not already disposed. 

    One of example reason in, as you know, Window_Base have "convert_escape_character" method. Rather than copying it to another class, I would like to create Window_Base in Game_Temp and hidden it. So I could use the method and provide more compatibility
     
    #48
  9. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    Yes, the crash will only happen on garbage collection, so if you have any kind of global permanent reference to the window, it will be fine. Also, the "dangerous" objects are the ones with disposed Viewports, objects without an associated Viewport have never been shown to crash but they are a bit more leaky on GC. There is no way to hook actual garbage collection (unless it has already taken place) so the script simply checks when the scene switches, because by standard VX Ace design, that is when all windows and sprites should have been disposed. You should also know that one window probably won't hurt in this regard, but the length of time it takes to access the metadata of any graphical object increases as you have more of them in memory (which is also the reason this script slows things down when it traps a bunch of sprites - they are kept in memory on purpose); therefore, this technique should be used sparingly. This is highly preferable to creating a new window every time you just need to use this one function and orphaning or disposing it every time you need to use a function externally, though (say, for formatting text before drawing to a Sprite), since this function uses no data from the actual instance. I'd use a class variable or module instance variable and wrap a method around it to store the window instead of $game_temp, that way, you can have your "global" convert_escape_characters function to be accessed through Mod.convert_escape_characters instead of $game_temp.window.convert_escape_characters.


    The window will continue to trigger a false positive while using this script, but that can be avoided by using "window.gobj_exempt if $gobj" on it after creation so my script will stop tracking it. (the global conditional is a crude check to see if the debug script is installed, to allow it to be easily removed after debugging without having to alter your script)
     
    #49
    TheoAllen likes this.
  10. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,362
    Likes Received:
    4,926
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    I see. Thanks for answers. Then, I'd like to recreate it all over again instead of store it in constant / class variable. Because, if I remember correctly, storing graphical object in constant tends to trigger crash when you press the F12 reset button. They're not created inside rgss_main {}

    CMIIW ~
     
    Last edited by a moderator: May 26, 2014
    #50
  11. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    This is because part of the reset protocol is to invoke Graphics.__reset__ which disposes all sprites and bitmaps in memory (this can actually trigger a Game.exe crash if sprites with disposed viewports were still present), but does not actually clear all variables, so you are left with variables containing disposed objects. If you attempt to access the metadata of the freed object, you'll throw a RGSSError. This is why you don't create it in a constant, because the constant sticks around but the window is freed on reset, but conditionally as module instance variable or class variable, so you can recreate it if need be.

    module TextFuncts @@window = nil # init when first called def self.window if @@window.nil? || @@window.disposed? @@window = Window_Base.new(0, 0, 32, 32).hide @@window.gobj_exempt if $gobj end @@window end def self.convert_escape_characters(text) window.convert_escape_characters(text) end # add more explicitly, or iterate Window_Base's instance methods to add them, or just add a method_missing and forward the calls to the window end
    Not that it would matter in this case, because convert_escape_characters does not touch any of the Window's metadata. Even if you were using a disposed window, the method would return just fine. But just in case you do need the windows metadata (eg., the windowskin, for color layouts), the above would work.
     
    #51
    TheoAllen likes this.
  12. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,362
    Likes Received:
    4,926
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    That is clear now. Thanks for the bunch of explanations :D
     
    #52
  13. Darien Shields

    Darien Shields Villager Member

    Messages:
    11
    Likes Received:
    1
    First Language:
    English
    I would very much appreciate help. The script seems to stop my game from crashing, but obviously I'd prefer to fix the source of the bug. I installed new scripts recently, but also modified some existing ones.

    I've included gobj and my scripts file.

    gobj.txt

    Scripts.rar
     

    Attached Files:

    #53
  14. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    @Darien Shields:

    @charset_shadow within battler sprites in Yami Engine Symphony - Battle Symphony is not getting disposed.

    Add this:

    Code:
    class Sprite_Batter  alias dispose_sprite_charset_shadow_fix dispose  def dispose    @charset_shadow.dispose if @charset_shadow    dispose_sprite_charset_shadow_fix   endend
    When I looked at the log file, I just saw that error repeating over and over. This was fixed in the latest version of Symphony.
     
    #54
    Darien Shields likes this.
  15. Darien Shields

    Darien Shields Villager Member

    Messages:
    11
    Likes Received:
    1
    First Language:
    English
    Thanks so much. I thought it might be an out of date version of Symphony, but since I had recently made a lot of scripting changes and been using Symphony without issue for months... well, I guess that's the nature of this bug D:

    Thanks for all your help. You and this script are real lifesavers.
     
    #55
  16. Rose Guardian

    Rose Guardian Veteran Veteran

    Messages:
    351
    Likes Received:
    63
    Location:
    USA Michigan
    First Language:
    English
    Sorry to bother you but I am using this script and I still get the RGSS Player Stopped Working Error sometimes when I exit my game.

    Here is my godj file:

    gobj.txt

    If you need the scripts or my project as well let me know and I'll pm you the project if you need it.
     

    Attached Files:

    • gobj.txt
      File size:
      321 bytes
      Views:
      6
    #56
  17. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    #57
  18. Jericho Swain

    Jericho Swain Noxus Tyrant Veteran

    Messages:
    91
    Likes Received:
    18
    First Language:
    English
    Ok I have this issue where the gobj.txt is not showing up....or idk where to find it >.<
     
    #58
  19. Mithran

    Mithran Global Moderators Global Mod

    Messages:
    404
    Likes Received:
    212
    First Language:
    English
    In the game's base folder, the same one as the game.rvproj and game.exe files. If one isn't present, make sure logging is on (it is by default), and that you switch scenes so that it will actually log something (eg., enter/exit battle, enter the menu, etc). Check "show console" in the game window, turn on the NOTIFY options in the script. If you are getting messages there and logging is on, you should be getting a log file. It could be in another location due to a script changing the working directory, but not likely. If you aren't getting any console messages with notifications on, then the script isn't finding any errors. There is always the possibility that your Game.exe crashes are related to another issue.
     
    #59
  20. tiagoms

    tiagoms Veteran Veteran

    Messages:
    181
    Likes Received:
    4
    Sorry not to have posted the entire file yet.

    I am adding new scripts (and removing others).  :D
     
    #60

Share This Page