Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Underanalyzer compiler integration #2056

Open
wants to merge 11 commits into
base: underanalyzer
Choose a base branch
from

Conversation

colinator27
Copy link
Member

Description

Integrates the new compiler from Underanalyzer into UndertaleModTool. In doing so, new code compiling and importing APIs have been added to the library, and a lot of related legacy or dead code has been removed. The new compiler should support everything the old one supported, plus proper support for additional GMLv2 (GameMaker 2.3+) language features that have been missing for years. This allows many more game scripts in recent games to be easily modded.

Caveats

  • High likelihood of bugs, although the common case seems to work pretty well so far.
  • Some code generation isn't exactly identical in every GameMaker version; to see statistics on this for a particular game, run CheckDecompiler.csx, which will recompile every script in a game, measuring accuracy of (de)compilation. Usually, as long as the code decompiles to the same source code after compilation, it'll work fine.
  • Certain GML language features are not yet supported in the compiler, such as accessors and array owners. Also, some other buggy/esoteric behavior is not exactly mimicked.
  • Newly-defined functions in GML code will now throw a linking error if they can't be found somewhere in the game already (and if they aren't a known built-in function to UTMT). This is easily mitigated by adding the function to the functions list before compiling.
  • Some scripts such as ImportCode.csx may function a bit differently, and they can no longer automatically create collision events on objects if they don't exist (which previously could require prompting the user). In general, all code importing scripts will now create objects automatically, without user input. (Also, the CLI can now create scripts/objects/etc., and will now prompt you for collision events, specifically.) Looking for any feedback on this change, and whether any of the old behavior needs restoring.
  • The scripting interface has had many functions removed, which is a massive compatibility break.

Notes

This should get some good testing before being merged into the main underanalyzer branch, before that branch itself eventually gets merged into the main tool.

Copy link

github-actions bot commented Mar 8, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant