EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
989 stars 185 forks source link

Interpreter Refactor #3233

Closed florianessl closed 4 weeks ago

florianessl commented 4 months ago

New helper function: "DecodeTargetEvaluationMode"

This should be most of the easier-to-verify-and-merge changes, my "ScopedVars" depends on.

The current draft for ScopedVars also contains some more changes for the "ControlVariables" & "ConditionalBranch" commands, moving all of the operand switching logic into game_interpreter_control_variables.cpp. Basically I reinvented dispatching tables for this, to share this logic between the different new command spin-offs, but I have yet to confirm with benchmarks that this really a good solution. I don't want to slow any of the existing commands down by even a single cycle. :D
https://github.com/florianessl/Player/tree/ScopedVars Best possible way to implement all this switching would likely be a mix of computed go-tos & tail recursion (see #1919 for the suggestion of implementing computed go-tos; but it´s debatable, if any of these changes would create any speed-ups in current-year & aren't already part of common compiler optimizations.)

Ghabry commented 3 months ago

Nice refactor / cleanup! Besides Refactored several Interpreter related code segments this does not look too controversial. Reviewing that one commit will take a while but on first glance I see no obvious issues.

Ghabry commented 2 months ago

@florianessl could you attempt to do a rebase? There is one conflict in game_interpreter.

Ghabry commented 1 month ago

Would be good to get this one reviewed and in before the event commands because of conflicts.

Will run our test game through this to find bugs...