Anyone really good at math? (Probability Calculation)

This must be a formula in Algabra or Calculas, or some other advanced course I never made it anywhere near in school.

I’m putting together a crafting game where the character can have 0-50 points in a skill. Their are 5 tiers + -2 tiers.

-2 = something really bad happens.
-1 = kind of bad happens.
0 = a garbage item.
1 = an okay item.
2 = good item.
3 = great.
4 = awsome.
5 = Epic item.

0 skill points : = Tier -2 < ------ Rare
= Tier -1 < ----- Kind of likely
= Tier 0 <----- Most Likely Result
= Tier 1 <----- Kind of likely
= Tier 2 <------ Rare

Tier -1
Tier 0
10/sp = Tier 1
Tier 2
Tier 3

20/sp = Tier 2

30 = Tier 3

and so on. …

I’ll manually create these rules if I have too based on if then statements but if anyone could point me in the right direction of some kind of formula that takes care of this I would be extremely thankful :smile:

Being able to plot the % chance in a database is the general idea.
I was able to do it in multiple’s of 5’s but not 1’s, which is necessary as the character will have customizable equipment so the stats can’t be rounded up for the sake of simplicity.

I don’t understand your skill and tier stuff, but when it cuts down to picking elements on a propability value, I’d specify it in percentage and then it should be not too hard to pick such element depending on this propability value and easy to follow for the person who maintains the data.

If propability is in range 1…100 (incl) and we assume the randomizer does a wonderful job, the probability of “UnityEngine.Random.Range(1,101) <= 1” should be 1%, “Random.Range(1,101) <= 50” should be 50% and “Random.Range(1,101) <= 100” should be 100%.

I’d store the elements in a list that is sorted by probability in ascending order, like: VeryRare=10%, Rare=20%, Often=50%, VeryOften=90%. To pick such element, get a random propability value, then iterate over the list and compare elements to the random value. You could use the first element where the comparision evaluates to true, or when it contains elements with the same propability, build another list of these items and do a further run on it. You could even build a lookup table to you can get rid of the loop.

Hope it helps.

Tier -2 might be (potion blows up and causes injury.)
Tier -1 maybe (potion spoils and materials go to waste.)
Tier 1 (Bronze materials.)
Tier 2 (Silver)
Tier 3 (Gold)
Tier 4 (Platinum)
Tier 5 (uh… Cryptanite? )

A character with Skill Level of “0” clearly shouldn’t be allowed anywhere near the crafting table as they have a 50% of Tier -2 and 25% of Tier -1

While a Skill Level of "30 = a 50% of Tier 1 and 25% of Tier 2 and Tier -1 which is quite a bit better.

It’s easy to figure out the results with the 0,10,20,30,40, and 50
But I am completely lost if the character has a Skill of… 12.

Then it’s like 10 but with a 20% chance higher of the positive Tier than the negative tier… Making my head spin already.

The question is very unclear to me, even with the follow up, although it seems you are trying to make a weighted indexing system… that means that you can apply a weight/ a probability to each element in an index of say 10 items, so that some of them are available differently in different circumstances, so in fact you are making several weighting rations to assign random attributes by chance?

that is done by making if(diceroll between 20 and 40) silver, if (dice between 40 and 45) less probably item…

?

Yeah it’s like each “Tier” consists of a group of items; one item will be selected by random if the Tier is landed on.

Player has a skill level of 20. They expect that the average attempt to craft will equal a Tier 0 result (50%) with a moderate possibility of Tier -1 or Tier 1, a low possibility of Tier -2 or Tier 2.

Chances are on average they will land in Tier 0.

This randomly selects an item in the Tier 0 category (a crap low quality item.)

I’m trying to plot out the probability onto a spreadsheet so this can be saved as a database. That way, based on the player’s skill, their chance of success can be query’d. This also allows me to adjust the difficulty curve if needed, later on.