-
Notifications
You must be signed in to change notification settings - Fork 521
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
Vanilla Behavior Overhaul #3755
Merged
garrettjoecox
merged 67 commits into
HarbourMasters:develop-rando
from
garrettjoecox:develop-rando-changes
May 5, 2024
Merged
Vanilla Behavior Overhaul #3755
garrettjoecox
merged 67 commits into
HarbourMasters:develop-rando
from
garrettjoecox:develop-rando-changes
May 5, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4f19ce4
to
718a22b
Compare
e4c11cf
to
ca2786e
Compare
Co-authored-by: jordanpg <jordanpg@users.noreply.github.com>
7cbb23c
to
596ea5e
Compare
GameInteractor hooks for adult and child shooting gallery
fix the torch
GI VB for Man On Roof
Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
…-access fix: add location access for treasure chest game items and gift from sages
vb tower escape
…rs/Shipwright into develop-rando-changes
…rs/Shipwright into develop-rando-changes
…rs/Shipwright into develop-rando-changes
latest lus main
don't skip item give animation in chu bowling
…eath (#119) * Adds Quick Boss Death checkbox and implements Phantom Ganon's quick death. * Clarifies relocation comment.
* vb deku stick cheat * it's the 21st now --------- Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
* Nabooru quick death conversion * Fix brackets, not sure exactly how this was working before.
…rs/Shipwright into develop-rando-changes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Vanilla Behavior Overhaul
I know this PR is large, and a bit of a mess, hoping to get some more eyes and hands on it. Things are going to be broken for a good bit, but this is the main thing I wanted to do for v3.
What is this?
This is an overhaul of how we make changes to the game's source code. The outcomes of these changes include:
How does it work?
The foundation for this PR is
GameInteractor_Should
, a new function that returns a boolean that is the result of whatever mods have opted into the hook and determined if something should or should not happen. It takes the following arguments:GIVanillaBehavior id
- An enum that represents what behavior we are overriding. Should read like a sentence with the hook name (ignoring enum prefix), for instance "Should be eligible for light arrows" isGI_VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS
bool should
- A boolean that represents how the vanilla game would behave. This is the default value, and is the value that should be returned if no mods have opted into the hook. In cases where you want to override a vanilla condition, you would simply wrap the original condition in this hook (A). In cases where you want to are just wrapping code you don't want to happen that normally happens in vanilla, you would just pass intrue
here (B).void* opt
- A pointer to an arbitrary value relevant to the behavior that may be useful for the consumer of the hook. In most cases this would be NULL or a pointer to the actor associated with the behavior. What this is will be documented along side it's GIVanillaBehavior enum (This is maybe a bit dangerous, we can aim for more safety here later?)(A) Example of overriding a vanilla condition, we want to override this in rando to instead check if the player has used the deku tree blue warp:
(B) Example of overriding a vanilla behavior, we don't want this cutscene to start when disabling cutscenes:
On the hook consumer side, we have the
OnVanillaBehavior
hook, called with the same arguments asGameInteractor_Should
, except thebool should
argument is instead a pointerbool* should
to whether or not the behavior should happen. Each consumer of this hook can change the value ofshould
to whatever they want, and the final value will be returned to the caller ofGameInteractor_Should
. This hook is called in the order that the hooks are registered, so the last mod to opt into the hook will have the final say on the value ofshould
, should they choose to change it. This is an example consuming the example behavior above:2 Step Randomizer Check System
Utilizing the system detailed above, along with other hooks, we are migrating all randomizer checks to an asynchronous 2 step system.
The first step, usually happening within the original source code, is to set a flag and then ensure Link is done interacting with whatever actor/cutscene is associated with the check. This means every randomizer check will be closely associated with a flag in the game, preferably vanilla flags, but in some cases where flags don't exist we will create a new soh_inf (currently randomizer_inf) flag.
The second step, is a hook handler watching for flag sets, and when a flag is set that is associated with a randomizer check it queues up an item to be given.
TODO:
Build Artifacts