ageFractionChanceCurve

Started by Shibdib, August 23, 2016, 11:24:21 PM

Previous topic - Next topic

Shibdib

So for example


        <ageFractionChanceCurve>
          <points>
            <li>(0.25, 0)</li>
            <li>(0.3, 0.001)</li>
            <li>(0.5, 0.00145)</li>
            <li>(1, 0.0016)</li>
            <li>(1.5, 0.0017)</li>
          </points>
        </ageFractionChanceCurve>


What exactly does this mean.. is the first number in years? Is each row a year? is the second number the percentage chance?

RemingtonRyder

These are points on a curve.

The fraction (0.25 to 1.5) is how far into the lifespan a creature is.

The chance (0 to 0.0017) is what the random number generator has to roll lower than - it rolls a value between 0 and 1.

CallMeDio

Nice, I was watching this thread because I found it interesting and wanted to know, only to add on the information about the first number, the human lifespan in rimworld is 80, so a 1 on the first number means it will be the chance at 80 years old, and a 1.5 will be 120 years old.
QuoteYou may need a rubber duck.  Also, try some caveman debugging.

Released mods: No Mood Loss on Prisoner Sold or Died

Shibdib

Quote from: MarvinKosh on August 24, 2016, 11:51:46 PM
These are points on a curve.

The fraction (0.25 to 1.5) is how far into the lifespan a creature is.

The chance (0 to 0.0017) is what the random number generator has to roll lower than - it rolls a value between 0 and 1.

Got it, makes sense now