Documentation
Readme
View as plain text
################################################################
################# RANDOMIZED ELDER LIFESPAN ####################
################################################################
This mod introduces a random factor into the Death by Old Age, improving gameplay experience and realism.
When your Elder Sims or Pets have their age bar completely filled up, they'll take random amounts of time to pass away from Old Age.
Extreme long life beyond any bonus is now also possible, though due to the random factor, nothing can be guaranteed.
################################################################
############### Random Bonus Time Calculation ##################
################################################################
The heart of the mod is the hooked lifetime bonus calculator function.
The lifetime bonus obtained here only comes into play after all other bonus days (granted by traits, aspirations, life states, drinks, etc.) have been outlived.
The bonus time is expressed in Sim days, and is the three-component proportion (percentage) of the given Sim's or Pet's full fixed lifespan under the game's current aging rules.
The first component is the species-dependent lifetime multiplier. Its value can be:
>>> 20% for Sims
>>> 75% for Cats and Small Dogs
>>> 65% for Large Dogs
>>> 20% for Foxes (from Cottage Living DLC)
>>> 25% for Horses
The second component is a salted constant. It's simply a constant, but it helps distribute the random values more evenly ("pulling upwards" a bit, working against extremely low values).
>>> SQRT(2)
The third component is the random factor. It is simply a call to the Python runtime's built-in random number generator.
>>> RANDOM()
It has been made sure, that upon game change events, no Elders will die instantly, even if they may already be considered to be beyond their time in the latest evaluation.
In this case, they'll get some "last-resort" random bonus time before a Death by Old Age:
>>> 3 - 12 Sim hours
################################################################
############## Potential F.A.Q. and Glossary ##################
################################################################
Q: What is a "game change event"?
A: The game only evaluates the aging system upon certain events happening. These may be, but are not limited to: trait change, lot change, game load, CAS exit, etc.
Q: What is a "multiplier"? How much is the bonus time?
A: A multiplier is essentially a percentage used for calculation. The salted constant and the random factor are also multipliers.
-: As an example, with the 528-day Human lifespan on Long life span setting, the theoretical absolute maximum attainable additional bonus time for an Elder beyond vanilla lifetime is 20% * SQRT(2) * RANDOM * 528 = ~149.3 Sim days.
Q: How can I know when my Sim or Pet is going to die?
A: As the random value is not saved or shown anywhere, there's no way to know if you Sim or Pet has 4 Sim hours or 100 Sim days remaining currently. Moreover, any game change events may secretly trigger re-evaluation of your Sim or Pet. Death by Old Age is always possible, there's no guarantee for a long life...
################################################################
####################### Compatibility ##########################
################################################################
This mod is fully compatible with all mods, which doesn't touch the game's aging-controlling Python scripts. To my knowledge, there are currently no such mods out there.
The following two functions are hooked:
>>> sims.aging.aging_data.AgingData.get_lifetime_bonus
>>> sims.aging.aging_mixin.AgingMixin._create_auto_age_callback
The mod doesn't stick to the saved games, and doesn't add any custom content; however, overly aged Elder Sims and Pets will instantly die, if the mod is removed!