Reasons:
- It is time-consuming to put a particular shaped recipe into the crafting grid.
- Shaped crafting recipes are not obvious, rather complex and hard to remember.
- Shaped recipes are basically completely pointless as they add nothing to gameplay. What matters in crafting are the item types and number of items it consumes. In principle, all shaped recipes could be replaced by a shapeless recipe without any change in gameplay.
- Even for shapeless recipes you need to patiently place at least 1 item per slot, even if they are all equal like for 4 wheat → flour.
- A recipe can only consume exactly 1 item per input slot.
- … which means a recipe can only consume as much items as the size of the crafting grid allows. So for 3×3 grids, a recipe can only consume 9 items at once. Not item stacks. Items. Which leads us to the next problem:
- It doesn't scale, i.e. it performs very poorly at large item numbers. Try registering a recipe with 1000 equal items. It would require a crafting grid of the size 32×32! And it would be very painful for the user to put all items into the slots (at least 1000 clicks).
- For shaped and shapeless recipes, it is not possible for the same input to yield multiple possible results, for the user to choose from
- Mods can accidentally overwrite existing crafting recipes—without warning. (https://github.com/minetest/minetest/issues/4382)
- Registering a toolrepair recipe forces all tools to be repairable, with no way for mods to defend against this (this is an issue with mods like Technic)
IMO the list of things I hate about the crafting system are numerous enough that I think it is very justified to suggest a major redesign of the crafting system.
I propse this system:
Definition
First, the definition format of crafting recipes needs to be changed, at least partially.
- A new simplified recipe type is added, called “combine” which requires a certain number of items of particular type or types. It is very similar to shaped and shapeless recipes, but with a greatly simplified definition
- The shaped and shapeless recipes will be replaced by combine recipes
- Legacy support for shaped and shapeless recipes will be provided; they will internally all be transformed to “combine”-type recipes
- The concept of the “shape” of input items will be completely removed from the player's perspective
- The definition of the input of a combine recipe contains a simple list of item types and a number of items per item type. This could be done via itemstrings.
- 2 recipes with the same input items will be explicitly allowed (no overwrites)
- Registering a recipe with same item items (+item counts) AND output items should be forbidden or ignored, since it is redundant and can be skipped safely.
- fuel and smelting recipes will remain unchanged
This has an interesting implication: The meaning of the input grid changes: Now each slot is not just for a single item, but for a single item type. This means, a 3×3 grid does not just allow for crafts with 9 items, but for crafts with up to 9 different item types. The item count is now only limited by the maximum stack size
Example:
- Code: Select all
{"default:apple 5", "default:leaves 2"}
Input recipe requires 5 apples and 2 leaves.
Crafting
For the user, crafting should work like this:
- The requirements are simplified: For the output to become “active” (i.e. showing the output item(s)), it is first checked if all item types in the input match the item types of any recipe (not more, not less item types). And then it is checked if the sum of all items matches the minimum requirement of any recipe. All recipes which pass the test will be craftable.
- When there are excess items in the input grid, items will be consumed starting from the top left, then going to the right slot, then to the next row, and so on
- Output is chosen from one of (possibly) multiple alternatives (see below)
Example:
5A 2L __
__ __ __
__ __ __
number = size of itemstack
A = apple
L = leaves
_ = empty
This is a valid input which will match above example.
Example 2:
A L A
A A A
_ L _
This would *also* be a valid input which matches above recipe because only the
total sum of all item counts. It is the equivalent to a shapeless recipe.
Example 3:
A99 A99 A99
L99 L99 L99
Also valid, since it matches the minimum requirement. Of course, when crafting, only 5 apples and 2 leaves are consumed. To demonstrate the consumption rule, here's how the input grid should look like this after a single craft:
Input:
A94 A99 A99
L97 A99 A99
Example 4:
A5 L2 X1
Where X is any other item. This would be invalid and would yield no output. For an output to be triggered, the *exact* item types must be in the grid, not more, not less. The “X” is the one item type too much.
Output
The output slot is changed by something more powerful: A dedicated output drop-down list.
This drop-down list is an entirely new widget which comes in place of the traditional output slot and lists all possible outputs from the given input and the user chooses the desired output.
Now first I need to explain the widget:
It is similar to a drop-down list but not the same. Its list entries
are the full-sized item icons. By clicking on the “arrow” you expose
the other crafts. By clicking on a list entry, either in the drop-down
lists “open” or “closed” state, you craft the item once. The usual other
shortcuts (middle and right click) from the current output slot should apply
here as well.
Important! The drop-down list must not be closed after clicking on a list
entry, this should only be done by clicking on the “arrow”. This allows
items to be crafted as quickly as with the current output slot. If drop-down
is closed, the drop-down list is closed. The only visible item
of the drop-down list will be the item which has been crafted previously
as long the crafting conditions allow it. For convenience, the drop-down list
should also be closed when the formspec is closed.
Output example:
Assume in the input grid one slot is occupied with 99 wheat, the rest is empty.
Assume we have 2 “combine” recipes:
- 4 wheat yield 1 flour.
- 9 wheat yield 3 straw.
This means, our input has 2 possible outputs, since both recipes can be crafted
with our current input.
The output slot will show the flour recipe first (no logic behind that one).
If the user clicks it, flour is crafted. If the user wants to try the other
recipe, the user clicks on the arrow, then clicks on the straw icon. Done!
Fixing tool repair
Simple: Minetest should only make tools repairable if they don't belong to the new special group “disable_repair=1”.
Syntax
Syntactically, combine recipes could be very similar to shapeless recipes. The input is a list of itemstrings.
But they will allow for numbers of items to be specified in the itemstrings.
Also, it should be discouraged or even forbidden for any item type to appear twice in the list.
Example:
- Code: Select all
{
type="combine",
input={"default:apple 5", "default:leaves 2"},
output="default:dirt",
}
Means: 5 apples + 2 leaves → 1 dirt
An equivalent recipe:
- Code: Select all
{
type="shapeless",
input={"default:apple", "default:apple", "default:apple", "default:apple", "default:apple", "default:leaves", "default:leaves"},
output="default:dirt",
}
Example 2:
- Code: Select all
{
type="combine",
input={"example:dirt 1000"},
output="example:compressed_dirt",
}
Equivalent shaped or shapeless recipes would be very, very large so I don't write them down here. ;-)
Legacy support
Since mods will still continue to have “shaped” and “shapeless” recipes, some legacy support must be added.
This can be done by a very simple algorithm:
- Count the number of each item type in all the input slots.
- Create a new table with the accumulated items expressed as itemstrings
- Use this new table as the new input
- Change the type to "combine"
Example:
- Code: Select all
{
input={{"example:stone","example:wood","example:wood",},
{"example:stone","",""",},
{"example:stone","example:wood","example:wood",},
},
output="example:woodstone",
}
With using our algorithm, this recipe can now be interpreted to be the equivalent of this one:
- Code: Select all
{
type="combine",
input={"example:wood 4","example:stone 3"},
output="example:woodstone",
}
Benefits of the proposed system
- Much faster to use (less clicking, less pointless item alignment)
- Easier-to-remember recipes
- Allows a much higher number of items to be used in a single craft
- Simplified yet more powerful crafting definitions
- Focus on gameplay rather than memorizing strange shapes
- No crafting collisions
- Tools which aren't supposed to be repaired can't be repaired anymore
Limits
- Maximum possible number of items depends on crafting grid size and item stack size, but this number is now much, much larger (stack_max per slot) than the current limit (1 per slot).
Feedback
Any comments?