Bay 12 Games Forum

Other Projects => Curses => Topic started by: jasonred79 on March 19, 2010, 12:26:20 pm

Title: How does age effect stats in LCS?
Post by: jasonred79 on March 19, 2010, 12:26:20 pm
All the way from 7 years old to... how old is the maximum age before you die? I assume the longest lived character would be a mutant with 20 health? ... can you get any characters younger than 7 years old? ... how do dogs and genetic monsters age?
I'm also interested in the effects of juice... Does age effect the "base" stats or is it a modifier? Does juice effect the base or the age modified figure?
Title: Re: How does age effect stats in LCS?
Post by: Innominate on March 19, 2010, 09:26:45 pm
The relevant section of code is in creature/creature.cpp (this is for 4.1.4, not the alpha):
Spoiler (click to show/hide)

Short version (note, "between X and Y" means "if they are at least X and not Y or greater"):

The entire process is this (spoilered for length):
Spoiler (click to show/hide)
Title: Re: How does age effect stats in LCS?
Post by: jasonred79 on March 19, 2010, 11:45:57 pm
Wow! Thanks! ... Looks like I could theoratically find child warriors with agility of 10 then? Coolio.

So a mutant with 20 base health has a life expectancy of 118 years? hmmm...

What happens for children under 11 years who have 1 for BASE health? They automatically die? Modified health is set to 1? Base health is set to 3?

What do you lose for having a missing arm? How about 2 missing arms?

Ooh... just found out that children below 10 will very very often end up with heart over 20 at 1000 juice. Like 22 Heart is common.
Title: Re: How does age effect stats in LCS?
Post by: Kay12 on March 20, 2010, 03:11:52 am
Yes, I think the code is bugged - stats can rise over 20 (normal cap) by aging.
Title: Re: How does age effect stats in LCS?
Post by: Innominate on March 20, 2010, 03:23:51 am
Wow! Thanks! ... Looks like I could theoratically find child warriors with agility of 10 then? Coolio.

So a mutant with 20 base health has a life expectancy of 118 years? hmmm...

What happens for children under 11 years who have 1 for BASE health? They automatically die? Modified health is set to 1? Base health is set to 3?

What do you lose for having a missing arm? How about 2 missing arms?
Aging only occurs when the people are 60 or over, regardless of their health. Since their base health is 1, they will not die straight away; nothing modifies base health except for aging, and so they will live on heartily, except extremely feeble, until 60. They'll probably drop dead within days after that.

A mutant with 20 base health and 1000 juice will live even longer. Their modified health stat will be greater than 1 until base health is -4. I can't be bothered to work out how long they would live for, because the "once per day per decade of age do aging" is complicated to do exactly (and as a mathematician, I have a phobia of inexact numbers). Suffice it to say that they would live for a rather long time unless you were extremely unlucky.

For wounds, as far as I can tell missing an arm does absolutely nothing to your stats. However, if you receive wound to your upper spine, your neck, or are missing both arms, you will drop whatever you are holding (and, I assume, be subsequently unable to equip any weapons). Apparently it doesn't even affect martial arts skill (nor, funnily enough, the readouts from combat). Unless I've read the source code wrong, you should be able to punch, kick, grapple or even jump kick, despite missing the relevant limbs.
Title: Re: How does age effect stats in LCS?
Post by: Kay12 on March 20, 2010, 03:35:23 am
At least upper spine injury causes agi and str to lower to 1.
Title: Re: How does age effect stats in LCS?
Post by: jasonred79 on March 20, 2010, 10:32:47 am
A mutant with 20 base health and 1000 juice will live even longer. Their modified health stat will be greater than 1 until base health is -4. I can't be bothered to work out how long they would live for, because the "once per day per decade of age do aging" is complicated to do exactly (and as a mathematician, I have a phobia of inexact numbers). Suffice it to say that they would live for a rather long time unless you were extremely unlucky.

