CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.65k stars 4.18k forks source link

Weapon familiarity/proficiency/mastery practice recipes don't recognize prefix-material craftable weapons (like 'tempered katana') #69250

Closed Zarhon closed 1 year ago

Zarhon commented 1 year ago

Describe the bug

Practice recipes that give familiarity/proficiency/mastery with specific weapons (e.g. 'Long Thrusting Swords (Intermediate)' don't recognize weapons with the 'tempered steel', 'hardened steel', 'high steel', medium steel' or 'mild steel' prefixes, which are the only ones the player can craft.

In other words, if you have a 'tempered estoc', it's not recognized by the 'long thrusting swords' recipes (which require an 'estoc', something that's no longer craftable).

This makes a few recipes, like the Long Thrusting Swords, unusable, as the weapons are uncraftable/unobtainable, or need to be looted from rare or obsoleted sources.

Attach save file

N/A

Steps to reproduce

  1. Spawn every version ('tempered steel', 'hardened steel', 'high steel', medium steel' and 'mild steel') of the Estoc, Longsword or Zweihander. You can also spawn the 'replica' versions of the items (made of budget steel / aluminum and described as such) named 'estoc'.
  2. Attempt to do the 'long thrusting swords (beginner) practice recipe with the items nearby. You will be unable to.
  3. Spawn an 'Estoc' (the one made of steel/leather, the 'real' one). This is the only version of the item the recipe will recognize.

    Expected behavior

The practice recipes recognize 'tempered steel', 'hardened steel', 'high steel', medium steel' or 'mild steel' weapons, or allow craftable alternatives.

Screenshots

Screenshot_1 Screenshot_2 Screenshot_3

Versions and configuration

Additional context

Are cudgels supposed to be usable as fencing weapons? Cause they count for the fencing practice recipes.

Terrorforge commented 1 year ago

The ideal here would be if you could specify a weapon category in the recipe like you can a tool quality, Adding every relevant weapon for every recipe individually is just asking for trouble down the line, and makes it really hard to see which weapons are actually allowed because there are 15 entries representing just three weapons

Vaskritaya commented 1 year ago

The ideal here would be if you could specify a weapon category in the recipe like you can a tool quality, Adding every relevant weapon for every recipe individually is just asking for trouble down the line, and makes it really hard to see which weapons are actually allowed because there are 15 entries representing just three weapons

There's always the way guns do it, where they have a tool quality for the purposes of practice recipes, but that's always struck me as a little hacky so I'm not sure spreading that to basically all weapons would be a great idea. It's an option, though.

Termineitor244 commented 1 year ago

We also have the way furniture does it, which is by creating/providing a fake tool item that is the one actually being called by the recipe, the basecamp smoker is a good example of this, since 4 different furniture items are providing it, so you don't have that many "charcoal smoker" duplicates in the recipes that use it, we could use something similar for items like the katana, where they all provide a fake "katana" entity that is the one searched for in these recipes, it sounds better to me than using tool qualities, but the ideal would be for them to use weapon categories.

Oh, and this problem was already known when the PR was merged, but there would be too many items if all the different variants were accounted for.

A part of the problem comes from the fact that the basic "katana/estoc/etc." have not been fully removed yet (Which I guess is the intention since the metal specific variants were introduced), when they are, the weapons called by the combat recipes can be changed to whatever the new default of the weapon is, so whoever wants to go around deleting the old mentions of the items and migrating them to an specific variant that would be the new default, well, go for it!

MrHrulgin commented 1 year ago

Same core issue as #67846. Anything that changes the name of an item away from its baseline causes systems that are looking for that base item to fail. Not sure what the preferred solution is, but it touches a number of systems.

Zarhon commented 1 year ago

Same core issue as #67846. Anything that changes the name of an item away from its baseline causes systems that are looking for that base item to fail. Not sure what the preferred solution is, but it touches a number of systems.

Note, I tested this a little with items that share the same name but are fundamentally different in stats/description.

There are (according to debug menu) three different versions of a 'estoc'. Two are replicas made of shitty materials (aluminum or budget steel), and one is the 'proper' one (steel & leather, the one you could craft before we had the material prefixes).

Only the the 'real' estoc (made of steel and leather) works for the practice recipe. So it's more than just the 'name' of the item (or at least, the name visible to the player).

Termineitor244 commented 1 year ago

Same core issue as #67846. Anything that changes the name of an item away from its baseline causes systems that are looking for that base item to fail. Not sure what the preferred solution is, but it touches a number of systems.

Note, I tested this a little with items that share the same name but are fundamentally different in stats/description.

There are (according to debug menu) three different versions of a 'estoc'. Two are replicas made of shitty materials (aluminum or budget steel), and one is the 'proper' one (steel & leather, the one you could craft before we had the material prefixes).

Only the the 'real' estoc (made of steel and leather) works for the practice recipe. So it's more than just the 'name' of the item (or at least, the name visible to the player).

We don't reference names for crafting purposes, what is searched for is the internal IDs of the items, the problem with names is that, well, not everyone speaks English, and the names are changed from time to time, while the IDs are by design unchangeable, different ID, different item altogether.

Zarhon commented 1 year ago

Same core issue as #67846. Anything that changes the name of an item away from its baseline causes systems that are looking for that base item to fail. Not sure what the preferred solution is, but it touches a number of systems.

Note, I tested this a little with items that share the same name but are fundamentally different in stats/description. There are (according to debug menu) three different versions of a 'estoc'. Two are replicas made of shitty materials (aluminum or budget steel), and one is the 'proper' one (steel & leather, the one you could craft before we had the material prefixes). Only the the 'real' estoc (made of steel and leather) works for the practice recipe. So it's more than just the 'name' of the item (or at least, the name visible to the player).

We don't reference names for crafting purposes, what is searched for is the internal IDs of the items, the problem with names is that, well, not everyone speaks English, and the names are changed from time to time, while the IDs are by design unchangeable, different ID, different item altogether.

Whoever's deleting the 'old' version of the weapons should also rename the replicas or give them the naming convention we have already - 'aluminum katana' or 'budget steel katana' for example. Otherwise it's only going to make more problems in the future, having identically-named items that do different things.

Can the 'nested crafting recipe groups' be helpful as a solution? I.e. using the 'zweihander nest' group (which includes tempered, hardened, etc zweihanders) to identify all the zweihanders simultaneously. So when the recipe looks for a weapon, it checks for it's crafting nest (if any) and then allows any of the weapons included in that nest.

Termineitor244 commented 1 year ago

Whoever's deleting the 'old' version of the weapons should also rename the replicas or give them the naming convention we have already - 'aluminum katana' or 'budget steel katana' for example. Otherwise it's only going to make more problems in the future, having identically-named items that do different things.

Good point.

Can the 'nested crafting recipe groups' be helpful as a solution? I.e. using the 'zweihander nest' group (which includes tempered, hardened, etc zweihanders) to identify all the zweihanders simultaneously. So when the recipe looks for a weapon, it checks for it's crafting nest (if any) and then allows any of the weapons included in that nest.

As far as I know there is currently no way to require a nested group contents result as a requirement for another recipe, but that seems like it would be more difficult to implement, since the nested groups reference recipes for items, not items themselves (They are not the same).

The problem is not that the game can't group some different things together, the spawns around the game use item groups alright, but that this functionality is not existing for specific items used in a crafting recipe, this is a C++ change.

MNG-cataclysm commented 1 year ago

/confirmed

I'm going to try and fix this with JSON, creating requirement groups that check for any given weapon based on ID's. If that works, I'll be making a pull request for it.