strong text I've been tinkering for some time with a game and I'm having a fair amount of trouble with something:
A noteI have two characters, based on some other feedbackeach of whom have attributes (about ten) in a range (between 1 and 20). TheI want to use these attributes to generate a 'roll' such that the higher roll wins that particular encounter. It's worth noting that the two characters are not damaging/defending each other. They're both rolling to see if they pass what I guess we could call a skill check. They're both rolling to pass/fail against a common value. They do not interact with one another.
Outline
I've been tinkering for some time with a little browser game. It's mostly just for my own education, and I've come to a little problem I'm having a fair amount of trouble with.
You have two characters, each of whom have attributes in a range. Say they have 10 attributes each, and the range is between 1 and 20. I want to use these attributes to generate a 'roll' (just what I've been calling it). The higher roll wins that particular encounter.
However, when I pit two against each other where one of themthe characters has even a small numerical advantage numerically, any formula I've come up with results in the ever-so-slightly superior one winning a huge majority of the time, which. This is undesirable.
My first attempt was fairly straight forward. It wasI've tried weighting the chief 'relevant''most relevant' attribute for thatthe test, weighted at 80%, and athe sum of the less-relevantother attributes weighted at the other 20%. This preserved the silly-huge advantage.
Adding a luck component only matters, it seems, if it's weighted somehow in favour of the lesser character, and I haven't hit a balance there.
I also tried comparing their averages to produce a relative difference, and using that to boost up the lower one a bit, but it, too seems to provide wild swingsweaker character. ForBoth approaches resulted in the significant advantages I'm trying to remove (for example, if I run the encounter 5,000 times, it quite regularly produces one side winning all 5,000. Oops).
Adding a "luck" component only matters, it seems, if it's weighted somehow in favour of the lesser character, and I hope this is enough detailhaven't hit a good balance there. I'm not necessarily looking for mathematical specifics, but rather some general ideas on how
What approaches can I take to blunt the impact thatof a small numerical advantage is having, while increasingbut still preserve and increase that advantage as the relative gap in attributes increases.?
Details
Per the request, some morehere are the specifics I have so far. Though someSome things aren't yet known even to meI haven't figured out yet, so some generalities mustthey remain. generalities:
0.8 * (mainAttribute) + 0.2 (1/3 * subAttA + 1/3 * subAttB * 1/3 subAttC)
0.8 * (mainAttribute) + 0.2 (1/3 * subAttA + 1/3 * subAttB * 1/3 subAttC)
At present, this produces numbers in the neighourhoodneighborhood of 4.0. Attributes are randomly generated between specified ranges. The current test uses one character with attributes from 2 to 4, and the opponent between 3 and 5. Predictably, this produce averages close to 3 and 4 respectively.
With this one-point advantage, I'd like to see the stronger of the two win in the area of 55% to 60% of the time, with this scaling up to winning about 80% of the time with an average attribute advantage of 5 or 6, 90% at advantages of 7 or 8, leaving some room for an unlikely win when the gap grows larger. I'd prefer not to ever have guaranteed wins, but perhaps things becoming very unlikely - to the tune of winning 99.5% or 99.6% of the time when the gap gets very large.
These numbers are, as I said above, quite rough. More that specific implementations to hit the specified ranges, I'm interested more in the means of attaining them. I'm not math-illiterate, but I'm having trouble getting started, moving beyond my simplistic implementation.
Some further details
As has been noted, the The current formula produces an una non-random rollnumber. Randomness comes from the selection of which attributes are relevant. Not all of the attributes are used for each roll. As it stands, it'sIt's possible for the one with the overall weaker attributes to be stronger in the areas relevant to that roll, and steal a win. But, predictably, it happens rarely.
Attempted implementations have included adding a random amount to the total of each roll, but (and I don't know why I didn't see it up front, since it's so obvious) that solves nothing.
TheMy next attempt was to weigh their relative strengths, by taking an average of all of each's stats, dividing them against each other, and using that value to give a small boost to the lesser character. This smoothed things out a little, but still had a pronounced tendency to produce things like 5,000 wins for one guy out of 5,000 tries. It seems promising, but before going down a blind alley, I thought I'd come here. There always seems to be a ridiculous concentration of people thousands of times smarter than me on StackExchange.