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

Core: An attempt at fixing the new connect_entrances bug #4529

Closed

Conversation

NewSoupVi
Copy link
Member

@NewSoupVi NewSoupVi commented Jan 21, 2025

In #4420, we added a new step called connect_entrances.
The description of this step reads: "By the end of this step, all Entrances must be connected".

However, there are some worlds that are relying on other worlds not having any dangling entrances in set_rules (which is before connect_entrances).
The culprit here is get_all_state, which does region sweeps on all worlds.

This is my attempt at a fix. Only 1 line needs to be changed in Factorio and ALTTP each, but I also wanted to add protection against this happening to unsupported worlds.

This PR also serves as the "release blocker" PR, but this label does not mean this particular implementation is what we want to go with

Other options:

  1. Don't do this with an assert, do it with a unit test (Counter argument: This would only catch default options)
  2. Change the documentation of connect_entrances to say that Entrances must be connected somehow after create_items, but their final connection must be done by connect_entrances
  3. Revert the connect_entrances PR for now? But it's very necessary for GER and plando rewrite

@github-actions github-actions bot added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Jan 21, 2025
@NewSoupVi NewSoupVi added is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. affects: release/blocker Issues/PRs that must be addressed before next official release. and removed waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Jan 21, 2025
@NewSoupVi NewSoupVi added the waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. label Jan 21, 2025
@Exempt-Medic Exempt-Medic added the waiting-on: world-maintainer Issue/PR is waiting for feedback or approval by the maintainer of a world. label Jan 21, 2025
@NewSoupVi
Copy link
Member Author

NewSoupVi commented Jan 21, 2025

I'm a bit uncertain of the best approach, for now I wanted something open that passes unit tests, fixes the issue, and can carry the "release blocker" label. What I mostly hope to get from other core maintainers or ppl like alwaysintreble or Mysteryem is opinions on the approach.

We can also just revert #4420 for now. I just want to stress though that connect_entrances is GIGA important for upcoming GER / plando changes, to the point where I basically don't wanna merge any GER implementations until connect_entrances exists

Copy link
Collaborator

@BadMagic100 BadMagic100 left a comment

Choose a reason for hiding this comment

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

is an enforcement mechanism even needed here? If we fix it everywhere it's relevant then going forward the docs which state entrances must be connected only by connect_entrances should imply that worlds need to worry about it

Assuming there will be one anyway I don't have an opinion on what it should be

allow_partial_entrances
or "connect_entrances" in self.completed_world_stages
or "generate_basic" in self.completed_world_stages
# Worlds have unit tests that don't call connect_entrances because they were written before it was added
Copy link
Collaborator

Choose a reason for hiding this comment

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

This definitely feels super hacky, I would rather try to update the tests if relevant than do this and shoot ourselves in the foot in the future somehow

Copy link
Collaborator

Choose a reason for hiding this comment

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

(specifically referring to the generate_basic part of the assertion fwiw)

Copy link
Member

Choose a reason for hiding this comment

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

I said a similar thing in DMs, but gonna state here that I fully agree with BadMagic's comment

@BadMagic100
Copy link
Collaborator

I also feel that option 2 (make dummy connections) also seems quite bad.

It would probably be helpful to know why they care about other worlds' region graph - do they actually use it or is it just the state sweep getting extra? If the latter, we may also consider looking into #2427 again

@NewSoupVi
Copy link
Member Author

NewSoupVi commented Jan 21, 2025

It's because they use get_all_state, which performs sweeps & which we don't have a per player version of.

@BadMagic100
Copy link
Collaborator

Yeah so then I think #2427 is the real long term solution here. Whether it's feasible to actually wrap that up idk, as it's been waiting on treble forever now. GER would also benefit from this for larger multiworlds

@NewSoupVi
Copy link
Member Author

We could probably actually just steal get_singeplayer_all_state from that PR, it's all we need for now

@NewSoupVi
Copy link
Member Author

NewSoupVi commented Jan 21, 2025

Closing in favor of #4530

@NewSoupVi NewSoupVi closed this Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. affects: release/blocker Issues/PRs that must be addressed before next official release. is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. waiting-on: world-maintainer Issue/PR is waiting for feedback or approval by the maintainer of a world.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants