Infection chance details and mechanics. Looking deep into the code's eyes.
3 3

43 posts in this topic

Recommended Posts

4 hours ago, agreubill said:

 

After reading this passage (btw, really interesting job on your part with all the RNG stuff deep in code), i can produce a full video of what you describe, happening durint the game. The video is not mine ; it's from the Let's Play of Jackplay (also user of this forum), and it's in French, but i provide the link anyway ; start looking by the 25mins marks (the intrusion is by 30mins, but all the situation is interesting).

 

 

 

 

This gave me an idea and now I get why I never saw this invasion. If you have constructed in your current zone, whatever that is, any stairs, door frames, floors or walls, it removes the intrusion mechanic. What an oddly specific list of objects.

 

3 hours ago, agreubill said:

Going back to the opening question, about zombinfection and scratches ; How "Prone to illness"/"Resilient" impact that ? Could you find anything in code about that ?

 

Sure. This is all I ve found, and they dont do much:

 

- It increases/reduces your probability of catching a cold and its recovery speed. Ambient temperature has no effect on getting a cold, only wetness.
- The non-zombie infection is unaffected by both traits. Semi relevant for the next point: there are levels of infection (just numbers from 0 to 100, directly linked to the sickness moodlet) that vary depending on your current well-being, and when it reaches 0 it removes your non zombie infection.
- For the zombie infection, a separate infection level exists too and the traits do influence its grow rate (it never decays), but currently this doesn't really do anything. The game only looks if you have some level of zombie infection. Probably some leftover code or something they might plan for the future.


Incidentally, this means that Prone To Illness only disadvantage are colds, which can be avoided with Outdoorsman. So you can pick both to get immunity to colds and 2 extra points with zero downsides.

Share this post


Link to post
Share on other sites
On 14/12/2017 at 4:47 PM, Damntry said:

randomNumber > baseDefensePercentage    //If you have no Blunt/Blade Guard perk or thin/thick skin, the                                                                                    // chance of this being true is 29%, which is not too bad.                                                                                               // With both thickSkin and bluntGuard 10, its a 7% chance.

                                                                       //If the above its true, you were marked by the zombie, sucks to be you.

 

newRandomNumber = Number from 0 to 99   //Second random number that decides your fateful fate.

 

if (newRandomNumber > 75)   //This means it has a 24% of being true.

bitten = true       //Soon to be dead. This plays a unique "bitten" sound and leaves a pool of blood.

else

scratched = true    //Maaaaybe not dead. This plays a unique "scratched" sound.

 

Something bothering me (or i don"t read correctly your data-mining intel (which could be true)..

 

When a zed hit and dmg you (29% basic chance i guess ?), it's never a 100% bite/scratch.

 

So, i guess when zed hit & dmg you => there's a 24% chance of bite/scratch => and 76% (per default) for others injuries ?

 

But there's no RNG to check if it's a Bite OR a Scratch, so i assume i miss something ?

Edited by agreubill

Share this post


Link to post
Share on other sites
19 hours ago, Damntry said:

What an oddly specific list of objects.

Well, it's everything you build when you make a durable base, so not so oddly (from the lower lvl of Carpentry [Floor] to the higher [Stair]).

Edited by agreubill

Share this post


Link to post
Share on other sites
On 30/12/2017 at 12:53 PM, agreubill said:

 

Something bothering me (or i don"t read correctly your data-mining intel (which could be true)..

 

When a zed hit and dmg you (29% basic chance i guess ?), it's never a 100% bite/scratch.

 

So, i guess when zed hit & dmg you => there's a 24% chance of bite/scratch => and 76% (per default) for others injuries ?

 

But there's no RNG to check if it's a Bite OR a Scratch, so i assume i miss something ?

 

We are starting from the point of already being damaged by a zombie, regardless of the outcome of all the pseudocode I wrote, but I excluded that and focused on the bite/scratch parts. I ll clarify that on the main post.

 

The default 29% chance is meant to check if you are also going to get bitten/scratched, and if you fail that check, then its 24% chance of bite and 76% of scratch.

 

 

 

On 30/12/2017 at 1:09 PM, agreubill said:

Well, it's everything you build when you make a durable base, so not so oddly (from the lower lvl of Carpentry [Floor] to the higher [Stair]).

 

Yes but on the other hand, if you live on a preexisting building that you barricaded and built crates, etc.., you still get invaded until, for example, you replace a floor piece. I get that their idea was mainly to avoiding intrusions in player made houses though.

Edited by Damntry

Share this post


Link to post
Share on other sites
On 12/15/2017 at 2:34 PM, FireOnAsphalt said:

The only problem I have here is that I've survived a bite. I don't have the save file to prove it anymore, but I actually had a survivor survive two bites once.

 

Never have I even survived a bite once before then, or since. But back in build, I dunno, 34 or so, I had a character survive two bites.

 

Interesting, no?

 

It has been a couple of years but I had the same experience. I think we even had a thread about it back then and there were others that survived a bite. Frankly, I think there should be a 5-10% chance of surviving a bite.  If you know a bite is 100% fatal there is little point in continuing. However, if you know there is a chance you might survive you may go all out in your healing/recovery efforts. This sort of struggle adds to the game in my opinion.

Share this post


Link to post
Share on other sites
On 3/1/2018 at 9:54 PM, Invader Jim said:

 

It has been a couple of years but I had the same experience. I think we even had a thread about it back then and there were others that survived a bite. Frankly, I think there should be a 5-10% chance of surviving a bite.  If you know a bite is 100% fatal there is little point in continuing. However, if you know there is a chance you might survive you may go all out in your healing/recovery efforts. This sort of struggle adds to the game in my opinion.

 

I think so too but currently it is what it is. I ended up using a mod that lets you create a cure using hard to get ingredients, since I host for a friend and the lag was making him get hit all the time. In the end it removed some of the thrill though.

Share this post


Link to post
Share on other sites
19 hours ago, Damntry said:

 

I think so too but currently it is what it is. I ended up using a mod that lets you create a cure using hard to get ingredients, since I host for a friend and the lag was making him get hit all the time. In the end it removed some of the thrill though.

A while ago, I was playing with some friends and one of them has severe attention issues (unable to get medication due to life issues, I think. I didn't pry too deeply.) Well, he would get scratched and bit a lot.

 

What I did was turn zombification off and increased the zombie strength to max. So along with the added damage,  this will still give you a regular infection which can kill you if you don't medically treat it and eat very well for multiple days. I buffed a few other zombie stats to increase the challenge for us. 

 

Regardless of reason for the change and whether you choose a cure mod or remove the infection chance, it will be a trade-off. A trade-off that we make to play with friends. I don't see a way to get around it for now unless we can selectively give non-game-breaking buffs to certain players (to compensate for attention issues or lag, etc.) Almost like a shield in SC2 that would block two or three hits and slowly recharge. Actually, that is an awesome idea. As long as it could be used selectively with options to alter number of hits and cool down time.

Share this post


Link to post
Share on other sites

If you're still looking for things to dig for Damtry, I'd be interested in the chances to get Instant Kills with non-knives. When you swing a bat, axe or similar, what are the chances to get the blood splatter on a standing zombie? How much do Strength and Blade/Blunt Accuracy affect this? Does the raw damage play a roll?

Btw keep up the awesome work, I've found out more reliable information from this thread than a lot of other sources.

Share this post


Link to post
Share on other sites

Big thanks to Damntry for all the data in this thread  : ]

 

Not sure how useful the below info is, but just as FYI:

I've had a recent character die from a fever brought on by a scratch that was neither infected nor zombified in vehicles 35 survival.  I don't recall for certain if it bled, I believe it did though.

After a couple days of gorging and sleeping pills, I went down and got the "deceased" skull moodle with the "high probability of becoming rat food" message (or similar) and didn't reanimate.

This was after getting scratched through a wall at WP town hall...  and will be the last time I have a character with 'restless sleeper' and without 'thick skinned'.

 

If something similar happens again I'll try treating it with antibiotics, having turned loot spawns up to normal in sandbox since; last time I found/tried them, antibiotics did nothing for a zombified infection.

 

 

Share this post


Link to post
Share on other sites
On 16/2/2018 at 6:28 PM, Randomorph said:

If you're still looking for things to dig for Damtry, I'd be interested in the chances to get Instant Kills with non-knives. When you swing a bat, axe or similar, what are the chances to get the blood splatter on a standing zombie? How much do Strength and Blade/Blunt Accuracy affect this? Does the raw damage play a roll?

Btw keep up the awesome work, I've found out more reliable information from this thread than a lot of other sources.

 

My PC broke and Im waiting for replacement parts, but I ll look into it when I get it working.

 

On 18/2/2018 at 5:04 AM, hyperchondriac said:

Big thanks to Damntry for all the data in this thread  : ]

 

Not sure how useful the below info is, but just as FYI:

I've had a recent character die from a fever brought on by a scratch that was neither infected nor zombified in vehicles 35 survival.  I don't recall for certain if it bled, I believe it did though.

After a couple days of gorging and sleeping pills, I went down and got the "deceased" skull moodle with the "high probability of becoming rat food" message (or similar) and didn't reanimate.

This was after getting scratched through a wall at WP town hall...  and will be the last time I have a character with 'restless sleeper' and without 'thick skinned'.

 

If something similar happens again I'll try treating it with antibiotics, having turned loot spawns up to normal in sandbox since; last time I found/tried them, antibiotics did nothing for a zombified infection.

 

Yeah you can die from any fever. Even the ones you get from Hypochondriac can actually kill you if you dont treat it correctly, since all non zombie infections work the same.

Share this post


Link to post
Share on other sites

There is a whole lot of calculations going on when you hit, but I ll try to condense it a bit. Im not going to get into ranged weapons because thats another clusterfuck of mechanics, and there are things about line of sight and multiple hits that I cant really understand without spending too much time.

 

 

Big boring outline of the logic inside the spoilers. Unless you want to take a peek inside the code flow and exact numbers, ignore this.
 

Spoiler

 

For reference, a zombie has 1.0 health points. Any hit with a damage equal or above that number after all calculations, is a killer hit.

 

The calculations are done as a flow, in which the initial number is modified by the step below (each step is preceded by the dash - character), and that result is then carried onto the step below for the next operation.

 



First, there is an initial damage modifier that gets applied before the final modifiers. So either 1a or 1b gets used depending on the target position.

1a) Initial damage modifier (Only if target IS knocked down on the floor)
    - Fixed 2.0 damage.
    

