Skip to content

Change Region's scene string with a SceneId#5398

Merged
Malkierian merged 15 commits intoHarbourMasters:developfrom
Pepe20129:region_scene
Jun 19, 2025
Merged

Change Region's scene string with a SceneId#5398
Malkierian merged 15 commits intoHarbourMasters:developfrom
Pepe20129:region_scene

Conversation

@Pepe20129
Copy link
Contributor

@Pepe20129 Pepe20129 commented Apr 12, 2025

Also deduces timePass (and areas when possible) from the scene.

Build Artifacts

@Pepper0ni
Copy link
Contributor

Deriving time pass form the scene is problematic for psuedo-regions used to filter out access such as swim checks when you spawn in water, as it can cause the player to get time pass in a area they cannot actually survive in. What is the intention for those situations?

The colossus hands would also be a problem but apparently they were set to spirit temple anyway, which raises spirit temple key logic questions about TimePass I would have to think about.

@Pepe20129
Copy link
Contributor Author

I think for those regions we could use SCENE_ID_MAX which is what we do for other pseudo-regions.

@Pepper0ni
Copy link
Contributor

I think for those regions we could use SCENE_ID_MAX which is what we do for other pseudo-regions.

The issue here is that they could then connect back to the original scene as they won't be caught by the check in entrance shuffle that prohibits own-scene connections

Copy link
Contributor

@Pepper0ni Pepper0ni left a comment

Choose a reason for hiding this comment

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

A few things I noticed going over it all, mostly side effects of moving from text to ID and mistakes in assigning timepass.


// Entrances shouldn't connect to their own scene, fail in this situation
if (entrance->GetParentRegion()->scene != "" &&
if (entrance->GetParentRegion()->scene != SCENE_ID_MAX &&
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs an exception to handle OGC, Hyrule Castle and Castle Grounds (currently assigned as SCENE_ID_MAX) and make sure they are not connected to each other.

Additionally, all grottos and fairy fountains have separate scene text right now that allows them to connect to each other in decoupled + mixed pools, under this system they would all have the same scene and be unable to connect, which I doubt was your intention.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How does entrance rando currently handle going to hc/ogc as the wrong age?

Fixed the grottos/fairy fountains

Copy link
Contributor

Choose a reason for hiding this comment

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

It uses a filtration region called RR_CASTLE_GROUNDS, which splits the logic into the HC and OGC regions on entry, enforcing the age restriction, however leaving these 2 does not go through this region unless it's the south connection, as RR_CASTLE_GROUNDS also connects to market.

Copy link
Contributor

@Malkierian Malkierian Apr 20, 2025

Choose a reason for hiding this comment

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

In practice, I believe what happens is just that HC and OGC are the same scene, and the difference is only determined by what age you are going in, like Market, in case that was the angle you were after.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, I think.

});

