UndertaleModTool icon indicating copy to clipboard operation
UndertaleModTool copied to clipboard

Known 2.3 Compilation/Decompilation Errors

Open Jacky720 opened this issue 4 years ago • 1 comments

This is a list of errors I have thus far encountered when reviewing compilation for Deltarune Chapter 1&2.

Crashes:

  • [ ] Assignment to variables which share names with scripts (gml_Object_obj_CHAPTER_SELECT_Create_0)
  • [ ] Local function recognition (gml_Object_obj_darkfountain_Draw_0)
  • [ ] Something with decompilation of a local assignment yields var a += (gml_Object_obj_queen_bulletcontroller_Step_0)
  • [x] 8bf886fa50b6d3843a177f7b885d0ba7e229e79f buffer_get_surface now should accept fewer arguments (gml_Object_obj_shapepuzzle_Draw_0)
  • [ ] @@ functions (gml_Object_obj_tensionbar_Draw_0)
  • [ ] Instance IDs with dot notation (several room start entries)
  • [x] e5ada7453b035edccdedcbbc21bffd43ec217138 Scripts. While I have made some progress on assembling these (hackalicious branch), the offsets in references still need to be adjusted.

Non-matching:

  • [ ] setowner calls. Currently, I'm ignoring these, which really helps.
  • [ ] Weird decompilation of a while loop as a while loop inside an identical if statement (gml_Object_DEVICE_CHOICE_ch1_Step_0)
  • [ ] Code duplication in decompilation of breaks in loops. I think this has actually been around before 2.3; as I recall, Undertale narrowly avoids it using the profile system. (gml_Object_DEVICE_FAILURE_Step_0) There is a similar issue in some for loops, apparently without the break statement; this may indicate an undecompiled continue? (gml_Object_lang_sprite_layer_hider_Create_0)
  • [ ] Array ++/-- calls do not compile correctly. (gml_Object_DEVICE_MENU_Step_0)
  • [ ] Global array ++/-- calls do not decompile correctly. (gml_Object_obj_battlecontroller_Step_0)
  • [ ] Several collision events are compiling with bf or b instructions shooting just short of instructions they should come after, including popenvs, popzs, and even bs (gml_Object_o_coaster_jama_Collision_o_coaster_hero)
  • [x] 5a6e45a1b1e785050048a22e2a87019a27675166 room_speed is being popped as a Self variable, not a Builtin? (gml_Object_o_boxingcontroller_Create_0)
  • [ ] Assigning other objects' alarms needs a conv (to variable) instruction in 2.3. (gml_Object_o_boxingqueen_Step_0)
  • [x] 5a6e45a1b1e785050048a22e2a87019a27675166 Builtin arrays are incorrectly compiling as Self, including the -5/-1 bit that is still used in 2.3. (gml_Object_o_coaster_berdly_Step_0)
  • [ ] Something is incorrect (maybe use of the bool type?) in compiling a complex if clause. (gml_Object_obj_alleyswitch_Step_0)
  • [ ] instance_exists(self) should compile using @@This@@. Likewise with other. (gml_Object_obj_battle_cleanup_Alarm_0)
  • [ ] Some apparently useless b instructions (going where the code was going anyway) are being dropped. (gml_Object_obj_battletester_Draw_64) This also seems to show up in profile-less Undertale.
  • [ ] Ternaries with ? 1 : 0 are simplified in decompilation to use the condition directly. (gml_Object_obj_berdlyb2_enemy_Step_0)
  • [ ] Anonymous script offsets are still not corrected, but this appears to only be an issue for exact 1:1 saving; the game runs with only minor tweaks after CheckDecompiler.
  • [ ] Anything with multiple functions becomes a mess.
  • [ ] return statements in ifs do not compile (gml_GlobalScript_scr_drawpart_crop).
  • And more... Le sigh.

Jacky720 avatar Dec 18 '21 03:12 Jacky720

Some of these have seperate issues. Might wanna collect them here. The return statement in an if statement i.e. sounds like #900

Miepee avatar Jun 12 '22 17:06 Miepee