The Sims 4
0 of 0

File information

Last updated

Original upload

Created by

Jupiter

Uploaded by

JupiterKasparov

Virus scan

Safe to use

Documentation

Readme

View as plain text

################################
Randomized Elder Lifespan
################################

This script adds randomness to the Death by Old Age, so it allows all Elders (Sims and Pets) to live for an extended period of time, after their Elder age meter gets full, similar to Sims 3.
This time is fully random, and gets granted in addition to the vanilla bonus time granted by life states, traits, and achievements.

The bonus time is composed of two multipliers, two random factors, and a salted constant.

The first multiplier is the base lifetime multiplier. It defines the species-dependent base value for calculating the granted time. Its value can be one of the following values:
>>> 20% for Sims
>>> 75% for Cats and Small Dogs
>>> 65% for Large Dogs
>>> 20% for Foxes (wild)
>>> 25% for Horses

The second multiplier is the lifetime adjustment multiplier. It depends on the aging settings,
and improves gameplay, by reducing the extreme lifespan attainable on Long lifsepan setting, and extends the relatively short attainable bonus lifetime on Short lifespan setting.
Its value can be one of the following values:
>>> 150% on Short lifespan setting
>>> 100% on Normal lifespan setting
>>> 50% on Long lifespan setting

The combined lifetime multiplier defines the base value granted lifetime. It contains the first random factor, and is capped at 100%. The follwoing expression is used to calculate it:
>>> base lifetime multiplier * lifetime adjustment multiplier * RANDOM

To extend the max attainable bonus lifetime, and - more importantly - to add more variation to the lifespan, a salted constant is introduced.
This (as the name implies) is based on a constant value, but due to the random factor, it actually increases variation. It's very simple:
>>> SQRT(2) * RANDOM

To get the final result in Sim days, we use the same expression that was used in the vanilla function:
>>> sim lifespan * combined lifetime multiplier * salted constant

Hacked function: sims.aging.aging_data.AgingData.get_lifetime_bonus


################################
Observations
################################

Based on my observations, the game does not continuously evaluate Elders' bonus time, but at specific game change events,
such as game start, game load, household change, trait change, lot change.
That is, the random lifespan granted here is just a 'fake' random lifespan; it can change anytime, thus the actual long life for Elders is not guaranteed,
an exact numerical chance of death cannot be calculated; statistical laws apply instead.


################################
Effects
################################

Apart from the randomized Death By Old Age, there are other visible effects of this mod as well:
>>> Death is possible any time of the day
>>> Chance of a 'mass death' event (same-aged Elders dying at the exact same time) is reduced