Skip to content

Rando: Boss Entrance Shuffle#2194

Merged
briaguya0 merged 21 commits intoHarbourMasters:developfrom
Archez:boss-shuffle
Jan 20, 2023
Merged

Rando: Boss Entrance Shuffle#2194
briaguya0 merged 21 commits intoHarbourMasters:developfrom
Archez:boss-shuffle

Conversation

@Archez
Copy link
Contributor

@Archez Archez commented Dec 15, 2022

This introduces boss entrance shuffle to rando!

The options for boss entrance shuffle are the following:

  • Off
  • Age Restricted (Shuffles child bosses and adult bosses in separate pools)
  • Full (Shuffles all bosses together), where child could be expected to fight Phantom Ganon or BongoBongo

Preliminary support for separating boss rooms in the logic location access was introduced on the 3ds side, that I pulled in.
The actual support for shuffling the boss entrances based on settings is new, and based off of n64 rando. (I will upstream these changes to 3ds rando after play testing).

On the SoH side, I had to adjust how bluewarps were overridden such that if entering Deku Tree -> Water Temple -> Bongo-Bongo, then the bluewarp in Bongo-Bongo's room should take Link back outside of the Deku Tree. I also adjusted the savewarp override and implemented the gameover override so that save/death warping in a boss room takes you back to the connected dungeon.

Boss room values were added to the entrance tracker.

There are two authentic bugs in the game:

  • One where the entrance registered for leaving Barinade's room into JabuJabu loads the one of the basement rooms, and has an incorrect spawn position for Link where he falls through the floor.
  • The other where the entrance registered for leaving Morpha's boss room into the Water Temple loads the water temple entrance instead.

Both of these have been repaired through "hooks" that do not permanently modify cached resources.

  • Boss shuffle support
  • Repair bugged entrances
  • Entrance tracker support
  • Modified/Verified hints work correctly

For hints, when dungeon rewards are shuffled at the end of dungeons, then the altar hint will specify the dungeon that the boss room is connected to (e.g. Light medallion behind Gohma, Water Temple -> Gohmas room, then the alter will say Light medallion is in Water Temple). When rewards are not shuffled at the end of dungeons, then gossip stone hints for any item as a boss reward will mention the "X boss holds Y" instead or saying "X dungeon rewards Y". These behaviors match what N64 rando does.

Build Artifacts

@briaguya0 briaguya0 force-pushed the develop branch 2 times, most recently from 05bd4a3 to ba13e6b Compare January 17, 2023 05:34
Copy link
Contributor

@briaguya0 briaguya0 left a comment

Choose a reason for hiding this comment

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

Overall this is looking really great! Super excited to see this feature!

I left a couple questions as comments, but I don't see anything big that needs changing!

forwardEntrance->SetType(forwardEntry.type);
forwardEntrance->SetAsPrimary();

// When decouple entrances is on, mark it for everything except boss rooms so
Copy link
Contributor

Choose a reason for hiding this comment

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

everything except boss rooms so

looks like you didn't finish writing the comment here, so what?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll fix that, and a typo in another comment

if (Settings::ShuffleBossEntrances.Is(SHUFFLEBOSSES_FULL)) {
entrancePools[EntranceType::Boss] = GetShuffleableEntrances(EntranceType::ChildBoss);
AddElementsToPool(entrancePools[EntranceType::Boss], GetShuffleableEntrances(EntranceType::AdultBoss));
// If forest is closed, ensure Ghoma is inside the Deku tree
Copy link
Contributor

Choose a reason for hiding this comment

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

could you explain why this is required?

Copy link
Contributor Author

@Archez Archez Jan 20, 2023

Choose a reason for hiding this comment

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

closed forest requires that Ghoma is defeated to be opened. So Ghoma needs to be guaranteed to be in the Deku Tree.

There is already an exclusion to remove deku tree from dungeon entrance randomizer when closed forest is on right below (because of Spirit temple hands).

Comment on lines +190 to +192
void SetDecoupled() {
decoupled = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm assuming we never want to unset decoupled so this should be fine as is, but part of me thinks it should be

Suggested change
void SetDecoupled() {
decoupled = true;
}
void SetDecoupled(bool decouple = true) {
decoupled = decouple;
}

just in case or something

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I don't see that use case coming up (as depending when you'd want to change it, you'd have to reshuffle the entrances).

}

// form hint text
Text locationText = GetHintRegion(Location(hintedLocation)->GetParentRegionKey())->GetHint().GetText();
Copy link
Contributor

Choose a reason for hiding this comment

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

so if i'm reading this correctly

AreaTable(parentRegion)->GetHint().GetText();

and

GetHintRegion(parentRegion)->GetHint().GetText();

are functionally equivalent, which is why this can be simplified?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AreaTable() will get the direct area of the region, and if that region hint is "No Hint", then "No Hint" gets used, which is not what we want.

GetHintRegion() will check if the region has a valid hint, and if not, search the exits region until it can find a hint. This is how interiors work so that a randomized interior will use the connected region as its hint.

Boss heart containers are now set as "No Hint" so the reverse search can be performed.

Previously if an item was marked as dungeon, then it was guaranteed to have a hint, then there was no need to worry about the reverse search, but thats not the case with Boss shuffle now.

Comment on lines +674 to +675
// Copy the actorentry properties to avoid modifying the original cached pointer
// The assign a pointer of our modified actoreEntry back
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Scene resources are cached, so any modification to the pointer is permanently retained even for vanilla, and we can't invalidate scenes currently (my same compliant w.r.t. water box collisions also modifying cached scene resources).

Since playstate just holds actorentry as a pointer and doesn't clear it, I can have this object here and just replace the values as needed, without modifying the original pointer.

@briaguya0 briaguya0 merged commit 261db2c into HarbourMasters:develop Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants