# Process For Building a Function?

I'm trying to write a function that has grows somewhat logarithmically from an initial value to a final value. I know only roughly what the initial and final values should be and how I want the shape function's of the graph to look, but everything I've tried either grows too fast or continues growing well after my final values.

It's been several years since I've done anything beyond basic algebra, derivatives and matrix operations, but (with the help of Google), I remember the basic function transformations ($af(x - h) + v$). However, these do not seem to help much, as I'm still having trouble coming up with a formula such that the output scales appropriately. All of my attempts involved starting with a "basic" function which has a similar shape to what I'd like ($ln(x)$, $sqrt(x)$, $1/x$, etc.), then applying transforms to attempt to make it play nice. When that didn't work, I tried using an exponential to get a function that grows up to (roughly) my maximum ($max * (1 - e^(-x))$). Like the first attempts, this still ended up growing too quickly.

So, I'm at a loss. I don't remember the process I should be using to get the function I'm looking for and it feels like I'm just trying stuff randomly at this point. How do I go about building this thing?

Also, I apologize for being vague with my information. I'd like to provide more details, but there simply aren't any. This is for a game I'm attempting to develop, so the values aren't set in stone, nor is the shape I've suggested. I'll probably end up repeating this process as I find myself needing different values and growth, hence my focus on the process rather than a concrete solution.

Edit: A simple example that might help express my intent: The function in question is to be used for a bonus reward to be given to a player as they build a chain of "kills" or victories. I expect players to easily build chains around 1-10 without much effort, so I want there to be some noticeable growth to show the player that longer chains = higher reward. At around chains of 60-80 is where I'd like to see the reward maximize. The problem (and why I've not stated these values up to now) is that certain victories aren't worth as much as others, to prevent players from beating on weaker players for easy rewards. So their chain is expressed with a point system: That 1-10 chain will be somewhere around 80-120 points, and the 60-80 chains will be around 550-750. In terms of the function/graph, the input/x is the player's current chain in points and the output/y the reward.

Side note: I'm not even remotely sure I'm asking the question properly, nor do I know what tags should be added. If someone knows something that would better summarize what I'm asking, please feel free to correct the title and tags. :(

-
"or continues growing well after my final values". What do you want the function to do after your desired final value? – user21467 Feb 15 '14 at 19:22
Ideally, I'd prefer that once my y value hits the desired final value, it doesn't grow or grows so slowly that it doesn't matter. Not sure if it will help, but this is to be used for a bonus reward type thing. After the reward gets so high, I'd prefer it didn't grow much afterward. I /could/ just dump it into a min() function in code, but that feels like a lazy/poor solution to something that could probably be better expressed in the formula itself. – Ceiu Feb 15 '14 at 19:24
How about something with a horizontal asymptote then? You could make the desired final value be the asymptote, or a little bit less if it's important that that value be actually reached. – user21467 Feb 15 '14 at 19:28
e.g., arctan – user21467 Feb 15 '14 at 19:29
Oh, I see you already mentioned $1-e^{-x}$. – user21467 Feb 15 '14 at 19:29

So I was working off of http://en.wikipedia.org/wiki/Generalized_logistic_curve, and fitting parameters based on your desires; I set $A=80$ as the lower bound, and $K=750$ as the upper bound. I cheated a bit, and set 60 as where the fastest growth should be and 80 as where we should be at basically the peak. (I suspect you want that first number a little lower.) I therefore set $\nu=60/80=0.75$ and $M=60$. I decided that when $x=60$ you wanted $550$ points, so I solved for the value of $Q$ that makes that happen ($0.304616$ if my calculator skills are correct). (Again that might not actually match what you want.) The value of $B$ determines how spread out the increasing-ness is; when $B=1$ it goes almost straight up, while when $B=0.1$ it looks like this: