Crafting is a game mechanic of using various items and materials and transforming them into different items. The overall guidelines are:
Players should be able to craft Makeshift items without accessing menus, just by using interactions of items on other items.
Players should be able to interact with crafting stations for Advanced crafting, which might require a menu.
Players should only be able to craft using items that are in their external inventory slots (hands, pockets etc.) or located in the containers, opened by the player.
Crafting is set to a timer. Upon timer completion the requirements are consumed and the result is created.
There should be a progress bar to show how much time you have left to craft.
The timer should depend on the condition of the character's hands (see Medical channel or related design documents).
The timer variable should be a float value.
There should be lists of crafting recipes, made in structured data format like JSON or ScriptableObject to store recipes in.
Crafting recipes should be able to work with traditional items like cable coils and reagents like welding fuel.
Crafting recipes should be able to work with multiples of one item, such as stackable items (only for results for Makeshift crafting).
Crafting recipes can require certain tools in order to complete. These tools are not consumed when crafting is complete.
Multiple kinds of tools can be required by one recipe.
In case of working with reagents there should be an allowance for a deviation from the recipe. For example, there might be a 'purity' function which allows the crafting process if the reagents and reactants are present within a set tolerance of their required ratio (See Substances channel or related design documents).
Crafting should contain a 'quality' function that depends on how much the crafting process deviates from the recipe (for example, more the 'purity' of the reagent or cooking time deviates from the ones stated in the recipe, the lower quality should be).
Quality should affect the stats of the crafting result (lower quality weapons deal less damage, lower quality food contains less nutrients and has a higher chance of giving food poisoning)
Quality should be able to be depleted during crafting, in which case the result should be replaced with a useless "failure" item (like "Burned mess" for food).
If the result of a recipe is an item, it should be put in the character's active hand if it is empty.
If a character's active hand is full, then the result should be put in the character's other hand if it is empty.
If both hands are full or if the result is not a pickupable item, the result should be placed on the nearest empty tile to the one that the character is currently occupying.
Makeshift Crafting is a way for characters to make Makeshift weapons, Clothing, Food and other various items without the need of using a specific workstation (such as a Workbench, Stove, Microwave, Fabricator, Forge or other).
Crafting recipes consists of the following elements :
A target item, that is an item that needs to be interacted with to produce other items. A wheel of cheese can be a target, to produce melted cheese, or two half wheel of cheese.
A list of needed ingredients, their number, as well as if they should be held in hand. nothing is lost, nothing is created, everything is transformed.
A specific interaction. You'll need to interact with the target item in a specific way to craft something out of it. If you want two half wheel of cheese, you'll need to slice it in half. Multiple tools can be the source of the needed interaction.
A list of resulting items. All the items produced by the crafting !
Duration of the crafting interaction. It takes time to craft anything !
This list should contain thename and quantities of various items and materials used for crafting, name of interactions , as well as the names and quantities of the resulting items.
Example of the content of the said list
(this and later formatting examples are for explanation purposes only):
The first recipe makes a wired pole by adding 5 wires to a metal rod one by one
The second adds a battery to the wired pole
The third one adds an igniter to the powered wired pole
The fourth one uses (but not adds) a screwdriver on the powered wired pole with igniter to make a makeshift stunprod.
Pie example:
This is how the recipe is expected to be executed by the player:
Player takes the dough in hand. Player walks near the empty pie tin (or holds it in the other hand) and performs a primary interaction on it with the filled hand. Result: dough is deleted, hand becomes empty, empty pie tin is replaced with an empty pie, placed in the same location.
Player takes the apple slices in hand. Player walks near the empty pie (or holds it in the other hand) and performs a primary interaction on it with the filled hand. Result: apple slices are deleted, hand becomes empty, empty pie is replaced with a pie crust, filled to 1/3 with apple slices, placed in the same location.
Player takes the apple slices in hand. Player walks near the partially filled pie (or holds it in the other hand) and performs a primary interaction on it with the filled hand. Result: apple slices are deleted, hand becomes empty, empty pie is replaced with a pie crust, filled to 2/3 with apple slices, placed in the same location.
Player takes the apple slices in hand. Player walks near the almost filled pie (or holds it in the other hand) and performs a primary interaction on it with the filled hand. Result: apple slices are deleted, hand becomes empty, empty pie is replaced with an uncooked apple pie, placed in the same location.
Every action performed during makeshift crafting takes set time, length of which might be increased, depending on the condition of the character’s hands (see Medical design document (WIP/TBD))
For every intermediate stage of pie there should exist a separate model, visually representing different stages of the item or it’s components, where it’s appropriate and makes sense.
To lower the amount of modelling work, these three options were proposed for the pie as an example.
Add the whole model of the ingredient and place it into the model
Add the lowpoly “chunks” that represent parts of an ingredient and place it as a layer into the model
Add a single model representing the amount of added ingredients and increase its volume with every added ingredient (optionally color it using unity)
These are represented in the rows on the picture below:
This set of recipes contains non consumable tools. This is how the recipe is expected to be executed by the player:
Player takes the Rifle Stock in hand. Player walks near the Modular Receiver (or holds it in the other hand) and performs a primary interaction on it with the filled hand. Result: Stock is deleted, hand becomes empty, Reciever is replaced with a Reciever, loosely connected to the Stock, placed in the same location.
Player takes the Screwdriver in hand. Player walks near the Result of the previous craft (or holds it in the other hand) and performs a primary interaction on it with the filled hand. Result: Screwdriver stays as is (alternatively, it’s durability lowered after usage), Result of the previous craft is replaced with a Makeshift firearm base, placed in the same location.
Player takes the Disposal Pipe in hand. Player walks near the Result of the previous craft (or holds it in the other hand) and performs a primary interaction on it with the filled hand. Result: Disposal Pipe is deleted, hand becomes empty, Result of the previous craft is replaced with an Unfinished pipegun, placed in the same location.
Player takes a Duct tape roll or a Package wrapper in hand. Player walks near the Result of the previous craft (or holds it in the other hand) and performs a primary interaction on it with the filled hand. Result: adhesive tool stays in hand, expanding some of it’s resource (kind of like welding torch loses some of it’s fuel after every use), Result of the previous craft is replaced with a pipegun, placed in the same location.
As seen here, tools are not expendable, but they might take a hit in durability and, if applicable, lose some of their resources.
The last recipe should result in creation of a bowl of wet uncooked rice.
This recipe deals with reagents. This is how the recipe is expected to be executed by the player:
Player takes a glass filled with water in hand. Player walks near the Bowl of uncooked rice (or holds it in the other hand) and performs a primary interaction on it with the filled hand. Result: glass stays in hand, expanding all of it’s contents, Bowl of uncooked rice is replaced with a Bowl of wet uncooked rice, placed in the same location.
Is there any allowance for a deviation from the recipe when using reagents? Is the Bowl of uncooked rice still wet if the glass contains 99% water and 1% anything else?
Crafting systems such as Cooking or Chemistry are more complex and specialized, due to having a different traditional interface for workstations and the fact of the usage of substance system, and so would require a different approach.
For example, Cooking is based on exposing the materials and substances to different appliances for a set amount of time.
An example of the Microwave menu can be seen below:
A press of a Power button turns of the Microwave and starts the timer, that shows time the microwave started working
At a second press of a Power button, the Microwave stops heating it’s contents and disables the timer
An example of expected behavior:
Player places bowl of wet uncooked rice into the microwave
Player starts the microwave with a press of a Power button and waits for a specific period of time (the diapason mentioned in the recipe list for microwaves)
Player stops the microwave with a press of a Power button and removes a bowl of cooked rice from the microwave (player is unable to remove the contents of the microwave without stopping it first).
In case the player stopped the microwave too early, the rice stays uncooked
In case the player stopped the microwave too late, the rice becomes ruined (contents of the bowl becomes burned mess)
Basically the same goes for stove, oven and chemical burner (the later consumes fuel when used, though)\
An example of the Blender menu can be seen below:
List of reagents lists only the components of the freshly made reagent, that were solid ingredients and were blended by this blender. (for example, if the mix of vodka and syrup was mixed outside the blender, it would be listed as an Unknown reagent when placed into the blender, but if this reagent is in the blender alongside with strawberries and both would be blended, the reagent list would list strawberries AND Unknown reagent)
A press of a Power button deletes the ingredients, makes a reagent that contains those ingredients (in the same proportions) and mixes it with an existing reagent, if there is one.
Using filled container (like a glass of milk) on the blender, would transfer the contents of the container into the blender
Using empty container (like an empty glass) on the blender, would transfer the contents of the blender into the container
Advanced Crafting is a way for characters to make better Weapons, Clothing, Food and other various items, using a specific workstation (such as a Workbench, Stove, Microwave, Fabricator, Forge or other).
In order to implement Advanced crafting, an Advanced Recipe List (ARL) should be implemented first.
This list should contain the ID’s and quantities of various items and materials used for crafting, ID’s for needed tools and the ID’s and quantities of the resulting items, as well as the type of the crafting station.
Example of the entry from the said list:
Where (the names of these can change):
"type" is a type of the crafting station;
"result" is the object, created in the end of the completed recipe;
"time" is the length of waiting for an action in the recipe to be completed;
"tool" is the object, that is supposed to be used (depleting the set amount of fuel or durability for one action), but not consumed;
"component" is the set of objects consumed in the crafting process;
This set of recipes requires a Screwdriver as a tool, 1 Igniter, 1 Rod and 1 Welding Tool to create Flamethrower
Crafting menu should be implemented for this kind of crafting.