Hey, so not a big math guy here but was wondering how I would calculate the following scenario.
Let's say I have an RPG and I want armor reduction to max out at 50%. Each level I give the player a certain amount of points to spend in various stats, armor being one of them. I want each point they spend in armor to get them closer to the 50% max but never actually hit it. What would the formula be for that and what would my factors to adjust the jump in % per point be?
Thanks!
Closer to a number without hitting it
http://en.wikipedia.org/wiki/Asymptote
http://en.wikipedia.org/wiki/Diminishing_returns
I think these will get you on the right track.
http://en.wikipedia.org/wiki/Diminishing_returns
I think these will get you on the right track.
Thanks, that lead me to http://lostsouls.org/grimoire_diminishing_returns which is a pretty cool site that explains this really well, and more geared toward games.
How about using arctan(x), it has an asyptote at pi/2 so if you want to cap it off at 50, you can scale it,
But the problem with that is that it will converge fast, so you can further scale it like so:
Here is a gaph.
The following are the equations for the above colored graph.
f(x) = 50 * 2 / pi * atan(x / 1 ); //black
f(x) = 50 * 2 / pi * atan(x / 10 ) //red
f(x) = 50 * 2 / pi * atan(x / 20 ) //blue
f(x) = 50 * 2 / pi * atan(x / 40 ) //green
f(x) = 50 * 2 / pi * atan(x / 100 ) //orange
You can do something similar off that line.
You can see, for example looking at the blue graph, at level 30 your armor resistance will be a little above 30, and at level 50, it will be a little less than 40, and so on.
f(x) = 50 * 2 / pi * arctan(x) ;
But the problem with that is that it will converge fast, so you can further scale it like so:
f(x) = 50 * 2 / pi * arctan(x / RATE ) ; //higher the rate slower it converges to 50, lower the rate faster it converges.
Here is a gaph.
The following are the equations for the above colored graph.
f(x) = 50 * 2 / pi * atan(x / 1 ); //black
f(x) = 50 * 2 / pi * atan(x / 10 ) //red
f(x) = 50 * 2 / pi * atan(x / 20 ) //blue
f(x) = 50 * 2 / pi * atan(x / 40 ) //green
f(x) = 50 * 2 / pi * atan(x / 100 ) //orange
You can do something similar off that line.
You can see, for example looking at the blue graph, at level 30 your armor resistance will be a little above 30, and at level 50, it will be a little less than 40, and so on.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement