Skip to content

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

florianessl
Copy link
Member

@florianessl florianessl commented Mar 22, 2025

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 flag NO_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

  • enables "MonScaPlus" for scaling attack & experience gains by reading from the scaling factors from Variables V[2003] & V[2027] (+ troop_id for this 'Plus' variant)
  • enables "GuardRevamp" with a factor of 75% for normal defending & 30% for "strong" defend.

@github-actions github-actions bot added Window/Scenes Building Battle Settings All about customizable features, storing and applying them labels Mar 22, 2025
@florianessl florianessl force-pushed the compat/BattlePatches branch from b3c5d65 to b9cd797 Compare March 22, 2025 15:18
- 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
@florianessl florianessl force-pushed the compat/BattlePatches branch from b9cd797 to 6269f66 Compare April 16, 2025 05:21
@florianessl
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Battle Building Settings All about customizable features, storing and applying them Window/Scenes
Development

Successfully merging this pull request may close these issues.

1 participant