Designing a curve that inverts

27 Views Asked by At

Background:

I am trying to come up with a formula for gradually increasing difficulty in my game.

The game randomly chooses objects based on weights. The more frequently you get complex objects the harder that level is.

Problem

I want to shift these weights as the level increases so that the game gradually gets more difficult but i also want earlier levels to not have any complex items at all and later levels to have only complex items. See an example of the kind of result im hoping for below

Solution??

I've been using https://www.transum.org/Maths/Activity/Graph/Desmos.asp to plot a curved graph, my original thinking is if it gets thinner then inverts with l, then i've got the right solution. But now that i've achieved that:

y\ =\ \left(\left(\frac{x+w}{l-0.5}\cdot\frac{x+w}{l+0.5}\right)\right)

enter image description here enter image description here It doesn't feel right at all and i'm slowly losing my will to live. I originally tried with Sin and Cos but i dont want the curve to come back round. So then i thought powers make the most sense.

I have added a table of my ideal output where l goes from 0 to 1 (im hoping to make it a percentage so that i can play with the number of levels)

enter image description here

1

There are 1 best solutions below

0
On

Since your level index can start at $1$, I recommend the weight function $f(x)=1-\frac 1x$ as a starting point. Then your weight starts at $0$ and increases to asymptotically near $1$.