Reworks the entirety of the event system, redoing some or all logic for event parsing, event generation, event triggering, inheritance, etc.
This brings a few key advantages:
- More event types. We are no longer bound by events supported by LateralGM, or any other toolkit.
- Dynamic event description. It allows us name events whatever we like, and parameterize them with as many arguments as we need.
- Joystick events can now accept a joystick number parameter AND a button/axis number.
- Alarm events are no longer limited in number to the 16 or whatever that Mark squeezed in.
- We don't have to keep making up strange values for new "special" events.
- EGM Support. Dynamic naming is part of this retooling. This means filenames in EGM can be
Collision[obj_wall].edl. This unblocks EGM support.
This comes with great risk:
- Build errors. Some variable or event declarations may be emitted twice.
- Link errors. Some event declarations may not have their body emitted, leading to a link error.
- Behavioral regressions. There may be quirks of object inheritance we don't currently have tests for. We may not notice these during manual QA testing.
We will test this on our CI and on various user games before merging. This is not a guarantee, but should mitigate noticeable regressions. If you have a game to test these changes against, please clone this branch and test them when the CI is green.
The topology of parsed entity storage has been greatly reworked.
- Parameterized event types are now more specific.
SYSTEMis no longer an event type specification. It has been replaced by two others:
TriggerOnceif no iteration support is required (e.g. Create events),
TriggerAllif a list of them is to be maintained for iteration.
SPECIALIZED, and actually works for parameterized events.
- Prior to this refactor,
SPECIALjust meant that different values of an event's ID meant entirely different behaviors (look at
ev_game_starthave nothing in common).
- After this refactor, each special event from before now gets its own name, and a separate mapping connects those names to their ID pairs.
- After this refactor,
SPECIALIZEDmeans that each different parameter combination gets a dedicated iteration loop. This reduces the number of virtual method calls to check keys that haven't been pressed.
- Prior to this refactor,
- There is no longer a
robertmap. Proper event indexing structs have been introduced as part of object storage.
ParsedScopehas been introduced. Tooling in the compiler requests the
ParsedScope *egm_globalrather than
parsed_scriptis no longer a
parsed_event. Instead, both of these inherit
ParsedCode, which points to a
parsed_scripthas been renamed to
ParseScript, as adopting the new style rules is a good way of indicating a recent revisit.
parsed_roomno longer pretends to be a
@@ Coverage Diff @@ ## master #2089 +/- ## ========================================== - Coverage 30.95% 30.92% -0.04% ========================================== Files 197 197 Lines 19102 19102 ========================================== - Hits 5913 5907 -6 - Misses 13189 13195 +6
|Impacted Files||Coverage Δ|
@JoshDreamland I've fixed the CI for you again. However, I noticed when running gm2egm you aren't writing the EDL to the .edl files and instead putting them in properties.yaml. I believe we fixed this before in one of our 50 branches / PRs but I could be mistaken. We should probably add a gm2egm diffing test as well as a basic EGM read test like we have for the other gmk formats. It should be as simple as converting https://github.com/enigma-dev/enigma-dev/tree/master/CommandLine/testing/SimpleTests/basicGMX.gmx and adding it as an egm to the same folder.
@JoshDreamland I've fixed egm writing by shuffling some code. Please check my latest commit when you got a chance.