-
Notifications
You must be signed in to change notification settings - Fork 701
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: Plando Items "rewrite" #3046
base: main
Are you sure you want to change the base?
Conversation
the test is still busted, but now it actually plandos the items
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
It seems like this removes the ability to have plando blocks without any locations listed. For example, so that specific items end up in specific worlds. Is the intended workaround to use |
count = new_block["count"] | ||
failed(f"Plando count {count} greater than locations specified", block.force) | ||
new_block["count"] = len(new_block["locations"]) | ||
new_block["count"]["target"] = multiworld.random.randint(new_block["count"]["min"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is actually already an error on main
, but it might be worth mentioning here anyway: If either of the two above if
blocks trigger, new_block["count"]
becomes an int, so min
and max
don't exist and generation fails with TypeError: 'int' object is not subscriptable
on this line (880)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump, I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely thought I had changed that already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you totally might have, you just never replied. I can check again XD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it is definitely unchanged.
I believe I missed this usecase (plando items guide doesn't mention it, and it's built into |
Disclaimer: I have not looked at the code yet It might be worth considering and documenting/fixing possible negative interactions with #3032 if you haven't already I'm also curious about how pre_fill is impacted as it may affect generic ER |
Some people use plando when they WANT to make something that will be seen as unbeatable according to the logic. |
It might still be possible, but current methods (such as locking the item behind a location that logically requires it) will no longer work. It should be noted that this doesn't prevent impossible combinations (that usually end in fill error) such as filling your entire sphere 1 with junk. |
This should be fine, as we use the actual instance of the item instead of creating a new item and then removing using that. It's definitely worth testing though. It appears that any world that uses pre_fill to place items that are not in the itempool must also define get_pre_fill_items so that the state used for plando can account for those items. |
List of worlds that implement
Worlds that implement
I will need to check all of these later to confirm if this is the proper reason for some worlds having issues. |
I opened a PR including/addressing my comments and also some discussion in ap-core-dev on the item group unrolling methods |
I'm going to put my concerns on this PR so that they're documented somewhere. I don't like that this is trying to make "Event Plando" work. At first, it looks like one upside and one downside. But I don't even actually think the "upside" is a genuine upside.
I am extremely uncomfortable with the world where a world dev says "I want to shuffle my major event items, but I also want the user to be able to plando them" and the suggested solution is "Use ItemPlando, and subclass it with a docstring to explain it", and suddenly we have 5 games that rely on this behavior and can never go back on it. And then we realize we didn't account for "world: null" or something. No no no no no :( It should be "Here's how you can make your own custom plando option for your local randomization" This is essentially me saying: I do not approve. However, Berserker has already approved the PR, so maybe this is too late or I'm outvoted here. |
The problem is that event plando is already a usecase supported by core and is being used by worlds. Removing it requires adjusting even more worlds, or removing functionality. |
This is already the case with plando, not every item/location that we can plando to are in datapackage. |
Aren't the only exceptions to this events? |
I would actually like to do this. But dropping a feature is obviously a taller ask, I get that. For the sake of completeness, could you provide an example of a world that currently supports & uses this? Or ideally if you have the full list of supported worlds, but I don't expect you're just gonna have that on hand lol |
Admittedly, I'm pretty sure it's just A Link to the Past at the moment. But it being supported there is much stronger on the intent, given it is a world maintained by a core maintainer. |
If there is an example of a supported world losing a currently working feature if event plando is dropped, then I'm going to revoke my disapproval, but I will still strongly discourage future use of this feature & if I have time, push for a removal of the feature in a followup PR changing those worlds. (Essentially, I will considered it "grandfathered" - The first thing I'd probably do is open a PR that makes it output a warning) Edit: Sniped |
I was seeing Berserker's review as just the a review of the LTTP changes, since that's how his review was requested - not of the PR overall.
And that links to the LTTP line in codeowners I could be misunderstanding though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More just putting this here to remove my approval, but this has conflicts and, for me, is waiting on at least Silvris#12 and potentially Silvris#11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comments were addressed. I do think there should be some discussion (maybe even a poll?) on how to unfold groups (especially item groups). I did some testing with various yamls and plando configurations, certainly not enough overall but 🤷 not exactly the easiest thing to test all the states for. The timing/location of all the value/type checking is a bit of a mess, but it was like that beforehand and was missing quite a lot of it anyway.
Basically just https://discord.com/channels/731205301247803413/731214280439103580/1306329230392692757
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
maybe do this for the others? out of scope here though
It doesn't look like this rewrite fixes Targetting |
FWIW, this is known. To me, with the number of changes already in this PR, I'm not sure how well adding more in will go. I think Silvris was waiting until after this since it would require some pretty significant changes to the way candidate locations work or adding player-specific locations for early/non-early which would also be a good bit of extra work/code |
While I'm not necessarily against doing this change in this PR, I think scope here has already gotten way out of hand, and the changes would be much easier to review isolated (especially with the amount of review having already gone into this PR). The idea I have to fix it effectively is a rewrite of the locations handling to be str-int pairs of location/player, which needs to be adjusted in a number of places. |
@@ -114,6 +114,14 @@ def set_rules(self): | |||
def create_regions(self): | |||
create_regions(self.multiworld, self.player) | |||
|
|||
def get_pre_fill_items(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raft's pre_fill
has been removed as of a948697
What is this fixing or adding?
This PR is the combination of three major changes to plando items.
fill_restrictive
, which means plando should be capable of avoiding placements that can never result in a playable worldHow was this tested?
Manually via generating games with yamls using plando items. Opening as draft since any game using pre_fill will need thorough testing with this approach (KDL3 was already found to be bugged).
Ran unittests, but more unittests should likely be added.