Deterministic Critical / Dodge Chance

Started by
20 comments, last by n00b0dy 11 years, 9 months ago
A) Player knows critical chance from tooltip. He infers that deck size is 10.
B) Player performs 9 autoattacks on simple minions, he is lucky none of them critted (10% chance).
Chance for crit to be last card of the deck = 10%.
Now he goes and attacks enemy champion getting a free guaranteed hit.
Only on the first 10 attacks -- say crit position is 3 in the first shuffle and 9 in the next shuffle, then there's more than 10 swings between crits (same way that you can get 2 crits in a row).
Advertisement
Hmm, if you want fairness but not necessarily predictability of crits, maybe something like the following:
1. Draw 10 out of a deck of 11 (or more generally 10 + x).
2. Put any crits not drawn into the next deck.

Alternately go the probability way instead of a deck. Adjust the probability for each crit pick based upon the expected vs actual number of crits for a sliding window.

Edit: I know it doesn't exactly fulfil the criteria, but the criteria themselves look like the problem for creating predictability.
If you want to prevent double crits, you can simply use the deck system and just prevent the first card to be a critical if the last card was a critical (you can for example choose the first card from the previous cards but the last). But I think double crits are generally ok and the deck system already prevent triple or more crits.

Your rules themselves make it possible to predict some cards, for example the card after a crit and the tenth attack every ten attacks. If you want a less predictable system you should drop some rules.
One thing to be aware of: The card system removes a little bit of the crit chance flexibility. You will only be able to move critical percent up or down by 10%. This is quite a big jump as most games have skills that only increase crit by 1-2%.

One thing to be aware of: The card system removes a little bit of the crit chance flexibility. You will only be able to move critical percent up or down by 10%. This is quite a big jump as most games have skills that only increase crit by 1-2%.


If you do the implementation right it should be possible to get arbitrary crit chances.


E.g. if 1 out of 4.5 hits is a crit you alternate between decks with 4 and 5 cards.

That is, use integer numbers for the deck sizes and accumulate the decimal amounts until they account for an additional card
You can also use a bigger deck. 10% would mean 10 crit cards in a 100 card deck. The more cards you use, the less able a player will be to "count cards", so to speak, and try to line up guaranteed crits. At least without third-party tools to do the job for him. With in-place shuffling, you can mitigate the overhead of shuffling so that the larger decks do not become a performance problem. Set your deck size to correspond to the smallest increment of crit chance.

You can also use a bigger deck. 10% would mean 10 crit cards in a 100 card deck. The more cards you use, the less able a player will be to "count cards", so to speak, and try to line up guaranteed crits. At least without third-party tools to do the job for him. With in-place shuffling, you can mitigate the overhead of shuffling so that the larger decks do not become a performance problem. Set your deck size to correspond to the smallest increment of crit chance.


You wouldn't be able to guarantee one crit in 10 though. You could only guarantee one crit in 91 attacks.
One way to solve your problem of double-crit and predictability is to give every attack a 10% crit chance, and check the previous 2 or 3 attacks to see if there were any criticals to prevent chaining.

This will prevent your guaranteed 1 crit out of 10 attacks unfortunately, and may give up to 2-3 crits in 10 or worse player "never" gets a critical. However, that is still very unlikely with each only having 10% and now the player cannot "count cards" to know when they will get a critical, and prevents getting a critical twice in a row, or every other turn.

Just thought I'd give my two cents on how to prevent exploitation, though it will mess up some of your other requirements.
Always improve, never quit.

One way to solve your problem of double-crit and predictability is to give every attack a 10% crit chance, and check the previous 2 or 3 attacks to see if there were any criticals to prevent chaining.

This will prevent your guaranteed 1 crit out of 10 attacks unfortunately, and may give up to 2-3 crits in 10 or worse player "never" gets a critical. However, that is still very unlikely with each only having 10% and now the player cannot "count cards" to know when they will get a critical, and prevents getting a critical twice in a row, or every other turn.

Just thought I'd give my two cents on how to prevent exploitation, though it will mess up some of your other requirements.


I do not think predicting crits is an issue with the deck system. The crits are still random. You cannot count from the last crit, but you have to keep counting throughout the whole game. And still you can only predict a crit if it is in the last card of the deck. And you have to know how the algorithm deals with changes in crit chance. And also for numbers of cards which are not natural numbers it is totally hopeless.

[quote name='JTippetts' timestamp='1342100047' post='4958393']
You can also use a bigger deck. 10% would mean 10 crit cards in a 100 card deck. The more cards you use, the less able a player will be to "count cards", so to speak, and try to line up guaranteed crits. At least without third-party tools to do the job for him. With in-place shuffling, you can mitigate the overhead of shuffling so that the larger decks do not become a performance problem. Set your deck size to correspond to the smallest increment of crit chance.


You wouldn't be able to guarantee one crit in 10 though. You could only guarantee one crit in 91 attacks.
[/quote]

Lets say player has 4% crit chance. We can implement arbitrary critical chances the following way:

Plain logic:
1) Create a deck size of 100 cards.
2) Mini deck size = 100 / 4 = 25
2) place 1 critical card at each minideck[0,25].
b) [optional prevent doublecrits] with the restriction that the distance between 2 critical cards is at least A.
if (critical Chance <= 10%) A = 5;
else if (critical Chance <= 20%) A = 2;
else if (critical Chance <= 30%) A = 1;
else A = 0;


Code: performance = O( mini-decks ).

int A ;
for each minideck
{
int randomPos = random( minideck.min, minideck.max);
if ( A + randomPos > minideck.max)
{
getNextMinideck().min = ( randomPos + A );
}
}


Lets see what points this algorithm covers:
1) arbitrary critical chance;
2) prevents too frequent crits if critical chance < 30%.
3) [predictable].If player knows critical chance, he knows A, he knows the source code (assume open source game),
he knows minideck size.

Can we remove point c? predictability ? what if we make minidecks variable size ?
instead size=25, make it size = random[20, 30].


There is one big problem that makes it complicated / impossible to implement in rpgs.
What if critical chance changes ? e.g a player uses an ability with +20% critical chance ?
Then it will have to reconstruct all decks from the beginning, losing the previous result = flawed critical chance calculation.

This topic is closed to new replies.

Advertisement