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

Shivers: Implement New Game #1836

Merged
merged 79 commits into from
Nov 24, 2023
Merged

Shivers: Implement New Game #1836

merged 79 commits into from
Nov 24, 2023

Conversation

GodlFire
Copy link
Collaborator

@GodlFire GodlFire commented May 24, 2023

What is this fixing or adding?

Adds Shivers as a new game.

How was this tested?

Dozens of sync/async games both shivers only worlds and any supported games worlds. Tested on 0.4.3.
Ex of games using shivers:
-https://archipelago.gg/tracker/u2_BI_dwRECO1xYPbdWn5A
-https://archipelago.gg/tracker/p99AFmWQSVal44Mlsn_TTg
-https://archipelago.gg/tracker/OtVLg7qGQ4K1rg01Fqoeig
-https://archipelago.gg/tracker/P1_FFoxuTfmFRvDQDtxY-A
-https://archipelago.gg/tracker/NbvQ1gzbQoSlyBydRLKooQ
-https://archipelago.gg/tracker/08D7KsNEQXqSwUe7ftP3lA
-https://archipelago.gg/tracker/OEn5QdJAQGWvufIzehTgqQ

If this makes graphical changes, please attach screenshots.

N/A

GodlFire and others added 30 commits March 24, 2023 22:30
Added a few archipelago files
Added mandatory connections
Added rules file
Testing out events
…e they are received from a check.

Added fill_restrictive to determine where the pots will be placed once they are received from a check. Still need to add rules.
-Fixed fill restrictive
-Added some slot data
-Fixed typo in item Metal Pot Top
-Fixed type in location name for museum blueprints
-Force crawling to be placed locally in the library
-Added rules for placement of pot pieces
-Changed location IDs to 20000 instead of 42000
Added rules to ensure you have access to the puzzles clue
Fixed typo in metal pot top dupe
Fixed slot data to use the correct data
Added checks for ixupi captures
Fixed all generation issues except 1, locally placed crawling is being overwritten somehow every once in awhile.
…d local placed crawling selecting a storage location as a location

Moved item creation out of generate basic and into create_items.
Fixed local placed crawling selecting a storage location as a location
Set key for underground lake room as early item
-Put key for office elevator in sphere 2
-Fixed bug with pot piece in theater being unobtainable
Added easier lyre filler item
Added final riddle as checks
Rewrote the rules to be more readable and easier to use
Removed zip
…nce until room shuffle

Minor change to water capture logic, shouldnt actually make a difference until room shuffle
-Fixed unwinnable seeds with items behind tar/cloth without having access to their pots
-Added locations for puzzle hints/solutions
-Pushed keys for underground lake, elevator, lobby into local sphere 1. Will add as an option in future to have unchanged/early/early local
Added filler items for ixupi availability.
Bedroom Room is now just Bedroom
This is setup instructions to the best of my knowledge for the GOG version of Shivers
Removes redundancy in text
-Option for lobby access. Can be normal, early, local.
-Excluded locations added to slot data
-Added instructions for disc copy of shivers
-Added information for .yaml files, generating a single-player game
Fixed bedroom room that was not fixed in the rules file
…ment

-Fixed DUPE pot pieces ending up in other worlds.
-Added Game page document
GodlFire and others added 15 commits August 20, 2023 08:25
Fixed key for front door not being set to local when in local mode
Merging in 0.4.2 release to Shivers fork
Updated to use new self.random
Minor update to doc
minor update to doc
This adds key requirements for unexpected paths such as Torture to Invention now requires the Torture key.
I ignored all dead-end rooms such as janitor, workshop and bedroom.
I also didn't adjust anything for puzzle doors like burial door, red door and Clock Tower Staircase
Key rule prep for room rando
Adds new filler item heal and replaces the extra easier lyres that were in the pool with the new heal filler
-Added option to have elevators as checks
Fix unit test for completion condition by moving completion condition from generate output to generate basic
-Fixed a failure to generate when not using elevator checks due to not excluding the location rule
-Hopefully fixed many workflow errors
-Adds early beth option
-Cleans up rules.py a bit
-Adds option for early lightning
Cleanup
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.

mostly fine, just a few things to call out. definitely recommend updating to the new options API and adding some tests though.

from . import Constants, Rules
from .Options import Shivers_options, get_option_value

client_version = 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have no idea, I saw it in a lot of worlds. I am guessing it is not needed for anything. I have deleted it.


item_name_to_id = {name: data.code for name, data in item_table.items()}
location_name_to_id = Constants.location_name_to_id
data_version = 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

can be removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

# Create regions
for region_name, exits in Constants.region_info["regions"]:
r = Region(region_name, self.player, self.multiworld)
for exit_name in exits:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for exit_name in exits:
r.add_exits(exits)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to r.create_exit(exit_name)


def create_items(self) -> None:
# Add pots
pots = [self.create_item(name) for name, data in item_table.items() if data.type == 'pot']
Copy link
Collaborator

Choose a reason for hiding this comment

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

