Experience with PHP level algorithm

I am developing a game, and I do not need an array full of levels, which is likely to increase page load when repeated through them, to find the level of users. I needed an algorithm for working independently with it only using the user interface. This is because I want the maximum level to be around 1000, and an array that would take a long time to go through.

I, with some help, will come up with the following algorithm for the difference between each level:

difference = difference + (difference / 7)

And it works well on the lower levels, but this graph is Levels 1-141, and, as you can see, it is very simple until half way, then it shoots and continues to shoot until it reaches 1,500,000,000 experience. Level of experience - 250, which is not enough.

The Graph for Levels 1-141

, : , ? , .

.

+5
3

, .

Level = Experience / 1000

1000 . , , . , , , .

. :

Level = (Experience/1000)^(1/scale)

2 ( sqrt) 1 1000 . . , . . , , , ( ).

, ( , , ). , .

+4

, -, y = 1000, x, x. , , ,

dy/dx = a/x
lim (x->infinity) y = 1,000

,

y = C_0 - a/(x^2)

, ,

lim (x->infinity) y = C_0

,

level = 1,000 - a/(exp^2)

level = 1,000 - a/(exp^2 + 1)

level(0) = 1,000 - a

, , 0, a = 1,000; 1, a = 999. :

level(0) = 1,000 - 1,000(exp^2 + 1)

, 0. , exp; , . 2 - ; .

, . dy/dx, x, x, , .

+3

, , . , 1 1.1 , 1000 1000000. , .

? ? ? .

, - .

: . 1-1000 1 . , . , , . , . , .

0

All Articles