Open OliveIsAWord opened 10 months ago
FYI I think these stuff were generated automatically by gm from Drag and Drop code. Due to the excessive use of action_ functions
I'd like to mark this as won't fix on account of it being an accurate decompilation that is necessary for a 1:1 rewrite. Any attempt at optimizing out empty drag'n'drop should be made optional if possible, IMO.
Which component should be improved?
Decompiler
Describe your feature suggestion in more detail
I found this tool when trying to extract assets from Fazbear Entertainment: Storage and was impressed with the capabilities of the decompilation tool. However, the decompiled code was filled with dead code such as empty
if
blocks, redundantwith
blocks, and values assigned to a temporary variable before being immediately read once and then forgotten. This becomes a major problem for larger Codes, both in decompilation performance and readability of the decompiled code.In the Code
gml_Object_Obj_tbmover_Alarm_1
(which controls Toy Bonnie's movement), the disassembly contains 1263 SLoC, but the decompilation takes multiple seconds and produces over 280,000 (!!) SLoC, many sections of which are indented so far that the lines wrap around the editor. I suspect that most of this indentation and perhaps a majority of these lines could be removed without major overhauls or major feature additions to decompilation.As a shorter example, the Code
gml_Object_Obj_MenuBG_Alarm_1
currently decompiles to this:If the dead code mentioned above could be algorithmically removed, this snippet might instead decompile to this much nicer code:
It's entirely possible that I'm missing obvious code refactors, or any of my suggested refactors are incorrect; this tool has been my near only exposure to GML.