-
Notifications
You must be signed in to change notification settings - Fork 197
Support for runtime patches: MonSca, EncounterRandomnessAlert, EXPlus, GuardRevamp #3378
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
base: master
Are you sure you want to change the base?
Conversation
b3c5d65
to
b9cd797
Compare
b9cd797
to
6269f66
Compare
Ok, this should be ready for review. I also cherry-picked my recent commits that move the handling for "Virtual Key" code mapping because several other PRs & WIP branches depend on these helper functions. |
Looks solid on first glance. Only have to do some in-game testing and the extended command line parser. Though in general code looks fine. Using only one file for these small patches makes sense. Otherwise we have hundreds of small patch files. Was there a motivation behind this |
Yeah, when you are looking at it closer, that flag doesn't make that much of a difference here. The idea is simply, to provide a way of compiling a "clean" Vanilla-compatible version of the Player without much added bloat of patch support code. One patch that would be in a rather "hot" code path is the PowerMode branch, where patch functionality is triggered inside the routines responsible for changing variable values... (+ some yet-to-be-implemented PM-compatible Keyboard patch made by Cherry, that implements just the 4th Variable register of PowerMode) |
…picked from VDCE commit 8555c92)
…eters based on some variable values)
…ert' & moved code to separate file.
- Refactor the way Player::config_game is initialized, so that the values set by indirectly adressing config params don't get overwritten. - Replace all occurrences of ':' for INI parameters with '.' - Game config parameters were passed by copy instead of reference in some occassions - Also implement EXPlus modifier for RPG2k3 - Fix GCC warnings
…ap codes from our InputKey enum to their "virtual key" equivalent
6269f66
to
baf75f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to support all the old games so this is moving some obscure stuff forward. Will be useful in combination with some patch database later.
Great PR comment and test game btw.
I added a comment about RuntimePatches::MonSca::ModifyMaxSp
and co going through some RuntimePatches::ModifyMaxSp
function so other patches that do something similar can be delegated in it. But this can be reworked when necessary later.
that Lint build failure can be ignored. Is a new feature added by c1 for buildsystem rework and not your fault. You are just triggering the failure because you added something to the CMakeLists but I won't enforce that you fix this xD |
Yeah, wanted to fix this later. |
…e (I completely forgot that I implemented this variant)
Detection
No automatic patch detection yet! (Only .INI settings & cmd line args)
This would either require something like my proposed Draft PR #3352 (Extracting patch info from .EXE via known addresses & signatures) or some database of known patch configurations of games (As proposed in Issue #1210)
Test Game:
BattlePatches.zip
RPG_RT Patches included in this PR
MonSca:
This patch scales the default battle parameters of an enemy based on the contents of some in-game variables.
(Default:
V[1001] - V[1010]
)When a switch is set (default:
S[1001]
) to ON, an alternative scaling formula, based on the average party level, is used.Default formula:
val = val * V[...] / 1000
Alternative formula: val =
val * avg_level * V[...] / 1000
Variant 'MonScaPlus':
If set, the variable IDs used for scaling will be offset by the enemy's troop index.
->
V[base_var_id + troop_index]
Encounter Randomness Alert
This patch skips the normal battle startup logic whenever a random encounter would be triggered.
Instead a switch (default:
S[1018]
) is set to ON and the troop ID is stored into a variable (default:V[3355]
).EXPlus:
This patch allows to individually boost the 4 party members' gained experience inside battles by applying an extra percentage based on the values of in-game variables.
(default:
V[3333]
for party member#1
; the amounts for other party members are read from the subsequent 3 variables)If the '[+]' option is enabled, a side effect is added to one of the Actor clauses of 'CommandConditionalBranch':
Whenever this command is used to check for the existence of an actor in the current party, the current party slot (1-4) of this actor is set to an in-game variable. (default:
V[3332]
)GuardRevamp:
This patch changes the way the damage adjustment is calculated whenever the target of an attack is defending.
Normally this calculation is done by simply dividing the damage in half for normal defense situations, and by quartering it when the target has the 'strong defense' attribute. With 'GuardRevamp' enabled, this is changed to a percentage calculation, allowing for more granular control over the output. The given default values of '50%', and '25%' would provide the same results in most situations.
Notes
Support for all of these patches can be disabled by setting the compiler flagNO_RUNTIME_PATCHES
.Some of the handling of command line args has been refactored, to allow setting patch parameters inidividually.
Example:
Player.exe --patch-monsca -atk 2003 -exp 2027 -plus --patch-guardrevamp -normal 75 -strong 30
V[2003]
&V[2027]
(+ troop_id for this 'Plus' variant)