Hey Xodarap777.
Unfortunately I can't understand what you are saying but maybe you could draw a simple graph showing the behaviour for a few points of data (with some notes) which will make more sense to myself and others.
This isn't for class. It's for programming, but it's math. It's kind of a function, but I think it belongs here - my brain is too fried to conceptualize the equation properly. If you can, please write out an equation for me, so I'm not just getting an answer, but learning.
For each point of Agility, my "critical damage" goes up by 2% from any damage number. My AGI starts at 100, for 200% damage.
I need to find a formula for modifying critical *chance* such that for each point of Dex beyond 100 (starts at 100), my chance goes up by x%, such that if it is paired with an equal investment in Agility, my total average damage will go up by 2% per matched point relative to the starting point of 100/100.
E.G., if I have an Agility of 105, my "critical damage" modifier is 2.1x (+110%). If I'm at +5 Dex as well, my overall damage average should be 1.1x (+10%) relative to 100/100. What is the factor by which Dex multiplies my odds of getting that critical hit? At 150/150, I want to be doing twice as much damage as I am at 100/100, holding the +2% damage on critical hits for each 1 point of AGI.
Please assist me if you can unravel my own mess. Thank you
Thank you for the constructive criticism. I figured the actual terms didn't matter as they're just variables. I'll try to make it clearer. The problem is that I couldn't envision the graph of the function or I'd have been able to figure out the function, as I'm not bad at math (I'm just very sleep-deprived lately!). However, it is more obvious to me now that I'm definitely looking for a function, so that's kind-of on the line between algebra and calculus; hopefully I'm in the right subforum.
I'll try this step by step.
Let's say that I can normally jump exactly 100cm into the air.
- I have arbitrary attribute "Dexterity." For each unit of Dexterity (DEX) I possess, I can jump 2% (1.02x) higher on "critical" jumps.
- Currently, my DEX is 100, so when I "critically jump," I jump 200cm high. (At this point, I can only jump either 100cm high or 200cm high.)
- I also have arbitrary attribute "Agility" (AGI), which dictates how often I can jump critically.
- My current AGI is 100, and 100 is the baseline, so I have zero chances of jumping critically. At AGI = 100 and DEX = 100, my average jump is 100cm high.
- Finally, my regular jump height (Rj) varies from day to day, but whatever my regular jump height is, my critical jump (Cj) height is (DEX*2)% (or DEX/50 times) higher, and happens AGI(x)% of the time; and for DEX=AGI (both >100), my average jump (Aj) height is [(AGI -100)*2]% higher than Rj. (Could just as easily say Aj is [(DEX - 100)*2]% higher than Rj.)
- ( So Aj = [(AGI*2)/100]Rj when DEX=AGI? )
Hypothetical example for x:
IF each "point" of AGI above 100 equated to a 1% chance to "critically jump," adding a point of AGI while keeping my DEX the same would result in a 1% lift in my average jumping height (Aj). 1% of the time, I would jump twice as high: so in 100 jumps, { (99 * 100cm) + (1 * 200cm) } / 100 jumps = 101cm average over 100 jumps, or Aj = 1.01(Rj). In this case [ x = 1+ (AGI - 100) / 100 ] for AGI > 100. ... I think. Or, as I'm looking for a percentage per point of AGI, I would say x = AGI - 100. But that's IF I was keeping DEX = 100 and wanted a 1% lift in my average. Instead, I'm keeping DEX = AGI and I want a 2% lift in my average.
So in other words, what I need: Assuming the multiplier for DEX remains the same: a linear 2% multiplier per point (so 100 = 2x; 200 = 4x), what would the formula (function of AGI?) be to make it so that each matched point in AGI and DEX equals a 2% increase to my average jumping height, factoring in critical jumps x(AGI)% of the time.
That is, assuming AGI=DEX and AGI>100 and DEX>100:
(AGI-100)*x% of jumps should be critical jumps to = [(AGI-100)*2]% higher Aj than Rj.
- So, at 101 AGI and 101 DEX, if my regular jump is 100cm, my critical jump is 202cm, and my average jump is 102cm.
- At 150 AGI and 150 DEX, if my regular jump is 150cm, my critical jump is 450cm, and my average jump is 300cm.
- At 200 AGI and 200 DEX, my regular jump is 50cm, my critical jump is 200cm, and my average jump is 150cm.
Okay, so there's a pattern... Aj = Cj - Rj
Ugh, I hit my sleep-deprivation wall again. I know I have a bunch of equations here, now, and some might even be wrong. Can someone please point me in the right direction? I think I saw simple substitution and then my brain pooped out.
Please don't hand me a solution. If it's not too much to ask, please give me a few hints. I can almost see this, I think.
Aj = [((2AGI)/100)-1]Rj , I mean, forgot the -1
Also, the hard way, I notice that at AGI = 150, x (the percentage solution) = 50; at AGI=200, x = 66.666...; at AGI=400, x=77.7777....
How do I find a function from points? Should I subtract 100 from my points since x=0 at AGI=100, or does that matter?
I think I'm making this way harder than it is :P
You said you can jump 2% higher for every DEX point but this means if DEX = 100 then you should jump 200% higher not 100% higher (i.e. 3x not 2x) as you claimed.
I think what you should do is for variables that involve rates, you should store a variable for how many times you have already done something (call it x) and if you can only do y things in a period then you use the function:
f(x) = (y-x) if y-x > 0 or 0 if y-x < 0. This way if you "use" up your abilities in a period then you don't get the extra advantage.
Once you go into a new period you can update the value of x to increase in whatever way you need.
The inability to edit after a short period is very frustrating :/ You are correct in that I misstated, but I meant it the way I worked it out: Cjump = (DEX/50)Rjump. So that's 2%, not +2% - the word "higher" was poorly used - should have said "as high." So at DEX = 50, then, my critical jump is the same height as my regular jump.
I simply want to know what % of the time, as a function of AGI, I must critically jump such that if AGI = DEX and AGI+DEX > 200, and my cricial jump height is (DEX/50)x my regular jump height, my average jump height is ((AGI+DEX) - 200 ) * 2% -- or [((2AGI)/100)-1]x -- higher than my regular jump height.
The probability your jump will be critical is . The probability your jump will not be critical is . The height of your critical jump is where is the height of your regular jump. So, the expected value (or average value) of your jump is:
Pr(reg jump)*Height(reg jump) + Pr(crit jump)*Height(crit jump):
And you want that to equal .
Setting the two expressions equal:
So, that only occurs when . You said there is a 0% chance of critically jumping when , so the answer is . I have a feeling that is not the answer you were looking for, so perhaps something was still misstated?
Now, if you are just looking for the average height of your jump when as a function of , that is much simpler: