Skip to content

Rando changes#3016

Closed
garrettjoecox wants to merge 4 commits intoHarbourMasters:developfrom
garrettjoecox:rando-changes
Closed

Rando changes#3016
garrettjoecox wants to merge 4 commits intoHarbourMasters:developfrom
garrettjoecox:rando-changes

Conversation

@garrettjoecox
Copy link
Contributor

@garrettjoecox garrettjoecox commented Jun 17, 2023

This PR aims to clean up some of our randomizer item giving logic, unifying patterns, removing some of our reliance on treasure flags, and moving some of the code closer to it's original source.

Pieces of this have come from #2824, as you will see we are now accounting for !rando in some places, but I think that PR still has some larger UI work that will block it for a while, and I want to get these playtested/merged separately

TODO:

  • Verify compatibility of entrance randomizer with changes (@Archez ? 🙏)
  • debug save gives a bunch of items on load
  • Small keys/maps/compasses need to be adjusted to be handled from any scene
  • Seems to be an issue on this branch with starting as adult.
  • Probably fix some stuff in check tracker
  • playtesting
  • PLAYTESTING

Summary of changes:

  • Blue warp code restored to be closer to source. This fixes wrong warps 🥳
    • The only change from source now is if we're rando'd, don't call Item_Give, the rest is handled in z_demo to skip cutscenes and the ItemGiver below for giving the items
  • Move the following checks to use the new ItemGiver mod (explanation below):
    • All dungeon rewards
    • RC_SONG_FROM_IMPA
    • RC_SONG_FROM_OCARINA_OF_TIME
    • RC_SHEIK_AT_COLOSSUS
    • RC_SHEIK_IN_KAKARIKO
    • RC_LW_GIFT_FROM_SARIA
    • RC_TOT_LIGHT_ARROWS_CUTSCENE
  • The following checks no longer using treasure flags. In some cases they were replaced with valid flags that the game uses, or weren't being set because we skipped a cutscene, in others we introduced new randomizer_inf flags.
    • All dungeon rewards
    • Scrub theater checks
    • Great fairy checks
    • Suns Song
    • Sarias Song
    • Song of time
    • LACs
    • Zeldas lullaby
    • Prelude of light
    • Zelda's letter

ItemGiver

This is a new pattern introduced for ensuring the player receives an item, can be useful for cutscene skips, CC, starting with items, multiplayer, etc.

The gist of it is pretty intuitive, you need two flags to give an item, one to determine if the item should be given to the player, and another to determine if the player has received the item already. If you have some sort of logical or cutscene or scene entrance requirements they don't belong in the ItemGiver, that should be handled elsewhere, and simply set the should flag.

Build Artifacts

@garrettjoecox garrettjoecox added this to the MacReady milestone Jun 17, 2023
@garrettjoecox garrettjoecox added the needs playtesting Needs general playtesting to ensure correctness label Jun 17, 2023
@briaguya0
Copy link
Contributor

this looks really cool, seems like it could probably be utilized to address issues like #2200 too!

@garrettjoecox
Copy link
Contributor Author

@briaguya-ai / @leggettc18 want your opinion on something.

With these new changes, the reward from the boss is given after the blue warp (this is very much intentional, and I intend to stick with this). I just realized however, a side effect of this is that dungeon items that are on the boss reward are now not handled properly unless dungeon items are set to anywhere, mostly due to how we don’t use the “dungeon specific items” unless they are set to anywhere or outside of dungeons.

I know there have been some on and off convo’s about this, but would you be opposed to always using the dungeon specific items? Even if dungeon items can only be in their own dungeon?

@briaguya0
Copy link
Contributor

briaguya0 commented Jun 20, 2023

would you be opposed to always using the dungeon specific items?

I'm not opposed to using dungeon specific items, I am opposed to things always having dungeon specific text and colors. I think the custom message system is robust enough that we could build out logic to handle conditionally displaying generic messages when items aren't shuffled outside of their own dungeons, i'm not sure what it'd take to handle the key colors though.

update bluewarp handling for entrance rando
Comment on lines +225 to +226
// Moved to links pocket condition (awards light medallion)
// Flags_SetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right. Links pocket isn't necessarily the "dungeon reward", unless you set rewards at end of dungeon.

If this needs to be limited to that condition, could probably be under a

if (Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_REWARDS) == RO_DUNGEON_REWARDS_END_OF_DUNGEON) { ... }

Ultimately though, it is not clear to me why this flag needs to be conditionally set for light medallion. Can you clarify?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “awards light medallion” is really just referring to the vanilla logic item behind this check.

This flag was previously used to skip the cutscene that plays the first time you pull MS (which is where you would get the light medallion in vanilla)

Now that cutscene is skipped in z_demo, and this flag is used in the ItemGiver mod to award the links pocket check.

This will allow us in the near future (after some logic tweaks) to award the links pocket check the first time you travel to adult. This should obviously be optional in the name of parity with OOTR, but IIRC the only reason the concept of “links pocket” exists is because of limitations we don’t have, we just inherited it.

@garrettjoecox
Copy link
Contributor Author

Closing, this will be succeeded by an upcoming PR targetting develop-rando

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs playtesting Needs general playtesting to ensure correctness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants