Hey Cheyron,

i think the math is a little off, at least if i understand you correctly.

Currently, you're throw the dice at least once every 5 days, with the chance of death rising with the age of the character.

A 25 year old has a 0,5% chance to die every time you check, right?

This means for this particular check, they have a 99,5% chance to survive.

A year in Bannerlord has 120 days, which means you check at least 120/5 times a year.

The resulting chance of death for one year at the age of 25 would be 1 - 0.995^(120/5), which results to 11.3%.

So it is not that surprising that you see people die within the age range of 20-30 years.

You could change the formula like this:

chance_of_death = (a * time)^(b)

If you want your characters have at least the chance of ~10% to survive to their 40s and assuming the unit of time is years, you could use

a = 0.0035

b = 4.0

this also assumes, that you make one check , on average, every 3.0 days.

Cheers

Morgorth

# Getting Old

Started by
Site Bot
, Apr 30 2020 09:41 PM

101 replies to this topic

###
#21
Posted 01 May 2020 - 07:49 AM

###
#22
Posted 01 May 2020 - 07:54 AM

well the math is accurate to what I described. Although you have a point and you could say the effective probability does not reflect the graph since you roll the dice often. Thanks for your suggestions I will go through it and modify the calculation ;D

###
#23
Posted 01 May 2020 - 08:21 AM

not sure if you checked the source code but the the probability each roll of the dice is actually 0.01%

so actually...

1-0.9999^24 = 0.24%

what is a and b in your example?

so actually...

1-0.9999^24 = 0.24%

what is a and b in your example?

**Edited by Cheyron, 01 May 2020 - 08:24 AM.**

###
#24
Posted 01 May 2020 - 09:10 AM

The mod description:

"The default probability is 20 and this value is the number per 100,000 multiplied by a character's age that that character will die that day...

Example: 100 years old... 100 * 20 / 100,000 = 2% so every 1 to 5 day interval a 100 year old will have a 2% chance to die. A 50 year old will have a 1% chance. 25 years old 0.5% chance."

Also the interval length inherently randomizes chance of death then because if you get 5 1 day checks instead of 1 5day check you'll obviously have a much higher chance of dying if the chance remains the same on each roll or is this accounted for by the scripts

"The default probability is 20 and this value is the number per 100,000 multiplied by a character's age that that character will die that day...

Example: 100 years old... 100 * 20 / 100,000 = 2% so every 1 to 5 day interval a 100 year old will have a 2% chance to die. A 50 year old will have a 1% chance. 25 years old 0.5% chance."

Also the interval length inherently randomizes chance of death then because if you get 5 1 day checks instead of 1 5day check you'll obviously have a much higher chance of dying if the chance remains the same on each roll or is this accounted for by the scripts

**Edited by f7ckyounexus42069, 01 May 2020 - 09:14 AM.**

###
#25
Posted 01 May 2020 - 09:46 AM

oh s*** I need to delete that all, it was linear in 1.0.0 my bad!

###
#26
Posted 01 May 2020 - 03:39 PM

Ah okay. Since you're already using a function were time is an exponent, the (a * time)^(b) should not add anything important that you cant already do just by tweaking numbers.

But if im reading your source code correctly the 'chance to die' stays at 0,01% until age 50,

and then goes to 0,02% and so forth, because MBRandom.Random.next returns integers.

The following diagrams may be of interest:

https://imgur.com/huNtlwK

Those diagrams assume one check every 3.0 days. The two in the first row represent your current model.

The constant 0,01% chance to die, for everyone age 0-50 may be a thing you do not want,

because characters who enter the game at a later stage die at an earlier age.

Although the second row uses the (a * time)^(b) model, the important difference is that it approaches zero smoothly.

There is still a dependency between age at game start and life expectancy, but it is not as large as before.

But if im reading your source code correctly the 'chance to die' stays at 0,01% until age 50,

and then goes to 0,02% and so forth, because MBRandom.Random.next returns integers.

The following diagrams may be of interest:

https://imgur.com/huNtlwK

Those diagrams assume one check every 3.0 days. The two in the first row represent your current model.

The constant 0,01% chance to die, for everyone age 0-50 may be a thing you do not want,

because characters who enter the game at a later stage die at an earlier age.

Although the second row uses the (a * time)^(b) model, the important difference is that it approaches zero smoothly.

There is still a dependency between age at game start and life expectancy, but it is not as large as before.

**Edited by Morgorth, 01 May 2020 - 03:43 PM.**

###
#27
Posted 01 May 2020 - 05:13 PM

*In response to post #80297773. #80297873, #80298493, #80311783 are all replies on the same post.*

Spoiler

**Edited by Cheyron, 01 May 2020 - 05:14 PM.**

###
#30
Posted 01 May 2020 - 07:42 PM

*In response to post #80283943. #80284373, #80286128, #80291913, #80291958, #80292168, #80292328, #80296388, #80296513, #80296673 are all replies on the same post.*

Spoiler