Tinker's Construct - yeelp/Distinct-Damage-Descriptions GitHub Wiki

DDD adds special integration with Tinker's Construct. The integration introduces a system that defines how distributions work for Tinker tools. Tinker tool distributions have three properties that determine the distribution: Tool Bias, Material Bias and Material Influence.

Tool Bias

Tool Bias is a number that represents how easily a tool is influenced by its materials. A tool with a tool bias of 0 is fully influenced by its materials and the tool's base distribution will effectively be overwritten by the material's distribution. A higher tool bias means that the tool's base distribution is altered less by the materials used.

Material Bias

Material Bias is a number that determines how much a particular material influences the distribution. A tool's Tool Bias is subtracted from the material's Material Bias and that number is used to alter the weights of the material's distribution in the final result.

Material Influence

Material Influence is the damage distribution that a particular material has. A material's Material Influence is the distribution it tries to impose on a tool that is made of it.

Bringing it Together

To compute the distribution of a Tinker tool, DDD performs the following steps:

  1. The tool's Tool Bias is recorded, along with the Material Influence and Material Bias for all head pieces present on the tool.
  2. For each head piece on the tool:
    • The overall Bias Resistance for that head is determined as Material Bias - Tool Bias, and clamped to be between 0 and 1.
    • Each weight in the head's Material Influence is multiplied by the Bias Resistance. Each weight in the tool's base damage distribution is multiplied by 1 - Bias Resistance.
    • These results are combined into a single distribution. If the Material Influence and the tool's base damage distribution have damage types in common, those weights are added together. The result will be a valid damage distribution called a Biased Damage Distribution.
  3. If multiple head pieces are present, their Biased Damage Distributions are averaged together. This final result is the tool's damage distribution.

Example (using default values from the config)

Take a Mattock with a Endstone Axe Head and Lead Shovel Head (The material of the tool rod doesn't matter; Only parts that count as head parts matter, handle and extra parts do not affect the result). First, the Mattock has a base distribution of 45% slashing, 45% bludgeoning and 10% piercing. It also has a Tool Bias of 60%, so it isn't extremely influenced by its head pieces. Then, there are two head pieces:

  • Endstone Axe Head: This head piece is made of Endstone. Endstone has a Material Influence that is 85% bludgeoning and 15% psychic, with a 90% Material Bias. This gives an overall Bias Resistance of 90% - 60% = 30%. Factoring in the Mattock's base distribution, the distribution for the Endstone Axe Head is:

    • 0.3*85% Bludgeoning = 25.5% Bludgeoning,
    • 0.3*15% Psychic = 4.5% Psychic,
    • (1-0.3)*45% Slashing = 31.5% Slashing,
    • (1-0.3)*45% Bludgeoning = 31.5% Bludgeoning,
    • (1-0.3)*10% Piercing = 7% Piercing

    And so the final distribution is 31.5% slashing, 7% piercing, 57% bludgeoning, and 4.5% psychic. Note that this distribution actually adds to 1. (Which it needs to!)

  • Lead Shovel Head: This head piece is made of Lead. Lead has a Material Influence that is 80% slashing and 20% poison, with a 60% Material Bias. This gives us an overall Bias Resistance of 60% - 60% = 0%. This means that the Lead Shovel Head is not strong enough to influence the distribution. So the distribution for the Lead Shovel Head is:

    • 0*90% Slashing = 0% Slashing,
    • 0*20% Poison = 0% Poison,
    • (1-0)*45% Slashing = 45% Slashing,
    • (1-0)*45% Bludgeoning = 45% Bludgeoning,
    • (1-0)*10% Piercing = 10% Piercing

    And so the final distribution is 45% slashing, 10% piercing and 45% bludgeoning. Note that again, this distribution actually adds to 1.

Now combining these distributions is as simple as averaging the two together. This gives us a final distribution for the Endstone-Lead Mattock of:

  • 38.25% Slashing
  • 8.5% Piercing
  • 51% Bludgeoning
  • 2.25% Psychic

Which all add to 100%!