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

Timespinner: New options from TS Rando v1.25 + Logic fix #2090

Merged
merged 49 commits into from
Nov 22, 2023

Conversation

Jarno458
Copy link
Collaborator

@Jarno458 Jarno458 commented Aug 7, 2023

What is this fixing or adding?

A logic fix for Sealed Caves

2 new options

  • "EnemyRando": randomize enemies in rooms
  • "PresentAccessWithWheelAndSpindle": allow using wheel + spindle in inverted seeds to warp to present in refugee camp

2 new floodable areas:

  • Lab
  • Lake Serene Bridge

How was this tested?

Ran 100 generations locally, checked a few spoiler logs
Is Available as .apworld and has been run by a few community members

Included #2373 & #2374

@ThePhar ThePhar added is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. is: enhancement Issues requesting new features or pull requests implementing new features. labels Aug 16, 2023
@black-sliver
Copy link
Member

black-sliver commented Sep 15, 2023

I have 2 comments:

  • it would be nice to get logic fixes and feature additions in separate PRs. Not sure if we want to merge this into the upcoming release as it is (because that was supposed to be bug fix only).

  • not a blocker, but there is potential performance gain in short circuiting the conditions in the lambdas:

lambda state: state.has('Water Mask', player) or not flooded.flood_lab)

would most likely be faster when written as

lambda state: not flooded.flood_lab or state.has('Water Mask', player))

because the flood lookup is always faster and more likely to be false (because it'd be false for default settings AND for 67% of the default random flooding)


EDIT: what would be even faster is setting the rule based on flooded.flood_lab rather than checking it in the lambda

@Jarno458
Copy link
Collaborator Author

I agree on swapping those parameters, I did that also in the past. Timespinner is already rather fast on generation

However setting the rule based on the flag, while fasterm it likely wont make the code any more readable and be a very high risk change as it should be done for all those logic rules. I don feel comfortable to make that change atm for the very small performance gain it will likely give

@Jarno458
Copy link
Collaborator Author

Iv updated the parameter order, as for when to merge this. not up to me, but this PR was already created before 0.4.2 was live, its not a bugfix for something that added in 0.4.2 its a bugfix for things added in 0.4.1

@Jarno458
Copy link
Collaborator Author

Included #2373 & #2374

Copy link
Member

@black-sliver black-sliver left a comment

Choose a reason for hiding this comment

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

Looks good other than the two small things below.

How much was this tested?

regions: Dict[str, Region] = {}

for name in region_names:
regions[name] = create_region(world, player, locations_per_region, name)
Copy link
Member

Choose a reason for hiding this comment

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

locations_per_region seems to be unused?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

its used, its passed on into the create_region method that will create the locations that belong to that region inside it

worlds/timespinner/Regions.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@alwaysintreble alwaysintreble left a comment

Choose a reason for hiding this comment

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

Could probably use some optimization but I know you're already working on that and moving to the new options API so lgtm

@@ -39,21 +39,19 @@ class TimespinnerWorld(World):
option_definitions = timespinner_options
game = "Timespinner"
topology_present = True
data_version = 11
data_version = 12
Copy link
Collaborator

Choose a reason for hiding this comment

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

would probably be better to just remove this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if we already can remove that?

@Jarno458
Copy link
Collaborator Author

Looks good other than the two small things below.

How much was this tested?

Well the new options have been available as an .apworld for a couple on months now. didnt get complains about that, but hard to tell how much people actually used it

As for the generation and optimizations i tested those locally be generating atleast 50 times using a random yaml to hit different combinations of options

@Jarno458 Jarno458 marked this pull request as draft November 2, 2023 10:49
@Jarno458
Copy link
Collaborator Author

Jarno458 commented Nov 2, 2023

Drafted becase a potentional logic error was found

@Jarno458 Jarno458 marked this pull request as ready for review November 2, 2023 20:12
@Jarno458
Copy link
Collaborator Author

Jarno458 commented Nov 2, 2023

Fixed small logic bug, put back in ready for review

@ThePhar ThePhar merged commit d1b2293 into ArchipelagoMW:main Nov 22, 2023
12 checks passed
@Jarno458 Jarno458 deleted the ts_updates_mid_2023 branch November 22, 2023 14:18
Jouramie pushed a commit to Jouramie/Archipelago that referenced this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. is: enhancement Issues requesting new features or pull requests implementing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants