Hurray for maths

First formula with my game. One of the most complex I’ve had to make for something so simple, actually: The starting money you get depending on the difficulty.

I should explain, when you start the game, depending on how hard it is, you’ll be given more or less money so to device how much you get, I wrote this formula.

I started with a simple y=x^2 and noticed the immediate problems of
1. The player gets LESS money the easier it is.
2. the growth scale is broken so you get more exponentially (no way, exponents)

Then I changed it to be y=log(x) and it looked a bit better. No more crazy exponential growth. (I knew I took Calculus for something)

Of course, it’s still getting bigger as the difficulty gets higher, so I made it y=-1*log(x) and get an equation that starts high and ends low with a nice curve.

Next I made it a bit more complicated (squared an X here, did some random division there, multiply by a big number to inflate the result at the end) and get a fairly good graph.

Check out the graph and equation here

I know it could have been simpler, but I like having crazy long math done for something that seems pretty simple, ya know?

Comments

BoaHeck_ArtGent
22. Aug 2015 · 08:17 UTC
Looks like my enthusiasm for the jam after the theme was announced…