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

DS3: Dark Souls 3 Major Update/Refactor #1864

Merged
merged 105 commits into from
Jul 4, 2023

Conversation

Zunawe
Copy link
Collaborator

@Zunawe Zunawe commented Jun 11, 2023

Co-authored by @Br00ty. @Marechal-L has seen this branch before but hasn't given it a proper review as far as I know.

What is this fixing or adding?

This is a significant overhaul to the versatility of the DS3 implementation. The original goals were to split locations up into categories so that players can tune the size of their item pool, and to allow for a more diverse pool of items that includes things like enemy drops, shop items, or boss soul weapons. But the scope did creep as more stuff became possible.

  • Adds a new set of options (enable_weapon_locations, enable_shield_locations, etc...) which toggle specific categories of locations.
  • Adds some new regular locations.
  • Adds many new "progressive consumable" locations (firebombs, gems, moss clumps, etc...).
  • Adds new pool_type option. When set to various, most items in the game can appear in the pool. There will be the same proportion per category, so if your randomized locations originally contained 10 rings, 10 randomly chosen rings will be put into the pool. Previously, items were only pulled directly from the locations that were randomized (or, some locations misrepresented their default item to replace some uninteresting items with interesting ones, but this was still static).
  • Adds new guaranteed_items option. This is an ItemDict that forces items into the pool if they aren't already there. Setting pool_type to various makes the set of possible items much larger than the set of randomized locations, so this allows you to make sure certain items show up, and it lets you add multiple copies. Particularly useful for people who like spellcasting builds, since the number of randomized spells is comparatively small, and you currently end up instead just relying on finding tomes to learn the same spells from NPCs as you would in vanilla.
    • Guaranteed items will first be added until the size of the item pool matches the number of locations, then they will begin replacing items in the same category, then other non-progression items.
    • Nothing currently prevents players from using this option to add multiple copies of progression items like cinders. This doesn't cause any hard problems (generation works correctly, and if players receive multiple copies of such items, the extra copies drop on the ground), but it does give more or less full control over a player's item pool barring removing progression items.
  • Adds new randomize_infusion option which randomizes the infusion of infusible weapons and shields when the player receives them.
  • "Progressive" items like Titanite Shards and Estus Shards which used to define one unique item for every copy (Titanite Shard #21) are now only defined once (Titanite Shard).
  • Changes the behavior of late_basin_of_vows. Instead of locking the Basin of Vows to the Pontiff fight, it instead logically locks Lothric Castle and the Dancer fight behind the Small Lothric Banner, meaning you won't be forced to fight the Dancer or explore Lothric Castle without having access to the Undead Settlement and beyond.
  • Adds new late_dlc option which logically locks the DLC behind Small Doll, meaning you won't be forced to go into the DLC without having access to Irithyll, the Irithill Dungeon, and Anor Londo.
  • Renames a couple options and changes many display names and descriptions for consistency.
  • Generally cleans up the code to hopefully be more readable and easier to follow.
  • Should address Tests: add a test for worlds to not modify the itempool after create_items #1460.
  • As a side effect of these changes, some locations have had their ids changed, and virtually all items have had their ids changed.

This PR requires a minor change to the mod/client to add the new consumables, hence the bump of required_client_version. Those changes have been made, but it's up to @Marechal-L to add whatever else they're working on and then to make a new release. If you run a game with the current version of the mod, those specific consumables will only work the first time, but everything else will work as expected including new items, locations, and infusions.

How was this tested?

A formal beta test on the AP discord and many outside tests by myself and @Br00ty in other multiworlds.

Br00ty and others added 30 commits April 6, 2023 11:38
there are only 11 estus shards in the pool, so fixed number of estus shards so everything can be collected, and upped the number of bone shards in the pool to fix datapackage numbers. new counts went from: 15(estus) + 5(bones) = 20(total) TO 11(estus) + 9(bones) = 20(total)
changed estus shard/bone shard counts to match the counts in items_data.py. same reasoning as the commit for that, only 11 estus in game
revampled "Late Basin of Vows" option
added the Fire Demon location in Undead Sanctuary
added new settings for customizing pool options
sorted all the item pools
code clean up
fixed estus/bone shard counts
still need to figure out location excluding
added new locations
put locations into specific lists
made DarkSouls3Locations for each list of items
still need to figure out how to exclude
…region, update how the pool fills additional items, update location/item tables, create more tables
…ew rings, added "eyes of a fire keeper" to key locations list to balance, adjusted tables
…t), fix item/location counts in options, general code clean up
@Berserker66
Copy link
Member