Er... what's so complicated? It's an average of 1 health loss per 10 years for 60+, 2 health loss per decade for 70+, 3 for 80+, so on and so forth...
Title: Re: How does age effect stats in LCS?
Post by: Innominate on March 21, 2010, 12:21:09 am
A mutant with 20 base health and 1000 juice will live even longer. Their modified health stat will be greater than 1 until base health is -4. I can't be bothered to work out how long they would live for, because the "once per day per decade of age do aging" is complicated to do exactly (and as a mathematician, I have a phobia of inexact numbers). Suffice it to say that they would live for a rather long time unless you were extremely unlucky.

Er... what's so complicated? It's an average of 1 health loss per 10 years for 60+, 2 health loss per decade for 70+, 3 for 80+, so on and so forth...
Because you're doing averages, not formal statistical expectation.
Title: Re: How does age effect stats in LCS?
Post by: jasonred79 on March 21, 2010, 01:18:58 am
Er... averages are based on statistical expecation... E(1*10*365/3650)= 1... is that any better for you?

As for mutants, with that number of instances (P=1/3650, N= 200,000), you would have to be EXTREMELY unlucky or lucky to have your life expectancy deviate significantly from 118 years...



Also, I don't quite understand about the modified health stat being greater than 1 until base health is -4. Er... now I gotta ask how juice effects stats... I always thought it was a strict multiplier or something... what's the real formula?
Title: Re: How does age effect stats in LCS?
Post by: Innominate on March 21, 2010, 02:34:26 am
Also, I don't quite understand about the modified health stat being greater than 1 until base health is -4. Er... now I gotta ask how juice effects stats... I always thought it was a strict multiplier or something... what's the real formula?
So at 0 base health, an elite liberal has 6 modified health. I actually just realised (as I was typing this) that they will reach 1 modified at -3 base, not -4; I forgot to round down afterwards :-[

Er... averages are based on statistical expecation... E(1*10*365/3650)= 1... is that any better for you?
The expected lifespan follows a negative binomial distribution (implying a fixed number, R, of successes, with the Rth success falling on the Nth trial, where N is the random variable), with p = 1/3650 and N = trials(days), where (assuming days is days at or over the age of 60):
Code: [Select]
trials(d) = {
d if d < 3650
3650d + 2(d - 3650) ⇒ 3652d - 7300 if 3650 ≤ d < 7300
3*3650d + 3(d - 7300) ⇒ 10953d - 21900 if 7300 ≤ d < 10950
...
n*3650d + n(d - 3650n) ⇒ 3651nd - 3650n[sup]2[/sup] if n ≤ d/3650 < n + 1 ∀ n ∈ ℕ\0
}

So while I can trivially work out the expected number of trials (E(NB(p,R,N)) = R/p ⇒ E(NP(1/3650,23,N)) = 83950 trials), but the number of days is trials-1(83950), which is a bothersome function. Working it out manually, 83950 trials corresponds to 62 years and 313 days, which is an age of 122 (almost 123).

As for mutants, with that number of instances (P=1/3650, N= 200,000), you would have to be EXTREMELY unlucky or lucky to have your life expectancy deviate significantly from 118 years...
True.
Title: Re: How does age effect stats in LCS?
Post by: jasonred79 on March 21, 2010, 02:47:49 am
Right! So it's 23 failed rolls for him to die, not 20!

Hmm... testing if I get the same result as you using simpler intuitive methods.
60-70 : 1 health loss
70-80 : 2 loss
80-90 : 3 loss
90-100 : 4
100-110 : 5
110-120 : 6

Edit due to careless mistake in multiplication:
And at 120, remainder 2 health, with 7 checks per day... E(n*7/3650)=2 .... n=1042.85
So that's 2 years and 313 days, same answer as you. SORTED.
Title: Re: How does age effect stats in LCS?
Post by: Innominate on March 21, 2010, 03:30:44 am
Right! So it's 23 failed rolls for him to die, not 20!

Hmm... testing if I get the same result as you using simpler intuitive methods.
60-70 : 1 health loss
70-80 : 2 loss
80-90 : 3 loss
90-100 : 4
100-110 : 5
110-120 : 6

Edit due to careless mistake in multiplication:
And at 120, remainder 2 health, with 7 checks per day... E(n*7/3650)=2 .... n=1042.85
So that's 2 years and 313 days, same answer as you. SORTED.
Makes me think we should put this on the wiki somewhere.