Hard questions

Like in actually hard to answer questions about the game. (not the awkward things you ask to others)

Some of you may be aware of my attempts of building the ISG linked in my signature. For that I am making this thread to adress peculiarly hard or technical questions about the game. Even though that is its main purpose, feel to post yor own questions, they may even end up illustrated in the guide.

So lets start

How is melee damage calculated?
I suppose its 1d(your force)+1d(your weapon damage) but what happens when the weapon has more than a type of damge, like both cut and pierce?

How is skill gain determined in melee weapon with more than one type of damage?

How is ranged damage calculated?

The ecuations for calculating dispersion?

The time for a revival

Odds of a flu kicking in in relation to the health stat?

The minimum of the hidden health stat one can have before dying, is it 0?

Things I have the answers to offhand:

This is handled in melee.cpp in melee_practice()
The short version is that each miss spreads practice evenly amoung the attack types the weapon is cabable of (pretty slow progress though); while each hit distributes practice based on the damage actually inflicted.
There’s a little twist, in that the order in which practice happens depends on the weapon type, so when you attack with a spear, it does stab then bash, which means bash basically gets leftovers, since focus was already reduced by stabbing having its practice.

This is in missed_by() defined in ranged.cpp
rng(0, (8 - firing_skill) * 3) + rng(0, (9 - firearm_skill)) + rng(0, 12 - dex) + rng(0, 12 - per) + rng(0, arm_encumbrance * 2) + rng(0, eye_encumbrance * 4) + rng(0, ammo_dispersion) + rng(0, gun_dispersion) + rng(recoil / 4, recoil)

This is in ready_to_revive() in items.cpp (corpses are items)
Each turn, the chance to res is:
age_in_hours > 6 && one_in( (age_in_hours - ((corpse_burnt/corpse_volume) * 24)) / corpse_damage + 1)
In other words, no revival earlier than 6 hours regardless.
After that, burning scales back effective corpse age based on proportion of burnt-ness (once burnt == volume, the item is destroyed outright), and the age is divided by amount of damage (the scale is 0-5), so wacking a zombie corpse once doubles time to resurection.

There isn’t one, low health stat won’t kill you, you’ll just have chronic colds and such.

Thanks Kevin! Browsing through the code can be kinda hard

There appears to be a function for this (melee_practice in melee.cpp), that figures out which damage source is the most prominent. It then:

  1. Practices melee for rng(2,5) [5,10 if you successfully hit]
  2. Practices each damage type in descending order for rng(2,5) [5,10 if a successful hit]

The only difference that order actually makes is that your focus decreases after each thing practiced, resulting in (extremely slightly) lower gains on the later things practiced. This might actually be something that bears looking at again, since the order of damage’s effect is quite a bit less now that we have focus instead of an xp pool.

Here’s the relevant code:

if (!has_disease("flu") && !has_disease("common_cold") && one_in(900 + 10 * health + (has_trait("DISRESISTANT") ? 300 : 0))) { if (one_in(6)) infect("flu", bp_mouth, 3, rng(40000, 80000), g); else infect("common_cold", bp_mouth, 3, rng(20000, 60000), g); }
Basically if you aren’t already sick then it rolls a one_in(900 + health + [if disease resistant] 300). If that roll succeeds then you have a 1 in 6 chance of being infected with the flu, elsewise you catch a cold instead. This then checks against your mouth protection to see if you are actually infected or not.

I had one more question, what kills you from alcohol od?
The wiki indicated the health stat, but in that case, it seems to be something else.

Thanks for the answer i2

I hate to point out the obvious, but how are you catching colds and flu infections when there aren’t any humans around to catch the viruses from?

With this in mind why not make diseases actually communicable from NPCs and get rid of the ridiculous “random cold from nowhere” which weakens you unreasonably and happens far too often?

Mutated flu/cold diseases. :stuck_out_tongue:

To be truthful it’s simply the way that it’s always been in the game, and nobody has gone through to replicate a more realistic disease system.

[quote=“John Candlebury, post:5, topic:2979”]I had one more question, what kills you from alcohol od?
The wiki indicated the health stat, but in that case, it seems to be something else.[/quote]
Every time you drink alcohol your painkiller amount increases somewhat. If pkill ever goes over a certain value (I think it’s like 200 or so) then you keel over dead.

[quote=“i2amroy, post:7, topic:2979”]Mutated flu/cold diseases. :stuck_out_tongue:

To be truthful it’s simply the way that it’s always been in the game, and nobody has gone through to replicate a more realistic disease system.

[quote=“John Candlebury, post:5, topic:2979”]I had one more question, what kills you from alcohol od?
The wiki indicated the health stat, but in that case, it seems to be something else.[/quote]
Every time you drink alcohol your painkiller amount increases somewhat. If pkill ever goes over a certain value (I think it’s like 200 or so) then you keel over dead.[/quote]

How often does that “catch something” roll hit?

Once every 30 minutes, at the same time that the game lowers pain/radiation and regenerates/decays you if you have the appropriate traits.

Necroing:

I was making !!science!! to the fungal infection effect and wanted to know if i is still supported as my several attempts at getting infected with the disease have failed. At first I thought that perhaps only certain fungaloids could transmit it but it seems that none are actually able to.

Reposting a question from another thread:

How is damage/range calculated for throwing weapons?

Most fungal monsters have the “release spores” attack, notable exceptions are young fungaloids and spores. If you get the “you hear a Pouf!” message, the ability is active. If you’re adjacent to a fungaloid when this ability is triggered or when it dies, it attempts yo infect you via inhalation.
Haven’t checked recently, so it may well be broken. If you’re wearing decent mouth protection you’re immune.

Dont know it may be worth checking out, it seems that while the spores disease can be rarely obtained, it will never infect you with the parasite, and even if it works, it could perhaps use some bonus to the frequency, after all fungaloids are meant to be very infective dont they?

Also I have found some other funny bugs during my testing think ill post them in the garage

Most illnesses can survive in the environment for quite a while, and for the rest the zombies might well be human enough to still be effective vectors, and animals also work as effective vectors.

Colds in the game are pretty generic illnesses and be triggered by a wide variety of causes even in the situation in which Cataclysm occurs.

It’s more bacteria that survive in the environment for ages, thanks to becoming spores.

But fair enough, maybe zombies aren’t dead enough to prevent them being viral hosts.

It would seem awfully silly if you caught a cold when you were sitting in the woods for months on end without going near a single living creature though. There’s only one cause for a cold and that’s a virus.

Both bacteria and viruses that can infect humans are often totally capable of surviving without humans or laying dormant for extended periods of time under the right conditions