Hit probability formula

Counter123

New member
Joined
Mar 6, 2014
Messages
8
This is not homework, and I got my math degree in 1975, I just can't remember this information.

I have gathered data (see http://s264.photobucket.com/user/counter139/media/Storm1.png.html for plot) of the hit probability of a character in a video game with an abstract hit statistic of x. X cannot be 0, but f(x)->0 as x->0 and f(x)->1 as x->infinity. f(1) happens to be .11 on the red curve and .88 on the blue curve. I have tried variations of 1/(1-e^x) with no luck, what might the formula for these curves be.

Thank you for any help
 
Last edited:
This is not homework, and I got my math degree in 1975, I just can't remember this information.

I have gathered data (see http://s264.photobucket.com/user/counter139/media/Storm1.png.html for plot) of the hit probability of a character in a video game with an abstract hit statistic of x. X cannot be 0, but f(x)->0 as x->0 and f(x)->1 as x->infinity. f(1) happens to be .11 on the red curve and .88 on the blue curve. I have tried variations of 1/(1-e^x) with no luck, what might the formula for these curves be.
Are you asking about trying to do a regression of some sort? If so, you might want to try a spreadsheet program. ;)
 
I have this data in a spreadsheet, and have posted the curve resulting from the collected data. I am trying to identify the nature of the mathematical formula used to create these curves. I am able to get x values from particular situations, and the resultant Y value (rounded to nearest percent).

That is, there is a formula f(x) that produces this data. I can apply certain x values to f(x) and record the rounded result. I need to identify the function f(x). There are two functions plotted Fred(x) and Fblue(x).

Thank you.Storm1.jpg
 
Last edited:
Have I asked in the wrong place? I asked the question of a math tutor, and she said it was a statistics question, to ask someone else.

Or have I expressed the problem poorly?
 
You're asking us for "the" formula, when all we have is a picture of a graph of a curve which, presumably, passes through some set of (unstated) points. As such, there is nothing we can do. (In addition, we offer tutoring, not computer-programming subcontracting. We'd help you learn how to do this yourself; we wouldn't do it for you.)

If you have a set of data points, and perhaps also a set of conditions (related maybe to whatever game you're talking about), then "a" model could be found by running those data points through the "regression" feature of a spreadsheet program. But "the" model will be whatever is coded into the game. ;)
 

I am trying to identify the nature of the mathematical formula used to create these curves.


We'll need the explicit algorithms, before we can help you do that. ;)



I have tried variations of 1/(1-e^x) with no luck

If you'd like to explore, try googling keywords examples+"continuous functions"+"two horizontal asymptotes". You'll find examples like y=x/(x^2+1)^(1/2) and y=arctan(x).

 
Last edited:
ETA: To Quaid, I have tried, including exactly the search terms you showed. Problem is the left end is f(x)->0 as x->+0, values of x<0 don't make sense. It might not be an asymptote.


You're asking us for "the" formula, when all we have is a picture of a graph of a curve which, presumably, passes through some set of (unstated) points. As such, there is nothing we can do. (In addition, we offer tutoring, not computer-programming subcontracting. We'd help you learn how to do this yourself; we wouldn't do it for you.)

If you have a set of data points, and perhaps also a set of conditions (related maybe to whatever game you're talking about), then "a" model could be found by running those data points through the "regression" feature of a spreadsheet program. But "the" model will be whatever is coded into the game. ;)

I am a player in this game, not trying to create the program. A hero in the game is attacking a villain in the game, and the hero has an unscaled accuracy of H, while the villain has a unscaled evasion of V [H and V are positive integers], so the formula for hit probability Hp(H,V) is what I have been trying to establish. When I, as the hero, am deciding whether to make the attack, the game tells me the probability (to the nearest 1%) of hitting, and of a critical hit. I have tried enough cases to verify that the results are dependent on H/V (IE Hp(5,10)=HP(10,20). The data in the graph comes from the following data points (I didn't think anyone would want the raw data, or want a detailed explanation). I do not expect anyone to work out the exact formula, I would just like a pointer as to roughly the nature of the formula. I have read about sigmoids, but I don't think that is quite the right thing.

H/V Hit_Prob Crit_Prob
0.358209220
0.413793290
0.547393460
0.606498531
0.608696541
0.654028591
0.674699611
0.724138672
0.767635713
0.802326744
0.802951744
0.8061754
0.833935774
0.835821775
0.873469806
0.885057816
0.905016827
0.908108827
0.916968837
0.92029837
0.927336848
0.929648848
0.942857848
0.996398711
18811
1.0053368811
1.0120358812
1.020088812
1.0270278912
1.0289868912
1.0539429014
1.0596339014
1.0995679116
1.1140359217
1.1265319218
1.1321769218
1.1419759318
1.1493219319
1.2211549523
1.2486499525
1.2636829525
1.3333339730
1.3729739732
1.3731349732
1.4128179734
1.4358979835
1.4752799837
1.4918929838
1.5993219944
1.6086969944
1.6153859945
1.6660819947
1.6821199948
1.7872349952
1.7926369952
1.8333339954
1.97647110059
2.02941210061
2.19047610066
2.22115410066
2.28712910068
2.45744710072
2.66346210076
2.78313310077
2.94680910080
3.24705910083
3.73333310087
4.210090
4.6210091
4.85454510093
5.0810093
5.2510093
5.69090910094
231100100
NOTE: The last value, far to the right of the others, has not been plotted.
 
Last edited:
I am a player in this game, not trying to create the program.
But you're asking us to somehow backwards-engineer what that program contains. We can't do that.

You included a data set. Now plug that data set into your spreadsheet program (such as Excel), and do regressions on it until you find a model with which you're happy. ;)
 
But you're asking us to somehow backwards-engineer what that program contains. We can't do that.

You included a data set. Now plug that data set into your spreadsheet program (such as Excel), and do regressions on it until you find a model with which you're happy. ;)

Thank you. I have the data in Excel, and if by doing regressions you mean trying different formulas until I find one that matches the data, I have tried many. Most of what I have tried are sigmoid functions, but I have come to the conclusion that having the left end of the curve end at f(0)=0 (rather than lim(x->-inf=constant) means it isn't a sigmoid. All I am asking is what kind of a function produces a curve of the nature shown.

Nature of curve: x is a positive rational number. f(x)->0 as x->0 , f(x)->1 as f->+inf. Curve is roughly sigmoid as shown.


For example, If I had said f(x)->constant1 as x->-inf and f(x)->constant2 as x->inf, you could have said "that is a sigmoid curve", I could take it from there by Googling "sigmoid". I am coming under the impression that curves of the nature in my data are not useful enough to be generally used, and have no specific name.
 
Top