it'd be much better to do all of these in a single loop since you don't seem to actually do any differentiation between all these lists. something like

itempool = []
for name, data in item_table.items():
  if data.type in {"pot", "key", "ability", "filler2"}:
    itempool.append(self.create_item(name))```

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to use suggested.

elif library_random == 3:
librarylocation.place_locked_item(self.create_item("Key for Three Floor Elevator"))

librarylocationkeytwo = self.multiworld.random.choice([loc for loc in library_region.locations if not loc.name.startswith("Accessible:") and loc != librarylocation])
Copy link
Collaborator

Choose a reason for hiding this comment

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

self.random

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thought i got all of those. Fixed

storageitems += [self.create_item(name) for name, data in item_table.items() if data.type == 'potduplicate']
storageitems += [self.create_item("Empty") for i in range(3)]

state = self.multiworld.get_all_state(False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why aren't you using the cache?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to use cache.


state = self.multiworld.get_all_state(False)

self.multiworld.random.shuffle(storagelocs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

self.random

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.


def water_capturable(state: CollectionState, player: int) -> bool:
return (state.can_reach("Lobby", "Region", player) or (state.can_reach("Janitor Closet", "Region", player) and cloth_capturable(state, player))) \
and state.has("Water Pot Bottom", player) \
Copy link
Collaborator

Choose a reason for hiding this comment

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

state.has_all. same comment for most of this file

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated Rules.py to use state.has_all throughout

-Review comments addressed.
-Updated en_Shivers.md to note who to contact if a bug is encountered
@GodlFire
Copy link
Collaborator Author

GodlFire commented Nov 2, 2023

mostly fine, just a few things to call out. definitely recommend updating to the new options API and adding some tests though.

I have upddated to use the new options API

…items

Fixed an option not using new API. Added weight selection for filler items.
@ThePhar ThePhar self-assigned this Nov 24, 2023
Updated README.md and docs/CODEOWNERS to add mentions to shivers
…ew front door key option.

New Front door key allows the player to bypass Egyptian Hieroglyphs Explained, this change requires the player have access to the flashback before solving Theater Door, Columns or RA, and Dropping the Guillotine if using the setting PuzzleHintsRequired

#Place library escape items. Choose a location to place the escape item
library_region = self.multiworld.get_region("Library", self.player)
librarylocation = self.multiworld.random.choice([loc for loc in library_region.locations if not loc.name.startswith("Accessible:")])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
librarylocation = self.multiworld.random.choice([loc for loc in library_region.locations if not loc.name.startswith("Accessible:")])
librarylocation = self.random.choice([loc for loc in library_region.locations if not loc.name.startswith("Accessible:")])

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed as requested


set_rules = set_rules

def generate_basic(self):
Copy link
Member

Choose a reason for hiding this comment

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

Makes more sense using this method.

Suggested change
def generate_basic(self):
def set_rules(self):

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved completion condition rule being set in generate_Basic to set_rules in rules file. Removed generate_basic.

}

def fill_slot_data(self) -> dict:
slot_data = self._get_slot_data()
Copy link
Member

Choose a reason for hiding this comment

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

Any reason you couldn't move the contents of _get_slot_data to this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, moved the contents of _get_slot_data to fill_slot_data


def _get_slot_data(self):
return {
'storageplacements': self.storage_placements,
Copy link
Member

Choose a reason for hiding this comment

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

Minor nitpick, but most of the quotes earlier use ", but these are ' quotes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to use " instead of ' for consistency

return rules_lookup


def set_rules(Shivers: World) -> None:
Copy link
Member

@ThePhar ThePhar Nov 24, 2023

Choose a reason for hiding this comment

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

Minor nitpick, but should probably be either shivers: World or world: World to match PEP8.

Although that being said, if you want to have good type hinting, add to your imports:

from typing import TYPE_HINTING  # partial for example

if TYPE_HINTING:
    from . import ShiversWorld

Then use def set_rules(world: "ShiversWorld") -> None: (quotes are needed since you aren't actually importing ShiversWorld.)

Then you get nice type hinting when you access the options attribute. I would recommend this over what I said above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to get good type hinting as suggested.


class ShiversWorld(World):
"""
Shivers is a horror themed point and click adventure. Explore the mysteries of Windlenot's Museum of the Strange and Unusual.
Copy link
Member

Choose a reason for hiding this comment

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

minor nitpick, extra space.

Suggested change
Shivers is a horror themed point and click adventure. Explore the mysteries of Windlenot's Museum of the Strange and Unusual.
Shivers is a horror themed point and click adventure. Explore the mysteries of Windlenot's Museum of the Strange and Unusual.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Extra space removed

"English",
"setup_en.md",
"setup/en",
["GodlFire, Mathx2"]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
["GodlFire, Mathx2"]
["GodlFire", "Mathx2"]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed formatting

@ThePhar ThePhar changed the title Shivers: implement new game Shivers: Implement New Game Nov 24, 2023
@ThePhar ThePhar merged commit 8d41430 into ArchipelagoMW:main Nov 24, 2023
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