Current status is that @Marechal-L is the maintainer of DS3, and this needs their approval.

@Marechal-L
Copy link
Collaborator

Nice refactoring with a cleanup of the existing tables and a tons of options added by using DS3ItemCategory.
I will definitely approve this PR and apply the requested changes to the client.

My main concern is the shift of items id for players having a previous save to continue after the update, I don't remember if this is handled by the server or the client.

@Zunawe
Copy link
Collaborator Author

Zunawe commented Jun 15, 2023

My main concern is the shift of items id for players having a previous save to continue after the update, I don't remember if this is handled by the server or the client.

Someone can correct me if I'm wrong, but

  1. Existing games keep the data package in the multidata, so the item ids for those games would remain unchanged. Only newly generated games would have the new item ids.
  2. The current client is entirely reliant on slot data to correlate item ids with DS3 item values anyway. So even if the item ids somehow changed for an in-progress save file between two different instances of connecting to the server, as long as the slot data was correct, everything would be fine.

@black-sliver
Copy link
Member

If the client uses a apclientpp version that supports "checksummed data package", then it will download the correct data package from the server - i.e. the IDs and strings used to roll the game. The client still has to properly map the IDs to in-game items. IdR how that's handled by the DS3 mod, but if slot data has archipelago ID -> in-game ID (as explained above), that would be fine.

@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. is: refactor/cleanup Improvements to code/output readability or organizization. labels Jun 19, 2023
@ThePhar ThePhar changed the title Dark Souls 3 Major Update/Refactor DS3: Dark Souls 3 Major Update/Refactor Jun 19, 2023
worlds/dark_souls_3/__init__.py Outdated Show resolved Hide resolved


class DarkSouls3Item(Item):
game: str = "Dark Souls III"
class DS3ItemCategory(Enum):
Copy link
Member

Choose a reason for hiding this comment

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

I would personally go for IntEnum here (and for LocationCategory), but it's up to you. Either will work.

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 in cd371d2

Can I ask what the purpose is? I suppose was working under the assumption that IntEnum was for when you needed your values to also be ints, and Enum was sort of the "default".

Copy link
Member

@black-sliver black-sliver Jul 4, 2023

Choose a reason for hiding this comment

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

