NatFloat: Difference between revisions

From Vintage Story Wiki
No edit summary
No edit summary
Line 15: Line 15:
[[File:Natfloat-stronverinvexp.png]]
[[File:Natfloat-stronverinvexp.png]]
<br><br>
<br><br>
Translated to the Natfloat arguments the horizontal center point in these graphs denote the "avg" value, the width of the plot is determined by the "var" value. In json, these plots would be in the shape of <br><code>{ avg: 100, var: 100, dist: "uniform" }</code>
Translated to the Natfloat arguments the horizontal center point in these graphs denote the "avg" value, the width of the plot is determined by the "var" value. In json, the uniform distribution would be in the written as such: <br><code>{ avg: 100, var: 100, dist: "uniform" }</code>

Revision as of 09:01, 26 March 2019

A somewhat more natural random number generator. The main difference to pure random is that you can define a distribution to influence how often certain values are chosen.

If you create 8000 random numbers between 0..200 and plot them, where the X-Axis is the resulting value and the Y-Axis the amount of times this value was returned then you can see how the random number generator behaves. These are some simple plots for all distributions. Uniform is just your normal average random number generator.

Natfloat-uniform.png Natfloat-triangle.png Natfloat-gauss.png Natfloat-narrowgauss.png Natfloat-verynarrowgauss.png

Natfloat-invgaus.png Natfloat-narrowinvgaus.png Natfloat-invexp.png Natfloat-stronginvexp.png Natfloat-stronverinvexp.png

Translated to the Natfloat arguments the horizontal center point in these graphs denote the "avg" value, the width of the plot is determined by the "var" value. In json, the uniform distribution would be in the written as such:
{ avg: 100, var: 100, dist: "uniform" }