设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 101|回复: 0

[转载发布] Hidden Game.exe Crash Debugger - Graphical Object Global Reference ACE

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9015

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58751
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68660

    灌水之王

    发表于 昨天 16:12 | 显示全部楼层 |阅读模式
    Graphical Object Global Reference VX ACE

    (game.exe crash debugger)​

    by Mithran​

    NOTICE: This is the VX ACE version of the script. For the VX Version go HERE

    Introduction
    Well, it looks like VX Ace isn't completely immune from this problem after all. The root cause appears to be the same, but there is at least one other factor in the ACE crash that is yet to be discovered. Fortunately, fixing the cause will stop the crash.

    The root cause of this error is not properly disposing of Sprites/Windows/Planes associated with a disposed viewport. There is no RGSS Player error message for this practice, but it can lead to Game.exe crashes. Script creators, please do your part and ensure you properly dispose your graphics objects, before they become an issue. This script can help you locate sprites you may have missed.

    You may be suffering from this error if you install a custom script then start getting intermittent crashes:
    "Game.exe has encountered a problem and needs to close"
    "RGSS3 Player has stopped working"

    This is one of the most frustrating errors to deal with in RPG Maker VX as it seems to come and go at random, only affecting certain people or setups, and the actual cause of the error is hidden to you.

    If your project is getting even occasional Game.exe crashes after installing a custom script, this may be worth a read. Please note that this script can only log and debug game.exe crashes having to do with a script problem. If you are crashing without custom scripts installed, the source of your crash is something else and this script will not help.

    This script addresses one specific issue that can cause an unhandled exception leading to an eventual Game.exe crash. The error is much rarer and harder to expose in VX Ace than VX, but I finally have confirmation that it is happening. This error is caused by a simple scripting mistake that would otherwise throw no error message, so it is at least worth a look.

    SpoilerAUTHOR'S NOTE: The following description primarily describes the VX (RGSS2)
    version of the crash. The VX ACE crash shares some circumstances with the VX
    crash. This script and instructions were written to address the VX issue then
    updated to work in VX ACE. This script itself may or may not stop crashes in ACE
    as it did with VX, but it can be used to log undisposed sprites and stop the
    error from happening in the first place.

    The cause of a given Game.exe crash could be any number of things - anything that
    doesn't create throw an error in Ruby, but causes an unhandled exception in one
    of the 'hidden' classes.

    After extensive testing, I was finally able to recreate the circumstances leading
    up to one such exception that, if left unhandled, could lead to Game.exe crash.

    1. A "GO" - Graphical Object (Sprite, Window, Plane, or Tilemap) is created
    2. The Graphical Object is assigned a Viewport
    3. The Viewport is disposed, but the sprite is not
    ?? - VX ACE Version. There is a yet unknown factor that also needs to happen.
    4. The Graphical Object is claimed by GC (garbage disposal)*

    * - Newly Discovered: attempting to dispose a sprite that has a disposed viewport
    will occasionally also crash. (v 1.1)
    Note that this particular crash only seems to occur if screen draws have taken
    place (any of the Graphics methods) between the time the viewport is disposed
    and the sprite disposal is attempted.

    Due to the way GC is implemented, you are unlikely to see an immediate effect
    when the situation comes up. It could be several scene changes down the line
    before the crash finally happens. To make matters worse, following the exact
    same course of action will yield completely different results, making it seem
    as though the crashes are random. In addition, there is yet another circumstance
    which I have still been unable to pinpoint, but I suspect has something to do
    with the order in which assets associated with the Graphical Object are claimed
    by the GC, or the amount of screen rewdraws that have taken place,
    that allows the GO to be cliamed without causing an exception and
    thus making it even harder to find.

    In essence: you could be suffering from an unstable game and not even know it.

    So that is where this little script comes in. This does the following:

    1. Creates a global variable backreference to every Graphical Object created.
    This prevents them from being marked by the GC so long as the reference exists,
    circumventing the final condition to cause this version of the crash.

    2. Removes reference to the Graphical Object once it has been disposed.
    This reallows the object to be marked by GC for disposal (once all other
    references are removed). Since the GO is disposed, condition 3 is no longer met
    and the object is deemed 'safe'.

    3. Report on potential issues to the user.
    This allows the user (given limited scripting knowledge) to identify potential
    errors and fix them outright.

    4. Prevents further Game.exe crashes caused by this specific issue.
    Includes a 'lazy' fix that cleans up offending Graphical Objects when the scene
    changes.*

    * v 1.1 'Lazy' fix has been superceeded to prevent crashes caused by disposal of
    these errant sprites. Lazy fix only works if debug criticial disposal has
    been disabled. Lazy mode is NOT recommended for ACE users.

    Version History:

    v 1.2 VX ACE
    Discovered possibility of crash in RGSS3. Thanks to Galv for bringing the
    problem to my attention and supplying a script to use as a test case.
    Updated logging features to specificially work with VX ACE. RGSS Console must
    be enabled to recieve live updates.
    Added GOBJ_ABRIDGED_LOG option.
    Altered some terms in the log. Specifically changed the term 'non-critical object'
    to 'Memory Leak' so the term 'Critical Object' can be easily searched in the log.
    Time in log now refers to creation time of the object, rather than time log was written.

    v 1.1
    Discovered a new condition for a Game.exe crash. Updated script to trap and log
    this error also.

    v 1.01-1.05
    Minor bugfixes, improved logging, added consideration for Plane objects viewport method error

    v 1.0
    Initial Release



    Features
    - Identifies and reports a prevalent, and generally very easy to fix, cause of Game.exe crashes.
    - Creates a global reference to every graphical object created until it is disposed to prevent the error from causing this specific Game.exe crash while it is running
     
    Script
    http://pastebin.com/DvuinNFU

    How to Use
    Install on its own script page in the materials section of the script editor above main and below default scripts. If using a script that creates sprites at startup (eg. Jets Mouse System), this script must come after it on the list.

    FAQ
    Q: Game.exe crashes for me constantly and this didn't help!
    A: As explained, this only prevents Game.exe crashes caused by the specific set of circumstances outlined. Crashes caused by memory faults or other errors may still remain, but if there is an in-game reason for it (read: crashes happen after x set of actions are taken with a fair degree of consistency, or across several computers) feel free to leave a post here.

    Q: I'm using a cracked version and..
    A: Support will not be given for non-official versions. Using a cracked version is also against the forum rules, among other things, and will get you banned.

    Q: I found another way to force a Game.exe crash in a seemingly stable game.
    A: I'd love to hear about it. Drop a post with the details.

    Credit and Thanks
    - Mithran (author)
    - Galv, for bringing this to my attention and being able to point me to an ACE script that can cause this crash

    Author's Notes
    For distribution, please link to this thread. May be used in any project, so long as the full header, credit, and instructions remains intact. As with all my debugging scripts, credit for the project as a whole is NOT required

    Bug Reporting
    If you encounter an error, please provide the complete error code as well as a short description on how to reproduce.

    Need Help?
    If you are logging errors in GOBJ.txt but unsure how to fix them, you may post here asking for help. In order for me to even look at your project, I will need at bare minimum a complete copy of your scripts.rvdata2 file (preferably the entire project) and the GOBJ.txt log file. I can't guarantee I will be able to look at every project immediately.

    If you are not logging any errors and continue to crash with my script installed (or crash without custom scripts), please explore other possibilities of the crash before posting in this thread.


    本贴来自国际rpgmaker官方论坛作者:Mithran处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/hidden-game-exe-crash-debugger-graphical-object-global-reference-ace.17400/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-4 17:32 , Processed in 0.066169 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表