Equation for symmetric graph that rises and levels off

117 Views Asked by At

Trying to fine-tune a particular growth pattern needed for a game. In short, for player level 1 to MAX, they need to be able to acquire $y$ resources per level $x$. So $y=f(x)$. So we're talking about a shape similar to $y=\log(x)$, but the requirements are a smooth curve with:

  1. If $x < \frac{MAX}{2}$, the graph rises with a decreasing slope
  2. At $x = \frac{MAX}{2}$ (the midpoint) the slope is 1
  3. If $x > \frac{MAX}{2}$, the graph rises with an increasing slope
  4. The graph is symmetrical around $\frac{MAX}{2}$
  5. $y>0, (-\infty,\infty)$.

The intent is to have $Y$ level off with a limit we can declare in order to avoid higher level players getting excessive rewards. The symmetry should be around a $45^\circ$ angle from $y = x$ (top-left to bottom-right). In other words, think "upper left quadrant of a circle", but being able to push or pull along the circle's radius at the midpoint of the arc.

The two variables we'd like to be able to tune are the rate of growth (how fast the slope decreases and increases around $\frac{x}{2}$) and the limit.

I know this should be dead simple, but I've stumbled on it :)

Update Because I am apparently rubbish at describing this, this image and description might help: https://i.stack.imgur.com/XeMkq.jpg