areaTable[RR_SPIRIT_TEMPLE_OUTDOOR_HANDS] = Region("Spirit Temple Outdoor Hands", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {
areaTable[RR_SPIRIT_TEMPLE_OUTDOOR_HANDS] = Region("Spirit Temple Outdoor Hands", SCENE_SPIRIT_TEMPLE, {}, {
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically speaking, Time passes on the hands, however the complexities of spirit key logic make me unsure if I want it to count as a time pass area in the long term. I would have to think about it.

//With multi-area support {RA_CASTLE_GROUNDS} is not strictly required anymore, as any interior here could inherit both
//{RA_HYRULE_CASTLE} and {RA_OUTSIDE_GANONS_CASTLE}, but a setting to merge the latter 2 into the former may be preferred
areaTable[RR_CASTLE_GROUNDS] = Region("Castle Grounds", "Castle Grounds", {RA_CASTLE_GROUNDS}, NO_DAY_NIGHT_CYCLE, {}, {}, {
areaTable[RR_CASTLE_GROUNDS] = Region("Castle Grounds", SCENE_ID_MAX, {RA_CASTLE_GROUNDS}, {}, {}, {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to the boss situation, this will be able to connect to OGC and market if not accounted for, however this trio need special casing due to the way the area is handled between ages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, I think.

areaTable[RR_CASTLE_GROUNDS] = Region("Castle Grounds", "Castle Grounds", {RA_CASTLE_GROUNDS}, NO_DAY_NIGHT_CYCLE, {}, {}, {
//
//Temporarily uses SCENE_OUTSIDE_GANONS_CASTLE to avoid self connection between ages
areaTable[RR_CASTLE_GROUNDS] = Region("Castle Grounds", SCENE_OUTSIDE_GANONS_CASTLE, {RA_CASTLE_GROUNDS}, {}, {}, {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should work for now, but at some point OGC is going to want it's own day/night setting to handle the perma-night, do you have an idea of how to separate this from the rest of OGC when that happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could add an explicit check for it in AreEntrancesCompatible (checking the name or the area or the id) and change this back to SCENE_ID_MAX.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, so long as there's a plan for when I get around to it. a hardcoded exception never feels great but it seems appropriate in this case given the special case

@Pepper0ni
Copy link
Contributor

Deriving time pass form the scene is problematic for psuedo-regions used to filter out access such as swim checks when you spawn in water, as it can cause the player to get time pass in a area they cannot actually survive in. What is the intention for those situations?

The colossus hands would also be a problem but apparently they were set to spirit temple anyway, which raises spirit temple key logic questions about TimePass I would have to think about.

I have added right hand to the shared area, so i do not want time pass on the hands. I'm pretty sure any case where we have certain hands access we will get colossus and it's TimePass in logic anyway

@Malkierian
Copy link
Contributor

Just so I know, what was the result of the discussion about pseudo-areas and timePass inheritance? I think it could probably go in, but that has me still concerned.

@Pepper0ni
Copy link
Contributor

Just so I know, what was the result of the discussion about pseudo-areas and TimePass inheritance? I think it could probably go in, but that has me still concerned.

I just looked it over, and there was indeed no satisfactory response, I guess we need that fallback I mentioned immediately rather than later, so I'm unapproving until there's a manual TimePass override option or some other solution that doesn't cause entrance connection issues

@Pepe20129 Pepe20129 requested review from Malkierian and Pepper0ni May 30, 2025 20:59
Copy link
Contributor

@Pepper0ni Pepper0ni left a comment

Choose a reason for hiding this comment

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

Had a review, the core structure seems solid now, there's just some shortcut stuff i found issue with and some other small things

@Malkierian
Copy link
Contributor

@Pepe20129 Address Pepper0ni's latest review and the merge conflicts, and I think we can get this in. @Pepper0ni if you wouldn't mind going back through the other reviews and seeing if the remaining unresolved conversations can be marked as resolved, I'd appreciate it.

@Pepe20129
Copy link
Contributor Author

Fixed merge conflicts

@Malkierian
Copy link
Contributor

Looks like you might be missing an include in deku_tree.

areaTable[RR_CASTLE_GROUNDS] = Region("Castle Grounds", "Castle Grounds", {RA_CASTLE_GROUNDS}, NO_DAY_NIGHT_CYCLE, {}, {}, {
//
//Temporarily uses SCENE_OUTSIDE_GANONS_CASTLE to avoid self connection between ages
areaTable[RR_CASTLE_GROUNDS] = Region("Castle Grounds", SCENE_OUTSIDE_GANONS_CASTLE, TIME_DOESNT_PASS, {RA_CASTLE_GROUNDS}, {}, {}, {
Copy link
Contributor

Choose a reason for hiding this comment

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

is RA_CASTLE_GROUNDS still properly preserved to cover the interior-on-the-market-exit edge case?

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 think so.

Copy link
Contributor

@Pepper0ni Pepper0ni left a comment

Choose a reason for hiding this comment

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

LGTM

@Malkierian Malkierian merged commit 87c9713 into HarbourMasters:develop Jun 19, 2025
6 checks passed
@Pepe20129 Pepe20129 deleted the region_scene branch June 20, 2025 11:17
krazyjakee pushed a commit to krazyjakee/OOT that referenced this pull request Sep 6, 2025
* Change region scene from string to sceneid

* Deduce `timePass` from scene

* Deduce `areas` from scene where possible

No possible for `RR_CASTLE_GROUNDS` & "link's pocket" areas

* Update zoras_fountain.cpp

* Applied clang format

* Address review

* Address review

* Clang format

* Fix pseudo regions

* Format

* Address review

* Address review
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.

3 participants