Original Post
Hello ^^ I'm having a brainlock. There's an equation I'm trying to figure out for the first gaming engine I'm experimenting with. It is related to character attributes and experience: The function getScore(int experience, int perfectScore) { ... } returns a score between zero and perfectScore based on the value of experience. The idiology is that only the lowest possible value of experience (-2147483648) returns a score of zero, whereas only the highest possible value of experience (2147483647) returns a perfect score. Those numbers cover the entire integer scope in Java. Zero experience returns half of a perfect score - meaning average. Experience can go down, and a character can get worse at a skill, or experience can go up, and a character can improve on a skill. Around the average mark (zero experience) it is very easy to gain or lose "levels", meaning a slight change in experience can affect the returned score. Once the experience gets very large or very small, however, the levels begin to advance/decline more slowly. Here is an approximation of the activity I am working for:
Where H is the returned score, and A is the max/min value of experience. So, I know I've worked with graphs like this before in Math class, but I'm having dificulty finding the equation for the above graph. I want it to be as simple as possible, but still provide for an affective scoring system. So far, I have an equation that looks like this: Score = 100/(1 + 1.5^(-X)) And that gives me a pretty graph for the window X:(-10,10) Y:(-10,100) haha... However, I'm not sure how to adapt this function to the variables H and A. Any helpful hints would be much appreciated. Thank you much! :D Oh, and sorry for the long explanation... I like to be thorough.
Where H is the returned score, and A is the max/min value of experience. So, I know I've worked with graphs like this before in Math class, but I'm having dificulty finding the equation for the above graph. I want it to be as simple as possible, but still provide for an affective scoring system. So far, I have an equation that looks like this: Score = 100/(1 + 1.5^(-X)) And that gives me a pretty graph for the window X:(-10,10) Y:(-10,100) haha... However, I'm not sure how to adapt this function to the variables H and A. Any helpful hints would be much appreciated. Thank you much! :D Oh, and sorry for the long explanation... I like to be thorough.