Jump to content

Photo

Getting Old


  • Please log in to reply
101 replies to this topic

#21
Morgorth

Morgorth

    Stranger

  • Supporter
  • Pip
  • 3 posts
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


#22
Cheyron

Cheyron

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,617 posts
In response to post #80297773.


Spoiler

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
Cheyron

Cheyron

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,617 posts
In response to post #80297773. #80297873 is also a reply to the same post.


Spoiler

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

Posted Image

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
f7ckyounexus42069

f7ckyounexus42069

    Newbie

  • Members
  • Pip
  • 11 posts
In response to post #80296313. #80296433 is also a reply to the same post.


Spoiler

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

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


#25
Cheyron

Cheyron

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,617 posts
In response to post #80296313. #80296433, #80299868 are all replies on the same post.


Spoiler

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

#26
Morgorth

Morgorth

    Stranger

  • Supporter
  • Pip
  • 3 posts
In response to post #80297773. #80297873, #80298493 are all replies on the same post.


Spoiler

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.

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


#27
Cheyron

Cheyron

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,617 posts
In response to post #80297773. #80297873, #80298493, #80311783 are all replies on the same post.


Spoiler

yeah whatever probably im not testing every value... if 50 is where it starts then whatever... you are always welcome to edit the source code and recompile... let me know how your calculations work out.

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


#28
Morgorth

Morgorth

    Stranger

  • Supporter
  • Pip
  • 3 posts
In response to post #80297773. #80297873, #80298493, #80311783, #80315203 are all replies on the same post.


Spoiler

I hope I did not annoy you, just wanted to give some constructive comments. I'm not too familiar with C#, but I'll give it a try.

#29
Cheyron

Cheyron

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,617 posts
In response to post #80297773. #80297873, #80298493, #80311783, #80315203, #80318643 are all replies on the same post.


Spoiler

no I f***ed up again and lost my patience... all I ever get on here is do this do that... my bad and apologies

#30
Chococvjr

Chococvjr

    Enthusiast

  • Members
  • PipPip
  • 126 posts
In response to post #80283943. #80284373, #80286128, #80291913, #80291958, #80292168, #80292328, #80296388, #80296513, #80296673 are all replies on the same post.


Spoiler

It is true. After much research I realized that my error was caused by my previous configuration in this mod. He had put the odds at 100%. Now it's working for me. I had to remove the M&B folder from my documents




Page loaded in: 0.952 seconds