1b) Initial damage modifier (Only if target IS NOT knocked down on the floor)
    - Random number generated between the minimum and maximum weapon damage.
    - Depending if its a Blunt/Blade weapon
        a) Perk Blunt/Blade accuracy between 3 and 6: 
            Multiply 1.1
        b) Perk Blunt/Blade accuracy over 6: 
            Multiply 1.2
        
        Then, depending on your Strength:
            Multiply (0.75 + (0,05 * "Strength perk level"))
    - If using a two handed weapon with only 1 hand
        Subtract minimum weapon damage
    - Divide by the tenth of the accumulated Pain value the player has on Hands, Forearms, and Upperarms, if it has any.
    - Weight Trait modifier:
        Emaciated: Multiply 0.4
        Very underweight: Multiply 0.6
        Underweight: Multiply 0.8
    - You can damage multiple enemies in a single attack, with each successive target decreasing its multiply (dividing) by 2.
        In any case, for the first target we multiply by 2.
    - There is a superAttack concept in code which would multiply damage by 10, but its unused actually.
    - Endurance moodlet level:
        1: * 0,5
        2: * 0,2
        3: * 0,1
        4: * 0,05
    - Panic moodlet level:
        Subtracts 0.1 points of damage for each moodlet level (4), up to 0.4.
    - Stress moodlet level:
        Same as Panic
    - If damage left is less than 0.1, damage is fixed to 0.1
    

2) Now, regardless if the objective is on the floor or not, some final modifiers are applied:
    - Not 100% sure, but range from the enemy seems to increases damage. Multiplies by 0,3 at min range to 1 at max range, which means that max range its better since it doesnt decrease the damage.
    - Something about your ¿angle? relative to the objective. It can multiply damage by 1.5
    - Damage against players is reduced * 0.4. Damage against everything else is multiplied by 1.5
    - Now it modifies damage based on your Blunt/Blade accuracy perks (again)
        Multiply (0.3 + (0.1 * "Blunt/Blade accuracy perk level"))
    - Calculate crit chance. Its based off the crit chance of the weapon itself, and its doubled if the target is on the floor. 
        If you pass the chance roll, you get a * 10 multiplier.
    - If you are using a weapon of the Axe category
        Multiply by 2.
    - And for the last step, all damage is reduced by multiplying by 0.15
    


    
So lets make an specific example (Without taking into account range/angle calculation). Suppose you just spawned, unharmed and fresh, while wielding an Axe in both your hands, and you feel the urge to hack at a helpless, unaware walking zombie. Your char is underweight, has a panic level of 1, and has a Blade Accuracy of 7 and a Strength of 5.

 

Average damage of Axe (1 to 2,5) = 1,75. Crit Chance: 20%

 

Initial modifiers calculation:   1,75 * 1.2 * (0,75 + 0,05 * 5) * 0.8 * 2 * 1.0 - 0.0 - 0,1 = 3,26
Final modifiers calculation: 3,26 * 1.5 * 1.0 * (10 / (100 / 20)) * 2 * 0.15 = 2,934

 

Thats a 1 hit KO! But we are taking averages of both crit damage and weapon damage into account. Without crit and minimum damage:

 

Initial modifiers calculation (min damage):   1 * 1.2 * (0,75 + 0,05 * 5) * 0.8 * 2 * 1.0 - 0.0 - 0,1 = 1,82
Final modifiers calculation (removed crit): 1,82 * 1.5 * (0.3 + 0.1 * 7) * 2 * 0.15 = 0,819

 

Still a pretty good chunk of damage, but when I tested in-game it didnt seem to be close to a 81.9% instakill (and thats the minimum! It should be much higher because of the average). My guess is that the range calculation works in a certain way that I can't wrap my head around, since even trying to hit at max range didnt get me close to a mostly 1-hit kill.

 

 

