Bug fixes for DnD implementation in `libEGM`

Reporter: dc03  |  Status: closed  |  Last Modified: Today at 11:16:37 am
Rewrite parts of the DnD conversion code to more exactly mirror the java implementation in `EnigmaWriter.java` (https://github.com/enigma-dev/lgmplugin/blob/master/org/enigma/EnigmaWriter.java#L1173, which is the original LGM implementation)

Currently, the issue lies in object IDs not being properly generated which means that even though the code is generated more or less exactly as LGM does it, the objects being modified in the code are incorrect which can lead to a broken game.


Codecov Report

Merging #2304 (0463cc1) into master (2ddad07) will increase coverage by 0.26%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2304      +/-   ##
+ Coverage   35.27%   35.54%   +0.26%     
  Files         213      215       +2     
  Lines       20474    20498      +24     
+ Hits         7223     7286      +63     
+ Misses      13251    13212      -39     
Impacted Files Coverage Δ
...ELL/Universal_System/Instances/instance_iterator.h 100.00% <0.00%> (ø)
.../Universal_System/Instances/instance_system_base.h 100.00% <0.00%> (ø)
ENIGMAsystem/SHELL/Universal_System/var4.h 88.31% <0.00%> (+0.52%) ⬆️
ENIGMAsystem/SHELL/Platforms/General/PFmain.cpp 82.14% <0.00%> (+0.89%) ⬆️
...MAsystem/SHELL/Graphics_Systems/General/GSfont.cpp 3.27% <0.00%> (+3.15%) ⬆️
...em/SHELL/Universal_System/Resources/fontstruct.cpp 3.28% <0.00%> (+3.28%) ⬆️
...ELL/Universal_System/Instances/instance_system.cpp 67.95% <0.00%> (+6.62%) ⬆️
ENIGMAsystem/SHELL/Universal_System/actions.h 20.00% <0.00%> (+8.23%) ⬆️
...GMAsystem/SHELL/Graphics_Systems/General/actions.h 10.00% <0.00%> (+10.00%) ⬆️
.../SHELL/Universal_System/Resources/fonts_internal.h 30.00% <0.00%> (+10.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ddad07...0463cc1. Read the comment docs.

@RobertBColton I request you to look over this once again. In its current state, 1945v3 has somehow started working again, and it seems the only difference between what LGM and libEGM generate now is one with() statement and a event_collision->name, which I think is also caused by the with() having a different ID. The diff of the generated code is available here https://gist.github.com/dc03/dcc76bf54b50b3fe833919deb24db7b6, where LGM's output is the removed stuff and libEGM's output is the added stuff.

To get a useful output from git diff, I have sorted the generated output because the C++ gets generated in different orders for some reason, which is why the diff output may look a little weird.

@RobertBColton as per the discussions we had, I have redone the code generation for DnD a bit, and I have also added a stack to track the targets of actions. However, it can still be better, as targets are not tracked across non-nested, i.e. linear actions, so multiple with-statements can still be generated like

    enigma::varaccess_test_x(int(self))+= 5;
    enigma::varaccess_test_y(int(self))+= 1;
    __if__ = ...
@RobertBColton you can basically ignore MINGW because of gRPC being broken upstream, which causes linker errors. For MSVC, I was fixing it in https://github.com/enigma-dev/RadialGM/pull/230 where the CI broke because of windows-latest upgrading to VS 2022. I do not know about any style checks, I didn't even know there were any
Please sign in to post comments, or you can view this issue on GitHub.