Talk:Lottery

From The Sims Wiki, a collaborative database for The Sims series
This is an old revision of this page, as edited by imported>Nikel23 at 06:41, 30 March 2014 (→‎Top prize for Unlucky Sims). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Jump to navigation Jump to search

Top prize for Unlucky Sims

Looking at the table, I don't see how prizes for Unlucky Sims top out at §100. The traits don't start affecting the prize chances until the §1,000 level is reached, and even then, it's +/- 5%. That leaves a 5% of winning §1,000, unless there are some other factors that affect the amount of the prize. Dharden (talk) 18:28, March 29, 2014 (UTC)

The code isn't very complicated, but it's a little confusing to explain in the article, so I tried to omit the details as it's too technical. How the game determines the outcome is actually more than what's just listed on the table.
Consider the winning chances aren't modified (no traits, no moodlet). First, all the weighted chances are summed up, so n = 30 + 25 + 15 + ... + 0.05 = 100. After that, a random number x is picked between 0.00 - 1.00. The random number that's picked determines the outcome of the reward:
50 100 500 1,000
0 ≤ x < 30/100 30/100 ≤ x < 55/100 55/100 ≤ x < 70/100 70/100 ≤ x < 80/100
5,000 50,000 100,000 1,000,000
80/100 ≤ x < 87/100 87/100 ≤ x < 94/100 94/100 ≤ x < 99.95/100 99.95/100 ≤ x < 100/100

Technically, if x is exactly 1.00, I believe you won't win any prize instead. The denominator is n, while the numerator is the prize's corresponding weighted chance, added by the preceding weighted chances and modified chances.

If the Sim has Unlucky trait, the result is a bit different. The denominator n is equal to the sum of base weighted chances, as well as the modifiers (this is applied to other factors as well, but in this case, the Sim only has Unlucky trait); n = 30 + 25 + 15 + 10 + (-5) + 7 + (-10) + 7 + (-12.5) + 5.95 + (-15) + 0.05 + (-10) = 47.5. And then x is picked between 0 and 1 again, and the outcome would be like this:

50 100 500 1,000
0 ≤ x < 30/47.5 30/47.5 ≤ x < 55/47.5 55/47.5 ≤ x < 70/47.5 70/47.5 ≤ x < 75/47.5
5,000 50,000 100,000 1,000,000
75/47.5 ≤ x < 72/47.5 72/47.5 ≤ x < 66.5/47.5 66.5/47.5 ≤ x < 57.45/47.5 57.45/47.5 ≤ x < 47.5/47.5

See, 55/47.5 is already greater than 1.00. Theoretically it's impossible to get past §100. And beyond §5,000 prize is logic error, so it's even more impossible. Nikel Talk Vote! 06:37, March 30, 2014 (UTC)

As a side note, it's more precise to call it weighted chance than percentage chance. That's because the denominator isn't always 100, hence the chances don't use %. Nikel Talk Vote! 06:41, March 30, 2014 (UTC)