Skip to content
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

Logic and other preparations for mixed pools boss ER #1820

Merged
merged 10 commits into from
May 7, 2023

Conversation

fenhl
Copy link
Collaborator

@fenhl fenhl commented Dec 6, 2022

This PR has basically everything required to add boss arenas to the “Mix Entrance Pools” multiselect on @Roman971's branch, except for the setting itself. I will PR the setting itself to Dev-R once this is merged.

  • A system for savewarps is added to allow savewarps inside boss rooms to lead just outside the boss room. If the boss room is inside a dungeon, the current behavior of savewarping to the beginning of that dungeon is retained. Since attempting to load a save file with a spawn outside a grotto doesn't work properly (depending on platform, either softlocks on a black screen or loads the Deku Tree), a nearby non-grotto entrance is chosen as the savewarp for a boss arena in a grotto. This can be used to go out of logic if a boss is inside GC Grotto or GV Octorok Grotto, since there are no available entrances going to the proper logic region. The GV Octorok Grotto case is mitigated by using the entrance GV Lower Stream -> Lake Hylia leads to, unless that entrance is also inside/outside a grotto.
  • The bespoke system for connecting blue warps is replaced by blue warps being handled as regular exits and being connected to an appropriate entrance via the usual ER mechanism. The target entrance is selcted by starting with the one where the boss door exit leads, then iteratively leaving the dungeon, if any, via the front exit, then replacing the dungeon exit, if any, with its associated blue warp target. This preserves the current behavior when boss arenas aren't mixed. Blue warp targets are also added as valid targets for shuffled one-ways (the only actual user-visible change in this PR), and I will PR a separate setting for shuffling blue warps themselves as one-ways if this is merged.
  • The entrances to the Shadow and Spirit temple from the boss door are added to both CHILD_FORBIDDEN and ADULT_FORBIDDEN for now since we got stuck trying to figure out how and when to allow access to these dungeons from the back. These restrictions can be lifted (partially or entirely) in follow-up PRs.
  • A couple bugs from the preparation work in Prepare Big Octo, altar, and compass hints for mixed pools boss ER and dungeon reward shuffle #1641 are fixed.
  • The Boss Room regions are removed since the abstraction they were intended to provide breaks down when you also have to consider entering from the boss. For example, if you enter Jabu from Barinade, the condition for going back through the boss door depends on whether Jabu is MQ.
  • Since the logical requirements for defeating each boss are now used 3 times (for the heart container, the dungeon reward, and the blue warp), I've moved them into events to avoid repetition.
  • The trick logic_visible_collisions now also applies to climbing through the web in the Deku Tree from below. (When working on this, I originally had this in default logic because I thought it was invisible from below. In fact, it becomes visible once you get close enough to it.) The changes to the trick's description and tags are left out here and will be included in the PR to Dev-R.

Open questions

  • Going from MQ Jabu's boss door to the elevator room while the slimy thing is still there is a clip. Do we want to remove it from logic, bar the door from the other side or add another slimy thing (both of which would require a contribution), or leave it as it is?
    • We've decided to leave it as is for now and hope for a future contribution to bar the door.
  • Which combinations of age and MQ-ness, if any, should forbid the entrances into Shadow and/or Spirit from the boss doors?
    • We've decided to take the conservative approach for now and forbid all 8 combinations of Shadow/Spirit, vanilla/MQ, child/adult. Lifting these restrictions will be deferred to future PRs if and when we find situations for which we're reasonably sure that it will work.

Nice to have

  • Can the elevator in both variants of Forest be fixed when coming from the boss door with the shortcut open?
  • Can entrances to Gerudo Valley and Goron City from the respective grottos be added that won't crash?

Fixes #1552.

@r0bd0g
Copy link

r0bd0g commented Dec 6, 2022

"This can be used to go out of logic if a boss is inside GC Grotto or GV Octorok Grotto, since there are no available entrances going to the proper logic region."
I want to point out that this is currently banned(?) in standard maybe? It's not entirely clear whether or not this counts as 'crossing the valley', but I believe that similar things have been previously ruled that it does? Regardless I think you should remove this potential out of logic access. Perhaps you could use the entrance of being thrown into the river? (That's slightly rude but deal with it I guess.) Though honestly I would expect boss rooms in the overworld to send you to the overworld spawn. (We could really use more robust handling of grotto exits in general though...)

"I'm not sure whether this is the case for MQ Spirit"
Me neither. I suspect not?

"Similar to how shortcut Shadow starts you with 2 small keys if small keys are vanilla, vanilla Shadow starts you with 1 small key"
I'm going to have to think about this.

In vanilla shadow, if you unlock that door, it does open up access potentially to another small key, if you have the means to cross the chasm. So in theory if shortcuts are on you can skip checking for the additional key if you have the items for crossing that. The problem with this idea is that non-repeatable access could mess it up if you unlock the door and then never cross the chasm for the key and then lose access to this entrance. This kind of non-repeatable access issue-y logic stuff we often disable under ER, which of course this would be under ER so it probably can't be used. In MQ Shadow, I think you don't need to start with an additional key, but the dungeon will be forced to be accessible from both sides so that you can access all three small keys that are not locked behind any doors. So maybe you do need to start with the extra key if there happens to be some reason that this might not be possible to arrange in some settings. However, if the back area is not reachable, then you can't reach the locked door so you wouldn't need that back area key in the first place, but I don't know if you can rely on this fact because, if the back area is only reachable in a non-repeatable way, you could again open that door and leave without the key.

