[Implemented] New recipe format and tool qualities

There is a new recipe format in the recipe files. This builds on the existing format, rather than replacing it. It does not work for items that consume charges when used.

The new format is based on a new tag, “qualities”, and looks like this:

[tt]“qualities”:[
{“name”:“CUT”,“level”:1,“amount”:1},
][/tt]
or simply
[tt]“qualities”:[
{“name”:“CUT”},
][/tt]

The name refers to the name of a new quality tag that can be added to items.
The level refers to the minimum level of that quality required (just ignore this for now and put everything at level 1, we’ll have to go through and see what needs to be raised after an analysis later on - it will become more important once speed of crafting is effected by tool quality as well). This is optional, and defaults to 1.
The amount refers to how many tools with this quality are required. Again, not likely to get much use just yet, but it’s an ability the old format had that would have otherwise been lost with this transition. This is also optional and defaults to 1.

This will allow any item with the given tag to meet this requirement, and these requirements are laid upon any other more specific tool and component requirements.

An analysis was done in Issue 579 for potential tool qualities. For now, I’d like us to get the following in:
CUT
HAMMER
SEW
SCREW

and maybe
CHOP and SAW

Use the current item list as a guide for which items need these qualities. The format for adding a quality to an item is:
[tt]“qualities”: [[“CUT”, 1]][/tt]

Currently, I’ve done all the basic cutting tools - knives, swords, etc.

Just follow what already exists in the recipe files for determining which items should have which qualities.

I hope you all enjoy the new system, and I hope it becomes even better as we move along!

I’ll look at this ASAP and then do what I can to help out.

Just have to finish my current big project first.

Moved some items over in this PR:

Will probably not have time to do any more - I really need to start focusing on NPCs. Good to get things started though.

Also note that this does NOT currently work with the multitool bionic! No worries though, the bionic will be given the required qualities when it’s JSONized, which I expect will happen fairly soon once people realize it doesn’t work anymore - and this change means that once that happens, it just needs to be given the appropriate qualities and it will will work for all the recipes (yay!).

Okay I’ve finally gotten around to this one.

Git PR!

Making the crafting screen list what tools have the required quality instead of just saying tools with cut 1 or more would be nice

Other than that it is great and was really needed

I’m sure we can hammer out the grammatical weirdness as we go.

[quote=“John Candlebury, post:5, topic:3361”]Making the crafting screen list what tools have the required quality instead of just saying tools with cut 1 or more would be nice

Other than that it is great and was really needed[/quote]

The tools themselves (at least) indicate what qualities they have, and at what level, when examined.

I’ve been wondering if it might be worthwhile to split CUT into CUT and SLICE.

This may seem stupid, but bear with me for a moment - personally, I would like scissors to be better at cutting and working with cloth. But they would be less good at carving something out of wood.

Basically every item that has CUT would also have SLICE and vice versa - but the level of quality for each of these items will differ.

No reason to do this yet - but after I finish adding modifiers for skill quality levels in regards to effectiveness at crafting (and cutting things up and butchering etc.), it might be worth doing. Then we can create differences between a hunting knife, a pocket knife, and a pair of scissors.

I’ll need to create a document covering this, but basically we’d have quality “groups” that would always come together, but might have varying levels, and then the recipes can require one of qualities in that group to indicate which type of tool is more effective, even if every tool of that type should work.

I’m definitely open to discussion here though.

Sounds good to me, but rather than slice, how about carve? I think that’s what you’re getting at anyway.
In general I’m totally unconcerned with tool use labels proliferating until we hit 20 or so, if we get over that we might need to look at consolidating, but for the moment I think a good goal is to just apply existing operations, add new operations that aren’t addressed, repeat, and see where that gets us.

I don’t see any need to lock the groups together, I can imagine a tool that can do one but not the other, e.g. a letter opener or similar “safety cutter” that’s designed to not be able to carve things, but can cut fabric or paper, possibly well.

Doesn’t matter yet, but once the quality stuff is having an effect, we need to allow a single tool to fill multiple slots and vice versa, for example a recipe might require cutting and slicing, which can either be filled (poorly) with a knife, or well by a knife AND a pair of scissors.

It would be nice if tool qualities would work for recipe components too.

Oh yeah, not totally locked, I just mean groups as in things that almost always come together. I was also considering the language of “carve” as well, but ultimately what’s really important is just using it consistently.

This is actually already how it works and how I designed it. If you have a recipe requires “chop”, “slice”, and “carve”, for example, a single tool can meet all of those requirements as-is right-now. Only if a particular recipe requires more than one of a given attribute (I was thinking of requiring clamps for some recipes, and wanted to leave that option open since it could be done in the old system though I don’t know if it ever was) is a second tool required. So a multitool with lower across the board quality but that can serve multiple roles works perfectly well as is (except only minimum quality matters right now, of course).

I haven’t decided yet if I want to introduce the complexity of a single requirement that involves multiple qualities. Things like butchering, for example, could benefit from chopping and slicing both being high - but then, butchering doesn’t actually use crafting recipes either, so I decided it wasn’t worth worrying about.

Butchering doesn’t use the recipes, but it could certainly use the tool qualities, and this cold apply to other things too.

Right, it could still use the tool qualities, but it wouldn’t benefit from introducing advanced recipe processing rules - that was what I was trying to say, that bothering to add new rules to the recipes and logic to handle them probably wasn’t worthwhile, since every instance I can think of where it would matter is one that doesn’t use recipes.