Test Results: Variable & Realistic death

Thread: Test Results: Variable & Realistic death

  1. ZaPPPa's Avatar

    ZaPPPa said:

    Default Test Results: Variable & Realistic death

    Conclusion

    The research is done. These are good settings for variable death between the age of 18 and 100 years. It will make campaign a lot more interesting, entertaining and sometimes frustrating, trust me.

    <max_age uint="100"/>
    <max_age_before_death uint="101"/>
    <old_age uint="18"/>

    <age_of_manhood uint="12"/>

    If you (a modder) decide to lower the age of manhood, make sure you mod the descr_strat file and change any male between the age of 12 and 16 to be either a named character or make him age 11. Otherwise they will not show up properly.


    With this 'death mod' you may have your king die in the first turn of your campaign. A grandson may die at 18 or your heir's wife may die before bearing any children. You may have a 12 year old kid end up running the kingdom desperately trying to keep the bloodline alive. Your king may die while the heir is on a crusade far, far away. Depending on the mod you use, this may lead to civil war (Deus Lo Vult for example).

    This mod is not for everyone, but if you like challenges and surprises, use it. It will change your campaign.

    Good luck and feel free to use these values.

    =========================================================

    There are several treads about changing death ages to more realistic levels for the middle ages and to create greater variability.

    The three magic numbers that need to be tweaked are:

    max_age
    max_age_before_death
    old_age

    All can be found in the 'desc_campaign_db.xml' file

    Currently the theory is that the chance-to-die calculator is based on a 2y/t basis while most mods run on 0.5y/t. Also, increasing the max_age and max_age_before_death seems to increase the life-span of characters.

    For people willing to run tests and post results, please follow this procedure:
    - Load a mod based on 0.5y/t (DLV for example)
    - Set the 'old_age' to 50.
    - Set 'max_age' and 'max_age_before_death' to whatever number you want
    - Start MTW and start a new campaign
    - Write down the ages of all cardinals. Family members are currently poor test subjects because we don't know if certain traits increase their lifespan.
    - Start going through the campaign turns
    - Whenever a cardinal dies, calculate his age and write this down.
    - Keep going until you have at least ten deaths.
    - Post the results in this thread


    Example of test results post (not real values)

    ==================================

    <max_age uint="140"/>
    <max_age_before_death uint="145"/>
    <old_age uint="50"/>

    Age at death:
    55
    51
    53
    59
    61
    54
    55
    56
    51
    58

    Mean: 55.3 (+5.3)
    Std Dev: 3.13

    (See: http://invsee.asu.edu/srinivas/stdev.html for a mean and stddev calculator)
    Last edited by ZaPPPa; May 31, 2007 at 08:37 AM.
     
  2. ZaPPPa's Avatar

    ZaPPPa said:

    Default Re: Test Results: Variable & Realistic death

    Test1:
    <max_age uint="200"/>
    <max_age_before_death uint="100"/>
    <old_age uint="50"/>

    1180-1210 (60 turns)
    No Deaths whatsoever. No cardinals or family members

    Test2:
    <max_age uint="150"/>
    <max_age_before_death uint="100"/>
    <old_age uint="50"/>

    1180-1210 (60 turns)
    One death:
    52
    Last edited by ZaPPPa; May 22, 2007 at 06:21 PM.
     
  3. alpaca's Avatar

    alpaca said:

    Default Re: Test Results: Variable & Realistic death

    I know you don't want to have discussion in here, but it would be more effective to set the age of all characters to old_age -1 in descr_strat

    No thing is everything. Every thing is nothing.
     
  4. ZaPPPa's Avatar

    ZaPPPa said:

    Default Re: Test Results: Variable & Realistic death

    It would be more effective, but changing all ages takes a lot of time and if you'd want to change the old_age variable at some point, you'd have to do it all over again.
    EDIT: Also, there is an easier way to calculate true life-past-old-age. You can substract the starting age from the death age if a character was over 'old_age' at the start of the game.
    For example: Peter Scherer is 45 years old at the start of the game. I set 'old_age' to 40. He dies at 54. I substract 45 from 54, leaving 9 years. His corrected age at death becomes old_age+years = 49. What we're really looking at is how many turns a character can live beyond old_age, his actual age does not matter so much.

    I am trying achieve death over the whole range of realistic ages. Meaning that characters can die as early as 16 years old and can live until about 90. The early age may not be workable, because, in reality, chance of natural death goes up as people age, but I feel the game simulates a flat rate starting at 'old_age'

    Test 3:
    Tried a slightly different approach to try and figure out what the difference is between 'max_age' and 'max_age_before_death'.

    1180-1200 (40 turns)
    <max_age uint="100"/>
    <max_age_before_death uint="40"/>
    <old_age uint="40"/>

    Result:
    No deaths whatsoever... strange..

    Even more odd: No grandkids whatsoever.. not a single kid was born even though I modded all family members (mine and AI) to have +8 fertility...

    This function that CA used for death and child births makes no sense whatsoever so far... The only thing I can think of is that 'max_age_before_death' must be greater than 'max_age' or the chance-to-die variable becomes close to zero. This leads me to believe the function could be like: max_age_before_death - max_age * X-factor.

    I also found out that 'max_age' must be higher than 60 or the game won't start. The value must be higher than the highest age of any character in the world at startup.


    Test 4:
    <max_age uint="65"/>
    <max_age_before_death uint="90"/>
    <old_age uint="40"/>

    1180-1186 (12 turns, ran out of test subjects)
    Deaths:
    41
    41
    41
    41
    42
    41
    41

    Mean: 41.14
    StdDev: 0.34

    Well, at least people died this time. Now to see if changing 'max_age_before_death' has any effect.

    Test 5:
    <max_age uint="65"/>
    <max_age_before_death uint="900"/>
    <old_age uint="40"/>

    Deaths (1180-1185) (10 turns, ran out of test subjects)
    41
    41
    41
    41
    41
    41

    Mean: 41
    StdDev: 0

    Again.. odd.. 'max_age_before_death' doesn't seem to do anything.


    Test 6:
    <max_age uint="450"/>
    <max_age_before_death uint="900"/>
    <old_age uint="40"/>

    1180-1181 (4 turns.. dropping like flies)

    Deaths:
    41
    41
    41
    41
    41

    I don't get it.. This is some weird stuff..
    Last edited by ZaPPPa; May 24, 2007 at 06:40 PM.
     
  5. ZaPPPa's Avatar

    ZaPPPa said:

    Default Re: Test Results: Variable & Realistic death

    Test 7:
    <max_age uint="90"/>
    <max_age_before_death uint="91"/>
    <old_age uint="40"/>

    1180-1206 - 52 turns (Faction got obliterated by the French)

    Deaths:
    42
    45
    45
    50
    43
    47
    51
    62
    48
    (72)*
    (66)*
    (66)*

    Mean: 53
    StdDev: 10

    *)One cardinal is currently 72 years old (he managed to live 32 years beyond 'old_age' !!) His corrected age is 66 however, still an impressive full 52 turns.
    Two other cardinals are in the mid-60's, both having survived for nearly 50 extra turns.

    This test is looking very promising. Now I need to bring 'old_age' down to 30 or even 20 and try to get the mean around 50 and double the StdDev. This will have the majority (one sigma) die between 30 and 70 which is somewhat realistic yet still playable (realistic would be a mean of 40 or less, but that's not fun)
     
  6. ZaPPPa's Avatar

    ZaPPPa said:

    Default Re: Test Results: Variable & Realistic death

    I slightly changed the test procedure. I gave Flanders (in DLV) 40 diplomats, all 40 years old. They are just standing around waiting to die basically. This provides me with a much easier way to determine age of death and allows me to make a percentage 'chance-to-die-per-turn' calculation. With any luck I can reverse engineer the function CA used.

    Test 8:
    <max_age uint="180"/>
    <max_age_before_death uint="181"/>
    <old_age uint="40"/>

    1180-1206 (so far)

    Deaths:
    45.5
    46
    48
    53
    54.5
    58
    61
    61.5
    63
    65

    (30 diplomats are still alive, all 66 years old)

    10 deaths in 26 years extrapolate up 40 deaths about 100 years. Let me take a guess to the function used by CA using what I have found so far:

    CDpY = (max_age_before_death - max_age) / (max_age - old_age) * 100%

    With the latest numbers that would be:

    181-180 / 180 - 40 = 1 / 140 = 0.7% chance of death per year

    The default numbers are:

    105-90 / 90 - 60 = 15 / 30 = ~50% chance of death per year... In other words, the vast majority will not make it past 62 years old, which is exactly what we have been seeing in the vanilla settings.

    PS. Feel free to discuss.. I've got a much firmer grasp on this stuff now and I'm pretty sure no-one else will run these tests anyway.

    Test 8 update-
    I had to stop the test after an inquisitor showed up and started killing my diplomates. I ended up with 13 deaths in 45 years. 180-40/45 = 3.1, 3.1 * 13 is 40. In other words, I am exactly on track to have lost all 40 diplomats by natural causes when they would have hit old_age. It seems the function is correct.

    My proposed settings for the game are:

    <max_age uint="100"/>
    <max_age_before_death uint="101"/>
    <old_age uint="18"/>


    101-100/100-18 = 1/82 CDpY
    Last edited by ZaPPPa; May 25, 2007 at 10:28 AM.
     
  7. Oldgamer's Avatar

    Oldgamer said:

    Default Re: Test Results: Variable & Realistic death

    Thanks, Zappa. I will start testing this, and see how it works out.
     
  8. Pnutmaster's Avatar

    Pnutmaster said:

    Default Re: Test Results: Variable & Realistic death

    Your Flanders test does seem promising.

    I assumed, very early on, that we would achieve our optimal setting by lowering the old_age variable to a number such as 18 (as you have proposed in the newest testing) and raising max_age to 100 or beyond.

    I wonder why CA ever included the max_age_before_death variable. By placing it one point above max_age, you're essentially negating its influence on the characters, right?
    Under the patronage and bound to the service of the
    artist formerly known as Squeakus Maximus
    Stoic Pantheist of S.I.N
     
  9. alpaca's Avatar

    alpaca said:

    Default Re: Test Results: Variable & Realistic death

    According to my limited tests (I don't want to post them here as I didn't take coherent notes ) I think you're right in assuming a constant chance to die per year. The curve looked vaguely exponential which implies exactly that.
    I'll run another test later and properly write down the data.

    No thing is everything. Every thing is nothing.
     
  10. ZaPPPa's Avatar

    ZaPPPa said:

    Default Re: Test Results: Variable & Realistic death

    I have no idea what CA's idea behind 'max_age_before_death' was. The number seems to have a big factor on the chance to die though. Unfortunately the chance to die is a flat rate and has nothing to do with the actual age, meaning that an 18 year old has the same chance to die as a 90 year old. I hope CA will change this or at least up it up for modding for the next version.

    I ran a test with:
    <max_age uint="100"/>
    <max_age_before_death uint="101"/>
    <old_age uint="18"/>

    And it seems to follow the correct pattern. I lost 20 of the 40 diplomats in 20 years, but as the number of diplomats go down, so does the death rate. A correct test would be to have one diplomat and redo the test one hundred times, writing down the age of death every single time. Obviously this takes way too long.

    It was interesting to see that the father outlived the son for once. The third in line for the throne died peacefully at age 30. A rebel uprising killed the Faction Leader a turn later though.

    I'm pretty sure these 'realistic' settings are not for everyone. I can imagine the outcry on the forums when the Faction Leader suddenly dies of natural causes in his mid-thirties, leaving behind an utterly insane Heir and his perverted brother
    Last edited by ZaPPPa; May 25, 2007 at 01:06 PM.
     
  11. alpaca's Avatar

    alpaca said:

    Default Re: Test Results: Variable & Realistic death

    Quote Originally Posted by ZaPPPa View Post
    And it seems to follow the correct pattern. I lost 20 of the 40 diplomats in 20 years, but as the number of diplomats go down, so does the death rate. A correct test would be to have one diplomat and redo the test one hundred times, writing down the age of death every single time. Obviously this takes way too long.
    You can work around that by dividing the number of deaths through the number of characters at turn start.
    And if we assume the same rules apply to all characters, it doesn't matter if you use the same diplomat and do the test 100 times or 100 diplomats and test it one time (except for external reasons like storms)

    No thing is everything. Every thing is nothing.
     
  12. alpaca's Avatar

    alpaca said:

    Default Re: Test Results: Variable & Realistic death

    First test: 100 Diplos, max_age=70, mabd=71, old_age=50, characters start with 50
    I probably made a mistake somewhere (normalized score ended prematurely) but it's allright really
    The strange thing about this is the SD is larger than the value for the death chance itself.
    Also, the normalized death chance apparently increases (0,04302 mean for the first 19 and 0,14988 for the last 18 (excluding the t38 one), so about three times as high)

    Code: [View]
    Turn	Deaths1	Living	Normalized
    1	0	100	0,00000
    2	0	100	0,00000
    3	5	100	0,05000
    4	4	95	0,04211
    5	1	91	0,01099
    6	4	90	0,04444
    7	7	86	0,08140
    8	5	79	0,06329
    9	1	74	0,01351
    10	4	73	0,05479
    11	3	69	0,04348
    12	5	66	0,07576
    13	3	61	0,04918
    14	4	58	0,06897
    15	1	54	0,01852
    16	2	53	0,03774
    17	5	51	0,09804
    18	3	46	0,06522
    19	0	43	0,00000
    20	6	43	0,13953
    21	1	37	0,02703
    22	3	36	0,08333
    23	5	33	0,15152
    24	3	28	0,10714
    25	0	25	0,00000
    26	4	25	0,16000
    27	1	21	0,04762
    28	3	20	0,15000
    29	4	17	0,23529
    30	1	13	0,07692
    31	3	12	0,25000
    32	1	9	0,11111
    33	3	8	0,37500
    34	0	5	0,00000
    35	1	5	0,20000
    36	1	4	0,25000
    37	1	3	0,33333
    38	2	2	1,00000
    39	0	0	#VALUE!
    40	0	0	#VALUE!
    41	1	0	Err:503
    			
    			
    Mean	2,46		0,11882
    SD	1,92		0,17
    I'll run a further test a bit later

    No thing is everything. Every thing is nothing.
     
  13. alpaca's Avatar

    alpaca said:

    Default Re: Test Results: Variable & Realistic death

    Ok here's the full test (note the increase in the chance to die per 10-turn-interval):

    Spoiler Alert, click show to read: 

    TurnDeaths1LivingNormalizedDeaths2LivingNormalizedDeaths3LivingNormalizedSumAvgSum aliveAvg aliveNormalized avg
    101000,000000100--100------
    201000,000000100--100------
    351000,0500031000,0300051000,05000134,33300100,000,04333
    44950,042115970,051556950,0631615528795,670,05227
    51910,010993920,032613890,0337172,3327290,670,02577
    64900,044443890,033717860,08140144,6726588,330,05318
    77860,081405860,058148790,10127206,6725183,670,08027
    85790,063292810,024696710,08451134,3323177,000,05750
    91740,013513790,037975650,076929321872,670,04280
    104730,054793760,039472600,033339320969,670,04253
    113690,043488730,109591580,0172412420066,670,05677
    125660,075764650,061542570,03509113,6718862,670,05746
    133610,049183610,049183550,054559317759,000,05097
    144580,068973580,051724520,07692113,6716856,000,06587
    151540,018525550,090911480,0208372,3315752,330,04342
    162530,037742500,040003470,0638372,3315050,000,04719
    175510,098043480,062502440,04545103,3314347,670,06866
    183460,065222450,044447420,1666712413344,330,09211
    190430,000002430,046512350,0571441,3312140,330,03455
    206430,139531410,024394330,12121113,6711739,000,09505
    211370,027032400,050004290,1379372,3310635,330,07165
    223360,083332380,052634250,16000939933,000,09865
    235330,151523360,083331210,04762939030,000,09416
    243280,107142330,060611200,05000628127,000,07258
    250250,000001310,032263190,1578941,337525,000,06338
    264250,160003300,100002160,12500937123,670,12833
    271210,047626270,222222140,14286936220,670,13757
    283200,150001210,047620120,0000041,335317,670,06587
    294170,235292180,111112120,1666782,674715,670,17102
    301130,076923160,187500100,0000041,333913,000,08814
    313120,250001130,076921100,1000051,673511,670,14231
    32190,111113120,25000090,0000041,333010,000,12037
    33380,37500090,00000490,4444472,33268,670,27315
    34050,00000190,11111050,0000010,33196,330,03704
    35150,20000280,25000150,2000041,33186,000,21667
    36140,25000060,00000240,5000031144,670,25000
    37130,33333060,00000120,5000020,67113,670,27778
    38221,00000160,16667010,000003193,000,38889
    3900#VALUE!250,40000010,0000020,6762,000,13333
    4000#VALUE!230,66667010,0000020,6741,330,22222
    4110Err:503010,00000010,0000010,3320,670,00000
    42---010,00000111,0000010,3320,670,33333
    43---111,00000--------
    ---------------
    Mean2,58974-0,118822,48718-0,096352,53846-0,100407,615382,53846--0,10418
    SD1,88788-0,172461,68385-0,125432,22245-0,125594,332351,44412--0,08279
    ---------------
    First ten0,39--0,39--0,45--0,41----
    Second ten0,45455--0,41538--0,56140--0,47340----
    Third ten0,67568--0,62500--0,65517--0,65094----
    Last edited by alpaca; May 25, 2007 at 03:47 PM.

    No thing is everything. Every thing is nothing.
     
  14. ZaPPPa's Avatar

    ZaPPPa said:

    Default Re: Test Results: Variable & Realistic death

    Campaigns are definitely more interesting to play using these new settings. In the first real try I lost my one merchant in the second turn and lost my princess at the tender age of 21 (still in her honeymoon).

    I am now going to lower the 'age_of_manhood' to 10 years old and impose the house rule that the kid must stay in a settlement until age 15 and cannot accept marriage before that time. This will help with the proper bloodline. It basically buys 6 more years for the leader and faction heir. Technically you could bring it down to 1 year, but that will lead to way too many traits and ancillaries for the kid.
     
  15. Oldgamer's Avatar

    Oldgamer said:

    Default Re: Test Results: Variable & Realistic death

    Quote Originally Posted by ZaPPPa View Post
    Campaigns are definitely more interesting to play using these new settings. In the first real try I lost my one merchant in the second turn and lost my princess at the tender age of 21 (still in her honeymoon).

    I am now going to lower the 'age_of_manhood' to 10 years old and impose the house rule that the kid must stay in a settlement until age 15 and cannot accept marriage before that time. This will help with the proper bloodline. It basically buys 6 more years for the leader and faction heir. Technically you could bring it down to 1 year, but that will lead to way too many traits and ancillaries for the kid.
    So far, so good. I just lost a Byzantine Emperor at age 71. This is after his predecessor died at 46.
     
  16. CaesarBR's Avatar

    CaesarBR said:

    Default Re: Test Results: Variable & Realistic death

    I'm sorry if i'm wrong in posting it here...but...I think we can reach something interesting by thinking about it:

    I think I figured out a way to modify the aging rate so characters(at least family members) will live the amount of year they should in reality at 1 year per turn, at the descr_campain_db.txt there's the following lines:
    <family_tree>
    <max_age uint="90"/>
    <max_age_for_marriage_for_male uint="60"/>
    <max_age_for_marriage_for_female uint="40"/>
    <max_age_before_death uint="105"/>
    <max_age_of_child uint="10"/>
    <old_age uint="60"/>
    <age_of_manhood uint="16"/>
    <daughters_age_of_consent uint="14"/>
    <daughters_retirement_age uint="45"/>
    <age_difference_min int="-10"/>
    <age_difference_max int="30"/>
    <parent_to_child_min_age_diff uint="12"/>
    <min_adoption_age uint="20"/>
    <max_adoption_age uint="30"/>
    <max_age_for_conception uint="50"/>
    <age_of_manhood_close uint="14"/>
    <max_number_of_children uint="4"/>
    </family_tree>
    so I thought that if I halve all these number except the last one the characters will live the years they should at one year turn campaing.making it look this way:

    <family_tree>
    <max_age uint="45"/>
    <max_age_for_marriage_for_male uint="30"/>
    <max_age_for_marriage_for_female uint="20"/>
    <max_age_before_death uint="52"/>
    <max_age_of_child uint="5"/>
    <old_age uint="30"/>
    <age_of_manhood uint="8"/>
    <daughters_age_of_consent uint="7"/>
    <daughters_retirement_age uint="23"/>
    <age_difference_min int="-5"/>
    <age_difference_max int="15"/>
    <parent_to_child_min_age_diff uint="6"/>
    <min_adoption_age uint="10"/>
    <max_adoption_age uint="15"/>
    <max_age_for_conception uint="25"/>
    <age_of_manhood_close uint="7"/>
    <max_number_of_children uint="4"/>
    </family_tree>
    well, I don't tested it but theoretically I think it's right.At least according to the proportion:
    2(number of turn's needed to the character get one year older)
    x(time certain thing will happen in the character life)
    1(number of year's per turn)
    y(time certain thing will happen in the character life if he
    aged proportionally to 1 year per turn.)
    Equation:
    2 = 1
    x y

    <max_age uint="90"/> thus x = 90 (example)

    2 1
    90 y
    2y = 90
    y= 45
    so we conclude that 2y = x , right?
    it's just a thought, anyone think it's gonna work?
    It's a good alternative to the aging script I think, cause the script causes some problems like devastation never going away.

    P.S: I't would make characters(at least family members) live the amount of year's they supposed at 1 year per turn but their age indication at the character scroll would be wrong.

    by maximianusbr

    P.S: Halve all initial character's age(less the agent's cause I think this mod won't affect them) or else the campaing will not even begin cause some characters will be older then the age limit...
    Last edited by CaesarBR; May 26, 2007 at 09:04 AM.
     
  17. alpaca's Avatar

    alpaca said:

    Default Re: Test Results: Variable & Realistic death

    By the way, as for a formula: I think it's feasible to assume a linear increase in the chance of death, like this:

    cod=|(age - old_age)*(max_age_before_death - max_age)/(max_age_before_death - old_age)|

    No thing is everything. Every thing is nothing.
     
  18. ZaPPPa's Avatar

    ZaPPPa said:

    Default Re: Test Results: Variable & Realistic death

    Maximianus,

    Devastation can be tweaked to last shorter or cause less overall damage to counter the slow recovery.

    Alpaca,

    I hope that's true and your test does seem to hint at it.
    I changed my settings for a real campaign to:
    <max_age uint="100"/>
    <max_age_before_death uint="101"/>
    <old_age uint="18"/>

    <age_of_manhood uint="12"/>

    In reality some ruler took reign as young as 13 years old, so having a 12 year old come of age should be ok. The AI will probably have the boy lead armies, but so be it. At least the chance of having a proper bloodline goes up, which is important with people dying earlier.

    Oh, in my last campaign the faction leader died in the second turn, which gave the whole campaign an interesting twist. Unfortunately the DLV rebel script is rather harsh and I got pounded by rebels shortly afterward.

    PS. Changing 'age_of_manhood' needs to have the descr_strat file changed. Any boy below 16 must now become either a named character or have his aged changed to 11.
    Last edited by ZaPPPa; May 26, 2007 at 09:52 AM.
     
  19. CaesarBR's Avatar

    CaesarBR said:

    Default Re: Test Results: Variable & Realistic death

    Quote Originally Posted by ZaPPPa View Post
    Maximianus,

    Devastation can be tweaked to last shorter or cause less overall damage to counter the slow recovery.
    ohh, it's good! how can I do it????
     
  20. ZaPPPa's Avatar

    ZaPPPa said:

    Default Re: Test Results: Variable & Realistic death

    Look in the settlement_mechanics file for this:

    Code: [View]
          <factor name="SIF_DEVASTATION">
    	 <pip_modifier value="5.0"/>
    	 <castle_modifier value="0.8"/>
             <city_modifier value="1.3"/>
             <pip_min value="0"/>
             <pip_max value="500"/>
          </factor>
    The max value sets the maximum level of devastation per region. I believe the modifier values set how fast devastation goes up and down.