That assumption is correct, however IntEnums are guaranteed to only have integer values, which is cleaner imo if you go with discrete integer values (i.e. you don't use auto()). Unless you serialize or de-serialize it, or have special pseudo-flags, they behave the same.

Comment on lines +212 to +213
"randomize_weapon_level": RandomizeWeaponLevelOption,
"randomize_weapon_level_percentage": RandomizeWeaponLevelPercentageOption,
Copy link
Member

Choose a reason for hiding this comment

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

This will break existing yamls. Is that fine by everyone?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My opinion is that the majority of people will be remaking their yamls anyway, so it seems like the right opportunity to make these setting names more consistent and intuitive from a native English speaker's perspective.

worlds/dark_souls_3/Options.py Outdated Show resolved Hide resolved
worlds/dark_souls_3/__init__.py Outdated Show resolved Hide resolved
worlds/dark_souls_3/__init__.py Outdated Show resolved Hide resolved
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.

Thanks!

Marechal-L and br00ty gave the OK, code looks good.

@black-sliver black-sliver merged commit d35d3b6 into ArchipelagoMW:main Jul 4, 2023
@Zunawe Zunawe deleted the ds3-refactor branch July 4, 2023 06:51
FlySniper pushed a commit to FlySniper/Archipelago that referenced this pull request Nov 14, 2023
* fix estus shard/bone shard numbers

there are only 11 estus shards in the pool, so fixed number of estus shards so everything can be collected, and upped the number of bone shards in the pool to fix datapackage numbers. new counts went from: 15(estus) + 5(bones) = 20(total) TO 11(estus) + 9(bones) = 20(total)

* Update locations_data.py

changed estus shard/bone shard counts to match the counts in items_data.py. same reasoning as the commit for that, only 11 estus in game

* added new options "Late DLC"
revampled "Late Basin of Vows" option
added the Fire Demon location in Undead Sanctuary

* first file dump

added new settings for customizing pool options
sorted all the item pools
code clean up
fixed estus/bone shard counts
still need to figure out location excluding

* bunch of changes

added new locations
put locations into specific lists
made DarkSouls3Locations for each list of items
still need to figure out how to exclude

* excluded locations from generating without options, created gotthard_region, update how the pool fills additional items, update location/item tables, create more tables

* code cleanup, remove extra tables, add grave key/eyes of a firekeeper back to key pool

* fixed some logging

* add more detailed options descriptions

* forgot to update progressive locations updates too whoops

* remove irina's tower key from items/location list. the current ID's dont work to shuffle

* fixed item-to-locations, added new weapons, added new armors, added new rings, added "eyes of a fire keeper" to key locations list to balance, adjusted tables

* added HWL: broken straight sword location, moved Greirat's ashes to  NPC items

* remove hwl: broken short sword location/item from pool (does not exist), fix item/location counts in options, general code clean up

* more code cleanup, fix Havels Ring +3 location/properly renamed item, changed Estus/Bone Shard names to not include a +| added a missing undead bone shard

* fixed npc rule, added a bunch of ring locations, fixed ring tables

* updated options

* cleaned up more code, edited some option names

* start of new items system

* DS3: Major refactor (allows for defining more items than those in vanilla locations)

* DS3: Repair changes overwritten by refactor

* DS3: Re-implement new options for location categories

* DS3: Make replacement item lists for most unique item types

* DS3: Remove accidentally added apworld

* DS3: Make option names more consistent

* DS3: Fix Pyromancer's Parting Flame location category

* DS3: Add new items

* DS3: Fix access rule for DLC/Contraption Key

* DS3: Only replace unrandomized progression items with events

Also fix some location names/categories

* DS3: Change some location names to be in line with their items

* DS3: Add randomized infusion code (only works for Broadsword)

* DS3: Make varied item pool an option

* added remaining weapons, shields, armors, rings, spells, dlc equivalents | added remaining dlc ring locations (2 in dreg heap, 5 in ringed city)

* adjusted 'Progressive Locations' counts and added new table

* added more souls + upgrade gems

* added the rest of consumables

* reverted adding an additional 'progressive location 4' table and added bulk progression locations to prog. location 3 table

* DS3: Add infusion categories and some cleanup of items

* DS3: Fix item ordering

* DS3: Fix infusion/upgrade code extra if

* DS3: Disable some unmarked cut content items

* DS3: Rename blessed red and white shield+1

* DS3: Implement guaranteed_items option

* DS3: Remove print statement

* DS3: Add extra check for trying to remove items from an empty list

* add unused content item id's

* DS3: Move cut content to its own list

* DS3: Classify spells and healing upgrades as useful

* DS3: Implement get_filler_item_name

* DS3: Change lower bounds for upgrades from +1 to +0

* DS3: Move Ancient Dragon Greatshield back to vanilla and recategorize some useful consumables

* DS3: Guaranteed items checks for number of existing items before replacing

* added remaining progressive items, fixed npc rules, adjusted option location counts

* delete extra items, add rule for dancer/late basin

* seperate PW into two parts (can access first half w/o contraption key | SKIP more unused items

* DS3: Minor linting changes

* DS3: Update required_client_version

* DS3: Remove rule for bell tower access

The key can always be purchased from the shop

* DS3: Move location category option checks to generate_early

* added "Boss Soul" option to pool

* DS3: Fix rules for boss souls and update misc location count

* DS3: Address minor review comments

* DS3: Change category enums to IntEnum

* DS3: Make apworld

---------

Co-authored-by: Brooty Johnson <[email protected]>
Jouramie pushed a commit to Jouramie/Archipelago that referenced this pull request Feb 28, 2024
* fix estus shard/bone shard numbers

there are only 11 estus shards in the pool, so fixed number of estus shards so everything can be collected, and upped the number of bone shards in the pool to fix datapackage numbers. new counts went from: 15(estus) + 5(bones) = 20(total) TO 11(estus) + 9(bones) = 20(total)

* Update locations_data.py

changed estus shard/bone shard counts to match the counts in items_data.py. same reasoning as the commit for that, only 11 estus in game

* added new options "Late DLC"
revampled "Late Basin of Vows" option
added the Fire Demon location in Undead Sanctuary

* first file dump

added new settings for customizing pool options
sorted all the item pools
code clean up
fixed estus/bone shard counts
still need to figure out location excluding

* bunch of changes

added new locations
put locations into specific lists
made DarkSouls3Locations for each list of items
still need to figure out how to exclude

* excluded locations from generating without options, created gotthard_region, update how the pool fills additional items, update location/item tables, create more tables

* code cleanup, remove extra tables, add grave key/eyes of a firekeeper back to key pool

* fixed some logging

* add more detailed options descriptions

* forgot to update progressive locations updates too whoops

* remove irina's tower key from items/location list. the current ID's dont work to shuffle

* fixed item-to-locations, added new weapons, added new armors, added new rings, added "eyes of a fire keeper" to key locations list to balance, adjusted tables

* added HWL: broken straight sword location, moved Greirat's ashes to  NPC items

* remove hwl: broken short sword location/item from pool (does not exist), fix item/location counts in options, general code clean up

* more code cleanup, fix Havels Ring +3 location/properly renamed item, changed Estus/Bone Shard names to not include a +| added a missing undead bone shard

* fixed npc rule, added a bunch of ring locations, fixed ring tables

* updated options

* cleaned up more code, edited some option names

* start of new items system

* DS3: Major refactor (allows for defining more items than those in vanilla locations)

* DS3: Repair changes overwritten by refactor

* DS3: Re-implement new options for location categories

* DS3: Make replacement item lists for most unique item types

* DS3: Remove accidentally added apworld

* DS3: Make option names more consistent

* DS3: Fix Pyromancer's Parting Flame location category

* DS3: Add new items

* DS3: Fix access rule for DLC/Contraption Key

* DS3: Only replace unrandomized progression items with events

Also fix some location names/categories

* DS3: Change some location names to be in line with their items

* DS3: Add randomized infusion code (only works for Broadsword)

* DS3: Make varied item pool an option

* added remaining weapons, shields, armors, rings, spells, dlc equivalents | added remaining dlc ring locations (2 in dreg heap, 5 in ringed city)

* adjusted 'Progressive Locations' counts and added new table

* added more souls + upgrade gems

* added the rest of consumables

* reverted adding an additional 'progressive location 4' table and added bulk progression locations to prog. location 3 table

* DS3: Add infusion categories and some cleanup of items

* DS3: Fix item ordering

* DS3: Fix infusion/upgrade code extra if

* DS3: Disable some unmarked cut content items

* DS3: Rename blessed red and white shield+1

* DS3: Implement guaranteed_items option

* DS3: Remove print statement

* DS3: Add extra check for trying to remove items from an empty list

* add unused content item id's

* DS3: Move cut content to its own list

* DS3: Classify spells and healing upgrades as useful

* DS3: Implement get_filler_item_name

* DS3: Change lower bounds for upgrades from +1 to +0

* DS3: Move Ancient Dragon Greatshield back to vanilla and recategorize some useful consumables

* DS3: Guaranteed items checks for number of existing items before replacing

* added remaining progressive items, fixed npc rules, adjusted option location counts

* delete extra items, add rule for dancer/late basin

* seperate PW into two parts (can access first half w/o contraption key | SKIP more unused items

* DS3: Minor linting changes

* DS3: Update required_client_version

* DS3: Remove rule for bell tower access

The key can always be purchased from the shop

* DS3: Move location category option checks to generate_early

* added "Boss Soul" option to pool

* DS3: Fix rules for boss souls and update misc location count

* DS3: Address minor review comments

* DS3: Change category enums to IntEnum

* DS3: Make apworld

---------

Co-authored-by: Brooty Johnson <[email protected]>
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. is: refactor/cleanup Improvements to code/output readability or organizization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants