@Galv
Please don't refer that script for ACE issues. The script was made for VX to detect a very specific set of circumstances which will lead to a crash. In ACE it can be used to help identify Sprites that weren't properly disposed, which is good practice, but in ACE there is also no evidence that this would be a memory leak (if the reference to the object is completely removed, GC seems to take care of them just fine). It definitely won't PREVENT a memory leak, in fact, its function is exactly the opposite, to keep the Sprites in memory indefinitely if their viewports were disposed and the sprite was not before, therefore, it actually CAUSES a memory leak (though localized only to that one run instance of the game) to prevent the crash so it can be logged and successfully debugged. This enforced leak has very little overhead (Sprite objects are very tiny, its the bitmaps that use up the memory) and the memory is reclaimed when the game is closed so its not a "true" memory leak and it can and does prevent crashes in VX, but it has never been shown to do anything for VX ACE in multiple test cases. As stated in the script thread, it's better to use the script to fix the errors that cause the crash, but most people seem to use it to stabilize their game instead of actually fixing anything permanently. Just using this script and not fixing things won't do anything for ACE. You may be on the right track about disposing things though, as this can be related to another problem (see below).
(If you have a test case where this issue DOES pop up in ACE and can be fixed by this script, I would love to hear about it, so please PM me)
@gecebd
Do you have any problems with "RGSS3 player STOPPED WORKING" in a project without custom scripts installed? Have you ever had problems with it crashing completely without an error message at all? What are the fault address, event name, and exception code for the error? Have you tried running with compatibility/as an administrator as Andar suggested? (and also tried turning off Steam completely if it is running AT ALL, and checking what else is running in the background such as aggressive antivirus software) What setting are you using for DEP (Data Execution Prevention) in Windows? If you are in OptIn (aka Whitelist, "Turn on DEP for all programs and services except those I select") mode, you may need to add the Game.exe to the exempt list.
If the issue is a specific script, I've found that this can be caused by exceeding the GDI (graphical device interface) object limit. This can occur if more than 10000 Bitmaps are loaded in a single instance. This can be tangentially associated with not properly disposing of sprites (some Sprites dispose their bitmaps when they dispose themselves) however, in general cases this is not enough to cause a crash. A handful of sprites not disposing on scene switch would take hours to reach the numbers required for instability, and also, GC does reclaim abandoned bitmaps even if they have not been disposed. If my script were logging enough to approach a crash level, the game would be unplayable due to amount of time taken up by file writes alone. If GDI limit is the issue, the culprit would likely be a script that creates a new bitmap every frame and abandons rather than disposes the old one, which can eventually outpace the GC, reach the limit, and crash. This may or may not be accompanied by the game experiencing jerking (occasional short pauses while having an otherwise steady framerate). The #1 culprit in this case would be using an old template project or old DLL from before the Erase Picture issue has been fixed. If you think this is happening, check the update_bitmap method (lines 39-41) in Sprite_Picture, if you see
def update_bitmap self.bitmap = Cache.picture(@picture.name) endReplace it with:
Code:
def update_bitmap if @picture.name.empty? self.bitmap = nil else self.bitmap = Cache.picture(@picture.name) end end
If none of that works or it still seems to be a script issue, I would love to take a look at your scripts.rvdata2 file. If the crash is reproducable, sharing your script with me may help others if I can identify what is causing the crash.EDIT: Actually, I'd like a copy of your scripts file either way. I've been searching for a test case where script files can cause a Game.exe crash so I can make a script to debug it like I did for VX.