TL;DR

 

Basically, damage is the only thing that matters, and targets die when they reach zero health (either standing or knocked down), but there are plenty of modifiers and also crit damage that makes a big impact.

 

I ve made a list of the importance on each effect. Its mostly approximations and averages, so in some cases it only serves as a rough outline, but its mostly reliable.
Apart from that there are a couple of unknowns that Im not completely sure how they work. I ve marked them with an asterisk.

 


- Huge effect on damage:
    Current endurance (stamina). Being exhausted makes you hit like a wet noddle.
    Pain on Hands, Forearms, and Upperarms (Bleed, infections and such)
- Big effect:
    Average weapon damage
    Weapon Crit chance
    Emaciated/Very underweight traits
    Blunt/Blade accuracy
    Using a 2 handed weapon in 1 hand
    *¿Melee range from enemy (Most damage at max range)?
- Medium effect:
    Strength
    Underweight traits
    *¿Angle from the enemy?
- Variable effect (Usually a small effect, unless using a low damage weapon):
    Panic
    Stress



Apart from guns and instakill knifes, the Axe is the weapon with the best average damage. The sledgehammer loses because it has no crit chance.

 

I wont do percentage tables this time though, there are too many skills and traits that heavily influence the outcome, and any single example wouldnt be helpful for most people. Not to mention the couple unknowns.

 

 

Man, Im really not looking forward to the vehicle build going live and me having to soft check everything.

Edited by Damntry
Format

Share this post


Link to post
Share on other sites
2 hours ago, Damntry said:

Im not going to get into ranged weapons because thats another clusterfuck of mechanics, and there are things about line of sight and multiple hits that I cant really understand without spending too much time.

Shame...that's actually the mechanics that most interest me.

But interesting stuff none the less, thanks for the info ;)

Share this post


Link to post
Share on other sites
Posted (edited)

Great, appreciate all the info, and must give you some curious info in the case that you want to search these things and give us some more valuable data

 

First: about the melee damage and the 'super Attack' that you mention... In my different runs I experienced something weird, with an axe, being wood cutter/lumberjack, at least 5 times happend to me that my character has a '30 in-game minutes of fury' where it kills every zombie in 1 hit... It feels amazing and never knew what happens

 

Second, I noticed that with a high strenght character, like 7 or more points, knockdown chance by pushing is very reduced (I posted it sometime). Even with 4 strenght points, less than a normal character, is easy to knockdown a zombie with a single charged push (sometimes 2), but when I reach 7 points, I'm sure that zombies goes down only like the 25% of the time

Edited by Brefe

Share this post


Link to post
Share on other sites
Posted (edited)
On 27/2/2018 at 12:13 AM, Fenris_Wolf said:

Shame...that's actually the mechanics that most interest me.

But interesting stuff none the less, thanks for the info ;)

 

I ll do it eventually, but for now know that most of the logic of ranged damage is shared with that of melee.

 

 

15 hours ago, Brefe said:

Great, appreciate all the info, and must give you some curious info in the case that you want to search these things and give us some more valuable data

 

First: about the melee damage and the 'super Attack' that you mention... In my different runs I experienced something weird, with an axe, being wood cutter/lumberjack, at least 5 times happend to me that my character has a '30 in-game minutes of fury' where it kills every zombie in 1 hit... It feels amazing and never knew what happens

 

Second, I noticed that with a high strenght character, like 7 or more points, knockdown chance by pushing is very reduced (I posted it sometime). Even with 4 strenght points, less than a normal character, is easy to knockdown a zombie with a single charged push (sometimes 2), but when I reach 7 points, I'm sure that zombies goes down only like the 25% of the time

 

About your first point, no idea. In the version of the game I have, superAttack was never implemented.

 

On your 2º point, thats strange since it should be the opposite. The more damage per hit (in which strengths helps) the better the chance of knockdown.  it occurs to me that you may have played for a long time and acquired the veteran trait?

 

The only mechanics related to knockdown are:

- Current hit damage vs wielding minimum weapon damage

- Weapon stats

- Charge

- Panic level

 

Edited by Damntry

Share this post


Link to post
Share on other sites
4 hours ago, Damntry said:

 

I ll do it eventually, but for now know that most of the logic of ranged damage is shared with that of melee.

 

 

 

About your first point, no idea. In the version of the game I have, superAttack was never implemented.

 

On your 2º point, thats strange since it should be the opposite. The more damage per hit (in which strengths helps) the better the chance of knockdown.  it occurs to me that you may have played for a long time and acquired the veteran trait?

 

The only mechanics related to knockdown are:

- Current hit damage vs wielding minimum weapon damage

- Weapon stats

- Charge

- Panic level

 

I always play with coward so panic is never at 0 at the time of pushing so thats not the problema I think... 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
3 3