Another problem I'm seeing is that if the boss key decides to go into one of the Hover Boots chest or first small key chest in vanilla Shadow, there would not be enough locations to place own dungeons small keys if enough of the other potential checks are vanilla (mainly maps and compasses, but also pots now and maybe silver rupees or enemies in the near future). You may have to check for all relevant settings and ban the boss key from those checks to prevent these settings combinations from failing due to being unable to place small keys (as was done with MQ Forest BK). (A potential worry in the future is if anybody decides to make a vanilla Hover Boots setting, this problem gets worse.)

So I'm going to have to continue to think about this because it's really quite complicated.

There are a lot of logic bugs in this PR. It will be some time before I will get to reviewing this (I want to have some discussions about logic and tricks, write my own tricks PR (overdue), and then you're in line behind silver rupee shuffle, so I expect it to be at least a few months away). I will point out the few bugs that I spotted while not really even looking (in case I were to not spot them again when I do go to fully look it over later):

  1. MQ Spirit invisible chest is reachable also with Hover Boots and the lobby jump trick.
  2. You can reverse the Shadow chasms if dungeon shortcuts are on.
  3. You did not increase the key requirements in MQ Shadow.
  4. Check if Hookshot/Longshot reaches 'Shadow Temple MQ GS After Ship' without having to reverse the chasm.

@fenhl
Copy link
Collaborator Author

fenhl commented Dec 6, 2022

Perhaps you could use the entrance of being thrown into the river?

Good idea. Does anyone know the entrance index?

I would expect boss rooms in the overworld to send you to the overworld spawn.

I think having it work this way is nice because you don't get stuck when you find a boss room (other than Gohma's or KD's).

@r0bd0g
Copy link

r0bd0g commented Dec 6, 2022

"I think having it work this way is nice because you don't get stuck when you find a boss room (other than Gohma's or KD's)."
Welcome to getting one-way'd.

"MQ Spirit invisible chest is reachable also with Hover Boots and the lobby jump trick."
Okay you didn't do that right, maybe I should have said 'or'. Hovers to those upper ledges is in default. Hovers OR trick (trick is adult only, just in case you somehow allow child near).

In theory the reverse routes through shadow when shortcuts are on shouldn't need any kind of check for mixed pools bosses because we already account for that door being reachable. Perhaps I haven't thought hard enough about it yet though. But yeah I think shortcuts routes, they already know about that door. You didn't put the extra check on forward, but for some reason you did put it on backward.

The entrance is 01A5 but if you're an Adult you're not going into the river, so it's not going to work for free.

@ETR-BTF
Copy link

ETR-BTF commented Dec 6, 2022

I think you should remove this potential out of logic access. (...) Though honestly I would expect boss rooms in the overworld to send you to the overworld spawn.

I agree with this. It might be a bit weird to have boss rooms act like overworld areas sometimes, but the way save warps inside boss rooms are currently handled in this PR is also weird/unexpected, so might as well go with the option that doesn't allow illogical access to areas.

@fenhl
Copy link
Collaborator Author

fenhl commented Dec 6, 2022

You didn't put the extra check on forward, but for some reason you did put it on backward.

Which entrance is missing the check?

the way save warps inside boss rooms are currently handled in this PR is also weird/unexpected

It's unexpected in a good way though because of the convenience of being able to continue exploring where you were. If you did want to go to the overworld spawn, you can just savewarp again. While I think that fixing grotto spawns would be ideal, I agree that using the overworld spawns would be better than the current situation; contributions welcome.

@r0bd0g
Copy link

r0bd0g commented Dec 6, 2022

"Which entrance is missing the check?"
The reverse entrance (before boat to after wind) has an extra check. (You don't need to worry about keys on the shortcuts routes b/c we already handled the fact that you can reach the final locked door early for shortcuts.)

@r0bd0g
Copy link

r0bd0g commented Dec 15, 2022

You only fixed the issue in my last post in MQ.

@fenhl
Copy link
Collaborator Author

fenhl commented Dec 15, 2022

The entrance is 01A5 but if you're an Adult you're not going into the river, so it's not going to work for free.

I tested this and adult gets spawned on the fortress side of GV. Given that the grotto is usually going to be reached from the field side, and usually as adult (since it's under a silver boulder), I don't think this is an improvement over using GV from field. Adding a new entrance that throws you into the river as both ages would work, but I'd assume that adding a new entrance that places you next to the silver boulder wouldn't be much harder than that.

@r0bd0g
Copy link

r0bd0g commented Dec 15, 2022

Alright this is dumb but how about sending you to whereever valley->lake goes.

@fenhl
Copy link
Collaborator Author

fenhl commented Dec 15, 2022

That would avoid the out of logic access but would require special handling in the code and might be confusing. Something to do if no one contributes a proper fix maybe?

@Cuphat Cuphat added Component: Logic Non-trivial changes to the JSON logic files Component: Misc A catch-all label labels Jan 2, 2023
@cjohnson57
Copy link
Collaborator

I'm a bit confused why this is being PRd here and not to Roman's branch, where Mixed Pools already exists?

@fenhl
Copy link
Collaborator Author

fenhl commented Jan 7, 2023

The changes to the logic would be tedious for Roman to maintain on his branch, the bug fixes are relevant for dungeon reward shuffle too, and the changes to how blue warps work are required if I want to PR blue warp shuffle later.

@cjohnson57
Copy link
Collaborator

Sounds good then, will review once r0b looks it over

@cjohnson57 cjohnson57 added the Status: Needs Review Someone should be looking at it label Jan 8, 2023
@r0bd0g
Copy link

r0bd0g commented Jan 8, 2023

Epic announced last month that the old Rock Band servers will be taken down January 24th. So I've been trying to get my fill of that while I can in case replacement servers are never made available. So that's what the hold up is lol.

@cjohnson57
Copy link
Collaborator

Lol no worries, enjoy your rock band!

@r0bd0g
Copy link

r0bd0g commented Jan 28, 2023

What determines whether the King Dodongo shortcut is on?

Can you explain how saving inside boss rooms currently works in this PR? I don't think savewarps should be allowed to cause sequence breaks and so if that's still possible, you should come up with some kind of solution.
Could saving inside a dungeon get you permanently stuck inside the dungeon because the main exit doesn't lead anywhere?
If the boss door (or regular dungeon entrance if you can only come in from the boss door) leads to an interior or a grotto, where does saving inside there take you? (What if it's a special interior like Temple of Time or Dampe's Grave?)
I mean just tell me anything you can think to tell me about savewarpping.

I'm trying to think about Spirit and Shadow key logic and it's hurting my brain. Trying to understand how those areas need to work before doing the review of the actual files. But here's another thing I spotted without really meaning to:
The ER occurs between Boss Door and Boss Room regions from the bosses.json file, right? So I think the logic believes you can immediately go back through the boss door in Deku Tree without needing to use a shield to solve the scrubs puzzle. Maybe there's somewhere in crater the logic could expect you to refresh your timer or something, I dunno. So you have to move the shortcuts/shield check one entrance later.

@r0bd0g
Copy link

r0bd0g commented Jan 28, 2023

Alright let's talk about Spirit Temple key logic. Everything I'm about to say might be half-baked bullshit! When it comes to Spirit logic it's hard to really be sure that anything you're saying is really true lol.

The first thing to understand is that the current Spirit key logic is not safe under ER. This is because you could access the dungeon in a non-repeatable way and spend a key without doing the checks that you need to do, and then lose access to the dungeon as that age. Then you could be in a situation where the intention is that the age you didn't spend that key as needs to spend a key to go and obtain the check, but you cannot since you've already spent the only available key. This was an impossible scenario back when Spirit logic was originally written as there was no way that the dungeon could be accessed that wasn't repeatable. If the logic were written now, with no knowledge of what came before, perhaps it would have been written in a way that was safe to work under ER?, who knows. But here's another example: If you go adult using a non-repeatable route, fill your only bottles with Big Poes, go back in time, lose access to adult, and then it turns out you're required to use your bottles to find the intended route to adult? You could also get stuck like this. Regardless of how you might guard against the Spirit Temple problem, is it even worth trying to guard against, considering all of the other ways you could get yourself into hot water with non-repeatable access? How would you solve this Big Poe problem? One idea is to remove any possibility of non-repeatable access to anything ever, which I think is not really reasonable or desirable to do. Besides a handful of weird edge cases of possible non-repeatability that would be annoying to discover and fix, of course you have the main culprit, bombchus. But per my thoughts on the chu bags PR, I don't think removing any possibility of going out of logic with them will actually make the Randomizer more fun to play. If you refuse to remove all non-repeatable access, this Big Poe situation is not really solvable without fundamentally changing the way that Big Poes work. Perhaps you could allow players to dump Big Poes. Maybe that could be good as it would allow you to stop requiring no-item access to the Poe seller. (Especially with pots shuffle now, it might be a good idea to allow that intense interior to sometimes be less available?) But I don't think we actually want to change the function of Big Poes like this. So at some point there's a trade off between what's fun more fun to play, and guarding against every unlikely scenario where a player could potentially get stuck.

So what to do about the Spirit key logic situation? Should we go out of our way to try and prevent this issue from ever being a problem? The only solution would be to get rid of the shared routes. Everything is either 5 keys and child access, or 3 keys and adult access (the two keys route relies on child access being repeatable). The problem with such strict key requirements is it severely limits where keys can go under own dungeon keys. In order to have enough checks to find 3 keys you would need to add a non-standard shuffle like pots or dungeons skulltulas, or access would need to be guaranteed as both ages (with at least 3 of 4 available checks being keys) before you could climb. And of course vanilla keys would be hopeless without giving players one key to start. And so I think it fails the fun/get-stuck trade off test. Not that many things really should be failing this text, but in this case I'd say the added item placement variety is worth this small risk.

I bring all of this up because, what happens if your access to Spirit from the boss door is non-repeatable? It doesn't matter which age you access it as now, if you spend a wrong key and you were intended to climb to the main room from below, you could potentially find yourself stuck. Any opening up of this entrance into the dungeon opens up additional risk of the shared age routes leading to dead ends. We've lived with this risk before but it will become potentially more prevalent now. Are we willing to live with this possibility? Again we could just get rid of the shared routes. If the dungeon turns out to be logically accessible from the boss door, key placement won't be hindered as much since that's a lot of checks opened up that could have keys. Without starting with any extras, vanilla keys would actually require the dungeon to be accessible from the boss door as well, which I'm not sure is something the entrance placement algorithm can currently handle. It would make sure the checks are reachable but it wouldn't realize there might not be enough of them to get the necessary keys.

But of course allowing child in from that door breaks some of our assumptions about how Spirit key logic works. The shared area checks are unaffected. (I mean of course we have to edit the logic to account for the fact that child could just jump down and get checks without needing keys.) Upper adult stuff isn't affected since worst-case key logic is already is already taken into account up there. The problems arise from checks on adult side that come in between the first two locked doors. Since child can unlock all doors now, those would all need to be increased to 5 keys. If we continue to assume that child access is repeatable, we could allow child to just obtain the checks in the event that child is able to get there and spend keys, and that way we wouldn't have to increase the key requirements in cases where child has the items necessary to do the check instead. 2-keys routes also wouldn't be affected if we assume repeatable child access, since those check for the child items and if child is there anyway child could just get the check and who cares about keys. Our current 2 keys routes can't apply under ER anyway though because at least currently we need ER off to confirm that bombchus are buyable. (At this time I've opted not to think about the Silver Gauntlets chest or Colossus access to determine whether or not those are affected.) Perhaps some test to know whether Spirit is accessible from the boss door could help us know when the increased key requirements are needed, but I'm not sure such a test can be made that would be robust enough to know that there's not some forever out of logic method that could be possible.

So, understanding how Spirit logic is a complete mess and not entirely safe even now, and that any change allowing you to come into the boss door is likely going to make things worse... if you're okay with making things worse, we might potentially be able to allow child to enter adult side and unlock these doors. We'd have to conditionally increase the key requirements in some cases (similar in concept to what's already planned for Shadow, but implementation will likely be more complicated). I think the best alternative might actually be to ban BOTH ages from coming in from the boss door.

In MQ Spirit, again adult coming into Spirit in a non-repeatable way from the normal entrance and the wasting keys is a potential issue even now. Boss door mixed pools adds potentially either age coming in from the boss door and spending keys as a possible a problem if that access from the boss door isn't repeatable. The potential fixes to these problems as the same as they were in vanilla, but allowing the shared access is not as important as it was there, since MQ has plenty of checks that could contain keys for own dungeon keys, and we already have to start with keys in vanilla keys. I haven't really considered removing the shared routes in MQ Spirit only because I felt it would be more consistent with vanilla Spirit to leave them around. But MQ has the advantage over vanilla that child coming in from the boss door and spending keys it is not especially problematic. You can unlock an extra door but adult doesn't have to go through key doors to get to the main room anyway. (I guess shortcuts enabled vanilla Spirit has that property as well. I probably should have kept that in kind back when I was thinking about vanilla key logic.)

Alright so with all that in mind. What do you think is the best way forward? I haven't taken the time to overthink Shadow Temple yet. Perhaps any conclusions drawn from there could affect the route we take with Spirit, since adding key requirements and starting with additional keys in on the table for both versions of that dungeon as well.

@r0bd0g
Copy link

r0bd0g commented Jan 28, 2023

I have no idea what I just said. Good luck parsing it.

@fenhl
Copy link
Collaborator Author

fenhl commented Jan 28, 2023

What determines whether the King Dodongo shortcut is on?

That was handled in #1641, not here, but if King Dodongo is in a dungeon, that dungeon's shortcut setting is used, and if he isn't, the shortcut is always closed.

Can you explain how saving inside boss rooms currently works in this PR?

If the boss is inside a dungeon, you load in at the start of that dungeon, same as before. Otherwise, the reverse of the entrance that leads to the boss is used. If that entrance is outside of a grotto, a nearby non-grotto entrance is used instead. If it's inside of a grotto (which can only happen in decoupled), the entrance chain is followed backwards until a non-grotto entrance is found.

I don't think savewarps should be allowed to cause sequence breaks and so if that's still possible, you should come up with some kind of solution.

This is outside my ability. I think it makes sense to put this feature on Dev-R for visibility and hope someone finds a solution. This is what was done with dungeons in grottos as well.

Could saving inside a dungeon get you permanently stuck inside the dungeon because the main exit doesn't lead anywhere?

I believe this can happen in decoupled, if two dungeons lead to each other. But that's not relevant to this PR.

If the boss door (or regular dungeon entrance if you can only come in from the boss door) leads to an interior or a grotto, where does saving inside there take you? (What if it's a special interior like Temple of Time or Dampe's Grave?)

Overworld spawn. I think it would be nice if this could be changed, but again, outside my ability.

The ER occurs between Boss Door and Boss Room regions from the bosses.json file, right? So I think the logic believes you can immediately go back through the boss door in Deku Tree without needing to use a shield to solve the scrubs puzzle. Maybe there's somewhere in crater the logic could expect you to refresh your timer or something, I dunno. So you have to move the shortcuts/shield check one entrance later.

Good catch. Same thing in Jabu. I think the proper fix here is to move the reverse entrance to point at the “Before Boss” regions, since the access is different for MQ Jabu.

If you go adult using a non-repeatable route, fill your only bottles with Big Poes, go back in time, lose access to adult, and then it turns out you're required to use your bottles to find the intended route to adult? You could also get stuck like this.

I have an idea for fixing this by replacing these kinds of checks (like ToT access as non-starting age and Poe seller access as adult) with a more correct system that accounts for nonrepeatable access. But that's a project for another day, and I don't see how it's relevant to this PR.

I bring all of this up because, what happens if your access to Spirit from the boss door is non-repeatable?

If we want to be safe (and personally I think that's a good idea), we could do something like automatically opening the shortcut when the player enters Spirit from the boss door.

But of course allowing child in from that door breaks some of our assumptions about how Spirit key logic works. […] Perhaps some test to know whether Spirit is accessible from the boss door could help us know when the increased key requirements are needed, but I'm not sure such a test can be made that would be robust enough to know that there's not some forever out of logic method that could be possible.

I think your initial idea of including this entrance in CHILD_FORBIDDEN is preferable. A test for boss door access as child amounts to a negative condition which I'm pretty sure is impossible.

@r0bd0g
Copy link

r0bd0g commented Jan 28, 2023

"I think the proper fix here is to move the reverse entrance to point at the “Before Boss” regions"
This won't necessarily work b/c those regions might not have the same name between versions of the dungeons. Even if they are the same, they could differ, sometimes I think they do. I think it's fine to put requirements to actually open the door on this region. As was done with boss keys. But of course, this requirement too, could differ between dungeons, whereas the boss door is usually locked by the same key in both versions. So honestly I'm not sure what the 'proper fix' even is. Perhaps this boss door region should actually be defined in the main dungeon file rather than in bosses.json, even if in most cases it will be identical.

@r0bd0g
Copy link

r0bd0g commented Jan 28, 2023

"I believe this can happen in decoupled, if two dungeons lead to each other. But that's not relevant to this PR."
It's kind of relevant because we're adding possible savewarp locations. And any solutions to existing savewarp issues might impact on the best way to handle savewarps in this PR.

I brought up the Big Poe thing because it's an example of a non-repeatable access issue that is difficult to solve that isn't related to Spirit temple. I felt it was decent context for deciding what to do with the non-repeatable access issues in Spirit, which mixed pools bosses will exacerbate.

I think we can make child access from the Spirit boss door work. A large chunk of the problems with it are shared with even allowing adult in from that entrance. If we ignore all of those preexisting problems, the only thing we really need to do is increase the key requirements in some cases if the settings might allow for entry from the boss door, maybe start with an extra key in vanilla keys, as is already planned for Shadow. It might be slightly more complicated in Spirit, but I think I can make it work. The test for -whether- you can come in from that entrance is not necessary, it would just be nice to not -always- have to increase the requirements for these settings. I don't expect such a test to actually be used. (That was a random suggestion that I should have left out of the post and wasn't really the point of what I was saying.)

"If we want to be safe (and personally I think that's a good idea), we could do something like automatically opening the shortcut when the player enters Spirit from the boss door."
This wouldn't solve it. The shortcut can't be used as child. So adult coming in in a non-repeatable way and wasting keys it wouldn't help child get into the main room if that what you have to do to progress. You'd have to also open it up for child or something? I don't think it'd be fun to simplify the Spirit experience by so much. I'd rather handle it some other way (or maybe not at all, if problems are not so likely to occur). The shortcut also doesn't even exist in MQ, so it couldn't help there.

@fenhl
Copy link
Collaborator Author

fenhl commented Jan 28, 2023

It's kind of relevant because we're adding possible savewarp locations.

Yes, but the existing issue in decoupled notwithstanding, you can always keep savewarping until you're at overworld spawn to get unstuck. So this PR doesn't fix the existing issue but it also doesn't add any new ways to get stuck.

I don't think it'd be fun to simplify the Spirit experience by so much. I'd rather handle it some other way (or maybe not at all, if problems are not so likely to occur).

That's fair. I don't have a good intuition about how likely this is to occur, but I'd either like to not handle it or handle it by including the entrance in ADULT_FORBIDDEN in addition to CHILD_FORBIDDEN. Unless you have a strong opinion for vanilla Spirit (you've said on Discord that it shouldn't be forbidden if Spirit is MQ), I guess I'd err on the side of caution.

@r0bd0g
Copy link

r0bd0g commented Jan 30, 2023

Thoughts about Shadow Temple key logic.

So all doors are going to need to have their key requirements increased by 1 to account for the back door being reachable early. This means that in vanilla keys we might sometimes have to start with an additional key. If dungeon shortcuts are on, we have already accounted for the final locked door being reachable early, and so we will not need to require nor start with any additional keys beyond what shortcuts already requires. (Maybe I should think harder about that last assertion, but it sounds reasonable enough, so I'm choosing not to.) Most of what I'm going to be saying from here on therefore only really applies to cases when shortcuts are off.

In ordinary Shadow, the locked door when coming from the boss room is encountered immediately. In MQ Shadow, however, the locked door leads only to a side room, and an additional vanilla key location is now available without unlocking any doors. This means we do not necessarily need to start with the extra key in MQ, however the back area of Shadow will be required to be reachable from the boss door, in order to make all three vanilla key locations accessible. If vanilla keys being placed is already taken into account when entrances are placed, there should be no issues with requiring this -- but it would be kind of lame.

But maybe in MQ there might be a way to neither require starting with an extra key nor require the back area be reachable. If you're in a position where you can unlock that back area door early, you're also in a position to obtain the vanilla freestanding key, as to do so requires no additional items beyond those required to reach the locked door. So we could opt not to increase the key requirements in MQ under vanilla keys. Problems could only arise if the back area of Shadow is reached in a non-repeatable way, and if the player for some reason unlocks the door without also obtaining the key that's right there for free.

You can take a similar approach in ordinary Shadow. Doing so seems a bit more complicated as you could only reduce the key requirement by 1 under vanilla keys in the event that the player has the items to progress from the locked door over to the invisible floormaster vanilla small key chest, but this is actually guaranteed, since explosives can knock down the statue and are also required to even reach the usual first key door. This of course also has non-repeatable access issues, and it's a bit more likely to be a problem since the player might not have the ability to reach the key at the time that they have the ability to unlock the door, so the chance of losing access without getting the key is higher. Since you need explosives to unlock the usual first door in both Shadows anyway, and out of logic bombchus are the main source of non-repeatable access, perhaps the non-repeatable access issues are not so much of a problem? So we could then maybe not start with the additional key even in ordinary Shadow. Doing so would not solve a problem the same way it would in MQ, where we would have to make a hard choice between starting with a key or forcing the back area to be unnecessarily reachable. In vanilla, the only alternative is to start with the key. This option is maybe not future proof for Master Sword shuffle, since I imagine explosives are probably not a great way to fight a floormaster without a sword.

This kind of logic, where we use some foreknowledge of check contents to reduce requirements, has sort-of existed in randomizer logic before, back when 'key for key' logic existed. That logic was purged from the randomizer for being dumb, and I for one am glad it's gone. (I'm a bit scared of where the final evolution of that kind of logic might lead, where vanilla keys almost has its own logic files where you can make all of these different kinds of assumptions only because you know exactly where the keys are located.)

I think everything I've said here is pretty consistent with what you've already done. But I think the case of MQ Shadow might need a second look. We are forcing the back area of Shadow to be reachable early, so that you can obtain the third key, that would only be required in the event that the back area of Shadow is reachable. That's weird and twisted. (A test to know whether it's actually possible to enter from that door would really be helpful here, but it doesn't seem we have that technology at this time.) Option 2, we could instead start with the additional key, same as vanilla does, and that would have some nice consistency to it I suppose, adding the key to both versions. I would like giving out a free item like this to be used only as a last resort, but maybe forcing the back area to be reachable for no reason is actually the worse alternative in this case? Or option 3 is to not require the additional key on any locks at all in vanilla keys, and if the back area is reachable from the boss door then we rely on the fact that there's a key very near to the problematic lock, and know that the odds that somebody actually gets into trouble with non-repeatable access is pretty low. I know this last option kind of has two problematic aspects, with logic relying on knowing the key locations and also introducing non-repeatable access issues, but players are generally not going to notice these details, so in some ways this third option might actually be the cleanest from the players' perspectives. I tried but struggled to think of a really good reason why this third option should only be implemented in MQ Shadow, so if it's what we go with, I feel like it would have to be implemented in ordinary Shadow as well.

Since now we're considering worsening the non-repeatable access issues in both Spirits, and potentially adding some in both Shadows, I want to bring up a third case where in the past we've had to adjust the logic to account for potential non-repeatable access. It's to do with raising the water back to the top level in ordinary Water Temple. If you need the water raised for child to do something, we currently confirm adult access if we're planning to use an adult item to reach the water level switch. But since adult needs to access the dungeon for the water to be lowered in the first place, we wouldn't actually need to check being an adult to use those weapons if we could be sure that access to Water Temple as adult would be repeatable. Bombchus are not necessarily the only way to create a problem, but it's probably the most prevalent? Even in a world where Bombchus are always repeatable I'm not sure if I want to start adding in repeatable access assumptions just whenever convenient.

I think starting with an extra key in both Shadows might be my current preference? Requiring the back area to be reachable is kind of lame. But then again so is giving away a key for free. And the logic is super jank if we do neither of those things. I need some opinions on this one.

One last thing. If Shadow is ordinary, mixed pools bosses are on, and shadow shortcuts aren't enabled, while dungeon pots aren't shuffled, maps and compasses aren't shuffled, and whatever else might be relevant in the first few rooms of ordinary Shadow aren't shuffled (say, silver rupees or enemy drops), with small keys and boss keys shuffled within their own dungeons, you need to take steps to ban the Shadow Boss Key from the Hover Boots and Early Silver Rupees chests, to ensure room for the small keys to be placed. We took similar steps with the first chest in MQ Forest -- you should look up that code and place this Shadow code nearby. I know this type of dead-ending of Randomizer's item placement is possible at a more general level, but when we can identify a reasonable settings combination with obvious problematic item placements like these settings have with the boss key in those checks, we usually do take steps to prevent seed generation failures.

@fenhl
Copy link
Collaborator Author

fenhl commented Jan 30, 2023

If vanilla keys being placed is already taken into account when entrances are placed, there should be no issues with requiring this

A potential issue is if bosses are only mixed with, say, grottos. In that case there would be no way to access the back of a dungeon from outside. I suppose we could adjust the mixed_pools_bosses helper to exclude those settings combinations, so the normal key requirements are used in those cases. The helper is only a placeholder in this PR but I'll update it accordingly on dev-fenhl so I don't forget when PRing the full feature to Dev-R.

I'm a bit scared of where the final evolution of that kind of logic might lead, where vanilla keys almost has its own logic files where you can make all of these different kinds of assumptions only because you know exactly where the keys are located.

That sort of thing is required to some extent in order to make the “Shuffle Items” setting work anyway. Take a look at ordinary Fire, Water, and Spirit on dev-fenhl if you're interested. (Haven't gotten around to adding MQ support yet.)

Or option 3 is to not require the additional key on any locks at all in vanilla keys, and if the back area is reachable from the boss door then we rely on the fact that there's a key very near to the problematic lock, and know that the odds that somebody actually gets into trouble with non-repeatable access is pretty low. I know this last option kind of has two problematic aspects, with logic relying on knowing the key locations and also introducing non-repeatable access issues, but players are generally not going to notice these details, so in some ways this third option might actually be the cleanest from the players' perspectives.

I think I agree here.

One last thing. If Shadow is ordinary, mixed pools bosses are on, and shadow shortcuts aren't enabled, while dungeon pots aren't shuffled, maps and compasses aren't shuffled, and whatever else might be relevant in the first few rooms of ordinary Shadow aren't shuffled (say, silver rupees or enemy drops), with small keys and boss keys shuffled within their own dungeons, you need to take steps to ban the Shadow Boss Key from the Hover Boots and Early Silver Rupees chests, to ensure room for the small keys to be placed.

Done.

@r0bd0g
Copy link

r0bd0g commented Jan 30, 2023

Did you just ban the forest BK from shadow temple?

I want to point out also that if there were a setting for vanilla Hover Boots? Own dungeon keys gets into even more trouble. Not sure if such a setting planned.

If we rely on knowing the small key locations in shadow. I have to wonder what kind of nonsense could come from relying on knowing the spirit key locations. I haven't thought about it at all, maybe it's nothing, but I really don't want to have to think about it lol.

@fenhl
Copy link
Collaborator Author

fenhl commented Jan 30, 2023

I suppose we could adjust the mixed_pools_bosses helper to exclude those settings combinations, so the normal key requirements are used in those cases.

I ended up adding a separate helper instead since the existing helper is also used for things like changing how compasses giving info works.

Did you just ban the forest BK from shadow temple?

I swear I'm awake 🙃

I want to point out also that if there were a setting for vanilla Hover Boots? Own dungeon keys gets into even more trouble. Not sure if such a setting planned.

It's planned, but I think it's supposed to be tied to also not shuffling anything else (i.e. a generic “Shuffle Items” setting which when turned off disables all the other shuffle settings) so I don't think it would cause any issues here.

@Hexocyte
Copy link

Could you have the forward connections come from "Boss Door" regions and the reverse go to "Before Boss"? Glitch logic will need the exits to the boss rooms to be in their own regions for boss key skips, and it'd be more confusing if those regions were called Before Boss.

Making them asymmetric like that would allow glitch logic to include reaching the end of the dungeon by doing a boss key skip and then exiting the boss room back into the dungeon. And it would also allow glitch logic's BK skips to be compatible with mixed/decopuled bosses. I don't know if @DuskTheUmbreon wants to implement those things, but it's good to have the possibilities open.

Also that way it wouldn't break plandos or spoiler log tools that use the old entrance regions, if any exist.

@cjohnson57
Copy link
Collaborator

Can anyone summarize the current status of this PR?

@r0bd0g
Copy link

r0bd0g commented Feb 18, 2023

I reviewed the logic. Issues that I raised in MQ Spirit have not been addressed (some of what I said is slightly incorrect due to probably logically needing Hovers for this one spot). But it has a larger problem in that entering from the shadow and spirit boss doors introduces a lot of weird issues that I don't know what should be the best way to resolve them (slight issue in MQ Jabu as well). (Unfortunately you have to read this whole conversation to understand what the dilemmas are, which is easier said than done.) Once those decisions have been made I plan to review it again.

@r0bd0g
Copy link

r0bd0g commented Feb 25, 2023

I can't remember if this has been answered: What do Barinade pots count as for dungeon/OW pot shuffle? Are grottos/interiors able to adapt any skulltulas inside those to be considered part of the dungeon for dungeon skull shuffle?

@fenhl
Copy link
Collaborator Author

fenhl commented Feb 25, 2023

I can't remember if this has been answered: What do Barinade pots count as for dungeon/OW pot shuffle?

Dungeon pots.

Are grottos/interiors able to adapt any skulltulas inside those to be considered part of the dungeon for dungeon skull shuffle?

No, they're always considered overworld skulls.

@fenhl
Copy link
Collaborator Author

fenhl commented Feb 28, 2023

Looking at this again it might be best to forbid access to Shadow and Spirit from the boss doors regardless of age or MQ for now, and possibly lift those restrictions in follow-up PRs if we can identify situations where we're certain nothing breaks.

@fenhl
Copy link
Collaborator Author

fenhl commented Feb 28, 2023

I'm going to go ahead with this change. I've preserved the current state of the PR at https://github.com/fenhl/OoT-Randomizer/tree/mixed-pools-bosses-logic-v1 in case we want to reference it later.

@r0bd0g
Copy link

r0bd0g commented Mar 3, 2023

You still need to address the issue of going from DC MQ Mouth to Before Boss. The parts to do with exploding a bomb flower using an Armos (Sticks through Slingshot) is currently only relevant if logic_dc_mq_eyes_child is enabled. If you can come in through the boss door, you might need to perform that Armos stuff without having any trick on. A separate trick could be added now but it doesn't really make sense to have it as a separate trick on main branch b/c of how infinitely easier it is to perform than lighting the eyes with strength as child. I guess I would suggest checking for the child light the eyes trick again, which would be redundant on main branch, and on mixed pools won't make much sense it using the Armos doesn't have a lot to do with lighting the eyes. It'll just be there as a stand-in until mixed pools comes to main and we'll be ready to make it a separate trick.

Also, if you never blow up the wall in the entrance of DC, the bottom of the dodongo mouth remains invisible, which would be pretty weird. I think because the cutscene is skipped perhaps this never occurs in rando? You should double-check I guess, if you haven't.

I think the use of swords on the vanilla Jabu near boss skull is probably too unintuitive.

MQ Jabu slimy thing: When I did testing, if you took damage, you always got blasted all the way to the bottom. It was nothing to do with Nayru's, you always get blasted. What did you try that you didn't get blasted? I'm testing this on 1.2, so I wasn't able to test if something different happens if you go through the doors at the very edges. At the edges I could see you landing on the very edge of the ground or even not going in far enough to hit the slimy thing at all, but regardless I wouldn't put that in logic. I was able to stay up there by wearing the Iron Boots. I have doubts about that really being safe for default logic either. I'm also not okay with forcing people to set up a death abuse in order to stay on the ledge to get the chest. So fairies I think should logically blast you down too... except honestly I'm not sure I want to allow fairies here at all. It's actually possible, if you stand in the right spot, to go through the door and not end up touching the slimy thing. You want to go through toward the side, and then back up from the door a bit. If you do that, then you can damage through the sides to stay up there. Still not safe for default though.

I checked in GZ. The Forest elevator DOES work properly when coming in from the boss room, if it has been activated normally. If it's not working properly in rando, you should take steps to figure out why. With dungeon shortcuts enabled, it should be usable. Did you check? You need shortcuts enabled to even reach the elevator early from the boss door anyway. If it doesn't work, it might be something weird with how we've set up the shortcut. But it's definitely a rando bug in that case that would need to be fixed. Also, you need to consider enable useful cutscenes when testing that the elevator works properly. Before witnessing the poe cutscene, this elevator also should work from the bottom, though of course you would still need shortcuts enabled to get past the basement gate to reach the elevator in glitchless play (not sure about glitched). (Did anybody actually ever check what happens if useful cutscenes and shortcuts are both on?) Fixing this elevator (or leaving it working if it currently works in any context where it could be accessible early) introduces a non-repeatable access issue with MQ Forest. Suppose you find 1 key, you access shortcut-enabled MQ Forest from the boss room in a non-repeatable way, and then spend that key. Now you can't use it to enter the main room of forest in the normal way. So the key requirement for that first door would need to be increased to 6 if the dungeon is accessible from the boss door. Yes, here we go again. And so shortcut enabled MQ Forest will also need access from the boss door banned. After hearing that you might be tempted to leave the elevator broken. What's even the point of fixing it if you can't use it, lol. For consistency with the state that we will be leaving Shadow and Spirit, I think I suggest fixing it and banning entry into shortcut MQ Forest anyway. At least the elevator then will work in vanilla forest, where it poses no issues and does allow you to bypass that skulltula in the first hallway.

I still completely disagree with allowing can_take_damage as a means to get past this skulltula in the basement of MQ Forest. We have not used damage in the past to get through skulltulas. To be consistent, we'd have to go through all of the other skulltulas and at least add Fairies to all of them. (Getting past with fairies might even be a clip if you do it in a certain why, not sure.) It's just nuts or sticks, you can probably get those somewhere, so I don't think we should worry about it. (You can also sneak past. Or use roll invincibility. Maybe we don't even need to check for anything?)

I noticed the exit from vanilla fire before boss to near boss doesn't do anything b/c the requirements are strictly greater than savewarping to the entrance and going from there to near boss.

@fenhl
Copy link
Collaborator Author

fenhl commented Mar 3, 2023

Also, if you never blow up the wall in the entrance of DC, the bottom of the dodongo mouth remains invisible, which would be pretty weird. I think because the cutscene is skipped perhaps this never occurs in rando? You should double-check I guess, if you haven't.

This does not occur in rando. You could have checked that yourself before posting this.

Jabu slimy thing: When I did testing, if you took damage, you always got blasted all the way to the bottom. It was nothing to do with Nayru's, you always get blasted. What did you try that you didn't get blasted?

I tested on OHKO so the fairy revived me.

except honestly I'm not sure I want to allow fairies here at all.

Why not?

I checked in GZ. The Forest elevator DOES work properly when coming in from the boss room, if it has been activated normally.

It works in rando as well. I guess I forgot to check with shortcuts when I originally wrote this.

Did anybody actually ever check what happens if useful cutscenes and shortcuts are both on?

The shortcut supersedes the useful cutscenes patch for Forest.

@r0bd0g
Copy link

r0bd0g commented Mar 4, 2023

In MQ Jabu you also have to move the != ohko check, since you're definitely getting blasted down. Moving the Fairy was the right call since I don't want to call for a death abuse to stay up there. With fairy, I don't like the way that you can just get up and walk around inside the hitbox. I'm just worried about how clip-adjacent fairy is, even though technically we're already clipping, fairy or no. This clip isn't as bad though since this hitbox only boosts you in one direction. I guess the problem with fairy is that it could allow you to go the other way through it, from outside into the before boss door, which is definitely a clip and definitely not allowed. I kind of don't want fairy to be used then, to go either way through it, for that reason.

(I just had an idea that maybe we could reverse the direction the tentacle boosts you, if you come in from the before boss door. That would keep you by the door and never allow you to boost through. I wonder if that could be the actual cleanest way to handle it? 'Just' have to turn that actor around depending on where you enter from.)

@r0bd0g
Copy link

r0bd0g commented Mar 4, 2023

That's all I got for logic review then until time to address some more of the issues.
(Fingers crossed no mistakes between the merges of this and silvers shuffle.)

@fenhl fenhl mentioned this pull request Mar 27, 2023
11 tasks
@fenhl fenhl removed the Status: Needs Review Someone should be looking at it label Mar 27, 2023
@cjohnson57 cjohnson57 merged commit cf44e86 into OoTRandomizer:Dev May 7, 2023
3 checks passed
@fenhl fenhl deleted the mixed-pools-bosses-logic branch May 7, 2023 00:48
@fenhl fenhl added this to the 8.0 milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Logic Non-trivial changes to the JSON logic files Component: Misc A catch-all label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Water Temple entrance from Morpha boss room
7 participants