Looking for an interesting formula

I am creating a game in which players can create an alloy. To make it less predictable and more interesting, I thought that the strength and hardness of the alloy should not be calculated by a simple formula, since it is extremely easy to find extrema where the alloy has better statistics.

So, there are questions: is there any formula for a function where extrema can only be found by examining all points? Input values ​​will be in percent: 0.0% -100.0%. I think it should look like this: half a sound wave

+7
math random formula
source share
5 answers

A very simple way would be a couple of sin functions, just change the constants and sign for each new player. Here is one example (sin (1.1 * x) + sin (x) + sin (0.9 * x)) ^ 2 alt text
If you use this between 10pi and 20pi, you will have an average increasing function with local minima.

+4
source share

Modulation of a simple linear or exponential function with trigonometric functions whose frequency and amplitude depend on the input should get what you want.

+1
source share

You don’t need a formula, I think, to throw a bunch of random values ​​around your domain and then interpolate (there will be linear interpolation between them). Then you can even completely change the formula every time the game is executed, or from time to time, or slowly change it over time, etc. Etc.

+1
source share

If you need something very difficult to predict, I would suggest using a random number generator with the same seed every time. You can use it as an envelope for any function that you encounter (a trigger function or not) to make it more jagged.

+1
source share

An interesting formula to use would be the gamma pricing model of Black-Scholes options. This happens as follows:

alt text
alt text
alt text
alt text

You can easily replace the variables, here is a graph of how the function looks:

alt text http://www.sqbimmer.com/aalex/gamma.png

0
source share

All Articles