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

Landstalker: implement new game #1808

Merged
merged 59 commits into from
Nov 25, 2023
Merged

Landstalker: implement new game #1808

merged 59 commits into from
Nov 25, 2023

Conversation

Dinopony
Copy link
Collaborator

@Dinopony Dinopony commented May 11, 2023

What is this fixing or adding?

This adds Landstalker - The Treasures of King Nole to Archipelago. This is a unique isometric ARPG with a well-built open world that fits well into Archipelago set of games.

image

This only contains the AP world, since the client is an external program:

https://github.com/Dinopony/randstalker-archipelago

ls_guide_client

How was this tested?

This was tested extensively with a group of friends over dozens of seeds (both LS-only and with multiple games), which allowed to squash all the bugs that could be found.
All unit tests pass.

Dinopony added 30 commits April 16, 2023 16:24
- Improved shop pricing of remote Landstalker items
- Changed item name
- Updated logic
@Dinopony
Copy link
Collaborator Author

Dinopony commented Sep 9, 2023

I think pretty much everything was solved or discussed, and I also fixed a small edge-case problem encountered by a user who tried the APWorld.
Please let me know if anything needs to be done from now on.

@Berserker66
Copy link
Member

image
huh, that's the first time someone didn't give us permission to do that.

@Dinopony
Copy link
Collaborator Author

Dinopony commented Oct 3, 2023

image
huh, that's the first time someone didn't give us permission to do that.

That's weird, I don't remember having touched the security settings of my fork. I'll have a look

@Dinopony
Copy link
Collaborator Author

Dinopony commented Oct 3, 2023

It should be good, branch is not protected anymore 👍

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.

still one or two more things that need to be addressed i think but otherwise it's good. sorry for being so late with this review. would definitely recommend updating to the new options api and adding some tests too.

option_definitions = ls_options
topology_present = True
data_version = 1
required_client_version = (0, 3, 8)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this correct?

game = "Landstalker - The Treasures of King Nole"
option_definitions = ls_options
topology_present = True
data_version = 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

This has been deprecated for a while now so can be removed

self.can_fill_slot_data.wait()

# Put options, locations' contents and some additional data inside slot data
slot_data = {option_name: self.get_setting(option_name).value for option_name in ls_options}
Copy link
Collaborator

Choose a reason for hiding this comment

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

we have self.options.as_dict now


add_specific_paths(multiworld, player, regions_table)

return regions_table
Copy link
Collaborator

Choose a reason for hiding this comment

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

as far as i can tell this mapping is just so you can reference the actual regions from the internal names right? it's been a while since i looked at this, sorry 😓 before i think this would've been fine, but now there's a new caching mechanism on main, so it'd be more efficient for you to just refer to your already existing mapping of internal name to actual name and call get region as needed, instead of creating a cache of them. if you're doing this specifically because you're unsure if the region itself actually exists, then it'd probably need to be tested, but my gut says it'd still be a bit faster to just try, except get those regions than create this mapping.


def add_specific_paths(multiworld: MultiWorld, player: int, regions_table: Dict[str, LandstalkerRegion]):
# If Gumi boulder is removed, add a path from "route_gumi_ryuma" to "gumi"
if multiworld.remove_gumi_boulder[player].value == 1:
Copy link
Collaborator

Choose a reason for hiding this comment

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

there's still some more of these comparisons to integers that don't really mean anything

from_region = regions_table[from_id]
to_region = regions_table[to_id]

entrance = Entrance(player, name, from_region)
Copy link
Collaborator

@alwaysintreble alwaysintreble Oct 30, 2023

Choose a reason for hiding this comment

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

if the helper returned the created entrance i think this would solve this issue for you, right? currently i don't think it returns anything so that should be perfectly fine, and make this quite a bit more readable.
edit: #2406 if you want to test it for me :)

entrance.access_rule = make_path_requirement_lambda(self.player, [], [self.regions_table['tibor']])

def set_rules(self):
Rules.create_rules(self.multiworld, self.player, self.regions_table, self.dark_region_ids)
Copy link
Collaborator

Choose a reason for hiding this comment

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

if typing.TYPE_CHECKING

if location.parent_region.name in EXCLUDED_REGIONS:
location.progress_type = LocationProgressType.EXCLUDED

def get_starting_health(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

what i meant was line 119 where this is actually called

sphere_count = len(spheres)
for sphere in spheres:
for location in sphere:
if location.player != self.player or location.type_string != 'shop':
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be and? you're calling this method per player

Copy link
Collaborator

Choose a reason for hiding this comment

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

alternatively, use stage_post_fill to do this for all landstalker players at once. get_spheres() isn't cached, so calling it multiple times is very expensive.

Copy link
Collaborator

Choose a reason for hiding this comment

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

the caching part is addressed with #2410, but i still think just looping through it a single time for all landstalker worlds should be more performant, if possible.

@Dinopony
Copy link
Collaborator Author

Hey,
The PR has been on for 6 months now, it's been working exactly the same as it is now, I took the time to adjust many style mistakes per your recommendations (which I'm thankful for), but I feel like I'm done with it.
If there are absolutely needed adaptations to keep it working I'll obviously be there to maintain it, but I'm done polishing style for a code that'll barely ever be read by anyone.
Feel free to tell me if there still are absolutely required changes, otherwise I don't have enough time for this and I'll just move on.
Thanks 👍

@ThePhar
Copy link
Member

ThePhar commented Nov 23, 2023

I have left a PR on your main branch which includes my remarks and most changes I would have requested anyway. Please let me know once you have reviewed them and I'll revisit this PR.

Dinopony#1

@ThePhar ThePhar self-assigned this Nov 24, 2023
@ThePhar ThePhar merged commit d46e68c into ArchipelagoMW:main Nov 25, 2023
12 checks passed
@ThePhar
Copy link
Member

ThePhar commented Nov 25, 2023

When possible, should still increase BASE_ID, but this should be fine to at least start testing in upcoming RCs.

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: new game Pull requests for implementing new games into Archipelago.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants