HELP WITH MATHMATICS.

Posts

Pages: first 12 next last
I'm trying to create a curve in probability. I want it so that the higher your speed the more likely hood you will steal an item, but I don't want you to gain a set % per speed point. So if you had 10 speed the probability of a successful steal would be 2%, but at 100 speed the probability would be 70%. Does anyone know how I can create an algorithm to do this? The numbers used are just examples, so don't make an algorithm for them. I just want to know how to do this for myself so I can decide on a balanced system.
Sounds like you want a sigmoid or half-sigmoid curve. The Ruby math package should probably be able to calculate the hyperbolic tangent or the error function, as starters.
chana
(Socrates would certainly not contadict me!)
1584
@McBick : problem solved......................?
A formula for it is (Speed * 100) / (Speed + 100). A more advanced formula is (Speed ^ X * 100) / (Speed ^ X + 100 ^ X) where I'd recommend you make either X=1, which makes this formula identical to the first one, or X=2. Another possibility is (Speed * Y * 100) / (Speed * Y + 100) where again, Y = 1 brings you back to the first formula. Combined, you get (Speed ^ X * Y * 100) / (Speed ^ X * Y + 100 ^ X).

Play around with different X and Y values until you get the curve you want.
What is this "^"? Is it 2^2=4?
^ = Exponentation.

2^2=2²=4
2^3=2³=8
3^2=3²=9

etc.
chana
(Socrates would certainly not contadict me!)
1584
@Crystalgate : how did you figure out those? by applying mathematics, empirically, or by studying other games?
The (X * konstant) / (X + konstant) formula has been a well known formula to me for years. The other two I figured out when I tried to make my formula more flexible. I tested it by trying to match the values McBick posted and
chana
(Socrates would certainly not contadict me!)
1584
Wow for the 2 other formulas, must've done a lot of maths, one would not just "guess" that kind of function empirically otherwise. How do the others manage ? ask ?
I have no idea what was supposed to be written after the "and." I must have been sleepy when I posted it.

The second formula was devised since the first formula doesn't accelerate the chance of success fast enough. In the examples posted, a character with 100 speed has more than ten times the accuracy of a character with 10 speed. If you use the first formula, you would get a strictly diminishing return, meaning ten times the speed would give less than ten times the accuracy. The only way to fix that was to square the speed value or otherwise make the difference more dramatic.

I never devised the third formula though, I jumped directly to the last one. With the second formula (and by extension, the first one as well), you get a 50% accuracy with 100 speed. To bring it up to 70%, I needed a multiplier which simulated having a higher speed. The Y factor accomplishes that.

Let's look at the formula again: (Speed ^ X * Y * 100) / (Speed ^ X * Y + 100 ^ X)

A higher X value makes the difference between a high and low speed more pronounced. Having 100 speed instead of just 50 matters more the higher the X value is. A higher Y value makes the accuracy higher. It also does lower the impact of having a higher speed a bit.
This is what I was looking for.
Is there any way to do this without exponents because the values go to high to store in variables.
Well, (Speed * Y * 100) / (Speed * Y + 100) doesn't have any exponents. Other than that, what's the highest speed you're dealing with and what's the highest number your RPG Maker can store?
I tried that formula, it doesn't work. When at 10 speed the success rate is 16.66 and when at 100 the rate is 66.66, it should be more than 10 times the value, but instead of increasing the value for each point it decreases. I used this formula:

(Speed*2*100)/(Speed*2+100)

Did I do something wrong?
If you want ten times the speed to mean more than 10 times the success rate, you will unfortunately need an exponential formula. However, ten times 16 is more than 100 already. This makes me wonder though, is there any value where you want the success rate to be 100%? If so, chance is I can simplify the formula a bit.

If you can't figure a formula out, you may have to tell me more precicely what you want it to do.
Here is an example of what I want.

Speed / Success Rate

1 / .01%
2 / .03%
3 / .07%
4 / .15%
5 / .39%

See how each point is a higher increase then the previous point? Also I was only using speed as an example. I just need to have a percentage that can increase more than a set amount for each point of the stat.
Max McGee
with sorrow down past the fence
9159
HOLY SHIT this thread is useful. I wish we had a whole thread devoted to advanced numbers in general.

@McBick:
Sounds from that description like you want Success Rate = Speed Squared. Am I missing something?
No, I was just using that as an example. I want a smaller curve than that. Else the rate would be to high when dealing with higher speed. I just want each point to have more of an affect then the previous point. Basically just want 1 speed to be more than 10 times 10 speed or 10 speed more than 10 times 100 speed.

Pages: first 12 next last