[Math] with a graph: exponential but never reaches 1

exponential function

The following is what I am hoping to accomplish:

enter image description here

The main points here are:

  • It curves
  • It can't ever reach $1$
  • Any number can be supplied for $X$
  • The resulting $Y$ gets the most 'bang for its buck' earlier on the $X$
  • $Y$ past a certain point (lets say around $1$ on the $X$) goes up really really slowly

I'm a game developer, and I need this so that the higher a supplied X goes, it never hits $1$ on the $Y$, but there is at least a little room for growth early on (between like $0.01$ and $0.5$ish on the X). Think of like 'run speed' of your character… there is a real limit on how fast a character should feasibly be able to run, but if someone were to level up their ability to run really high, there should be diminishing returns that total under the fastest the game should ever allow, but still allowing for growth (for instance, if $X$ is $10$, it should be extremely close to $1$ on the $Y$, but it still should be lower on the $Y$, than $20$ on the $X$).

Thanks in advance for all of your help! I don't have any better place to ask this, so your help is very very appreciated!

Best Answer

Consider a graph of the form $\displaystyle f(x)=1-e^{-kx}$.

Let $k$ be positive.

Let's say there's a point at which the growth slows down past a certain point, $a$.

The larger $k$ is, the smaller $a$ is.


So I'm curious, because this will help me answer your question more accurately and thoroughly, what is this graph representing?

Is it saying that the character accelerates as they run, but doesn't go faster than $1$ m/s? Because that's what I understand.

Or maybe, is it saying that as you level up your character, they run faster and faster? But even at higher levels, they will not run $1$ m/s, although they get closer?

Related Question