Tetra - yeelp/Distinct-Damage-Descriptions GitHub Wiki

DDD adds special integration with Tetra that allows Tetra tools to have their distribution changed depending on the type of tool and their material.

Material Disitributions

Each valid material in Tetra has a base material distribution; this distribution attempts to influence a Tetra tool's base distribution. The material distribution also includes a bias rating, which is a measure of how well this material can alter a tool's distribution. A higher bias rating means the material is more easily able to alter a tool part's distribution.

Tool Part Distributions

Each Tetra tool head part (that is, sword parts and duplex parts), with the exception of duplex butts, has a tool part distribution. This is the base distribution that gets modified by the material the part is made out of. A tool part distribution also has a bias rating, which is a measure of how easily a tool part's distribution can be modified. A higher bias rating makes it harder to modify the distribution.

Bringing it Together

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

For each head piece (that is, a sword blade or duplex head that isn't a duplex butt):

  1. The tool part distribution for the head part is found. The bias rating is recorded.
  2. The material distribution for the material the tool part is made of is found. The bias rating for the material is used with the bias rating for the tool to determine an Overall Bias, which is Material Bias Rating - Tool Part Bias Rating. This value is clamped between 0 and 1.
  3. Each weight in the material distribution is multiplied by the Overall Bias. Each weight in the tool distribution is multiplied by 1 - Overall Bias.
  4. The results are combined into a singular distribution. Any weights in common with the tool distribution and the material distribution are added together. The result will be a valid damage distribution, called a Biased Damage Distribution.

If there is only one head piece, the resulting Biased Damage Distribution is the tool's damage distribution. If multiple head pieces are present (a duplex tool without a butt as one of the head pieces), the Biased Damage Distributions are averaged together, and that result is the tool's damage distribution.

Example (using default values from the config)

Take a duplex tool with a Gold Basic Axe Head and a Diamond Hoe Head. For each head piece, the Biased Damage Distribution is computed. Since none of the heads are butts, they are both used.

  • Gold Basic Axe Head: This head piece is made of Gold. Gold has a material distribution of 50% Bludgeoning and 50% Piercing with a 40% bias rating. The Basic Axe Head has a tool part distribution of 60% Slashing and 40% Bludgeoning with a 30% bias rating. The Overall Bias is 40% - 30% = 10%. Factoring in the tool part distribution and the material distribution, we have a Biased Damage Distribution that is:

    • 0.1*50% Bludgeoning = 5% Bludgeoning,
    • 0.1*50% Piercing = 5% Piercing,
    • (1-0.1)*60% Slashing = 54% Slashing,
    • (1-0.1)*40% Bludgeoning = 36% Bludgeoning

    And so the final Biased Damage Distribution is 54% Slashing, 5% Piercing and 41% Bludgeoning. Note that this distribution actually adds to 100%. (Which it needs to!)

  • Diamond Hoe Head: This head piece is made of Diamond. Diamond has a material distribution of 100% Slashing with a 50% bias rating. The Hoe Head has a tool part distribution of 100% Piercing with a 30% bias rating. The Overall Bias is 50% - 30% = 20%. Factoring in the tool part distribution and the material distribution, we have a Biased Damage Distribution that is:

    • 0.2*100% Slashing = 20% Slashing,
    • (1-0.2)*100% Piercing = 80% Piercing

    And so the final Biased Damage Distribution is 20% Slashing and 80% Piercing. Note that again, the distribution adds to 100%.

Now, the two Biased Damage Distributions are averaged together. This results in a final damage distribution of:

  • 37% Slashing
  • 42.5% Piercing
  • 20.5% Bludgeoning

Which all adds to 100%!