Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: most syndromes do nothing [BUG]  (Read 1941 times)

Caldfir

  • Bay Watcher
    • View Profile
most syndromes do nothing [BUG]
« on: January 24, 2024, 01:25:52 pm »

bug report: https://dwarffortressbugtracker.com/view.php?id=12668

Summary: many syndrome effects are less powerful than intended by a factor of exactly 10,000
edit: after more investigation, this is probably only affecting vermin-bites in vanilla

Information regarding the severity thresholds of syndromes on the wiki was incomplete, and I was hoping to fill-in the data. Initially I was using modded cats to infect dwarves via head-bumps, but switched to arena-testing when I couldn't make that work. Eventually I just tried arbitrarily large numbers in the arena via custom interactions of the following form:

Code: [Select]
[INTERACTION:DEBUG_INFECTION011]
  [I_TARGET:A:CREATURE]
    [IT_LOCATION:CONTEXT_CREATURE]
  [I_EFFECT:ADD_SYNDROME]
    [IE_TARGET:A]
    [IE_IMMEDIATE]
    [SYNDROME]
      [IE_ARENA_NAME:fever 10kA]
      [CE_FEVER:SEV:10000:PROB:100:START:1:END:5000:ABRUPT]

It soon became evident that the required CE_FEVER:SEV (severity) values needed to be over 10k to have any effect at all. This was not uniform over the effect-types, and I set-out the find the cutoffs. I tested using groups of 10 allied humans for each test-syndrome (edit: confirmed fevers in fortress mode match arena findings). The following is a summary of my research, capturing the lower/upper bounds for each threshold boundary:
Quote
CE_NUMBNESS:
  - 7500A< "completely numb" ~9900A
  - ~500K consistently "injured"
  - never fatal? (tested to 1GA)
 
CE_FEVER:
  - 7500A< "slight fever" ~9900A
  - 100kA< "moderate fever" ~500kA (+"injured" sometimes)
  - ~500kA< "serious fever" ~1MA (+"seriously injured" sometimes)
  - never fatal? (tested to 1GA)
 
CE_DIZZINESS:
  - 7500A< "dizzy" ~9900A
  - ~500K consistently "injured"
  - never fatal? (tested to 1GA)
  - no fainting as described by wiki
 
CE_PAIN:
  - "slight pain" <~2500A???
  - ~50K ("seriously injured" consistently)
  - 100kA< "pain" ~500kA
  - ~500kA< "extreme pain" ~1MA ("unconscious" consistently)
 
CE_NAUSEA:
  - 7500A< "nauseous" ~9900A
  - ~500K consistently "injured"
  - never fatal? (tested to 1GA)
 
CE_UNCONSCIOUSNESS:
  - 7500A< "unconscious" ~9900A
  - never fatal? (tested to 10MA)
  - ~10MA no longer unconscious! (overflow?)
 
CE_SWELLING: (lungs)
  - "slightly swollen"desc ~250A
  - 250A< "swollen"desc ~500A
  - 750A< "quite swollen"desc ~1000A
  - 1000A< "very swollen"desc ~2500A
  - 2500A< "heavily swollen"desc ~5000A
  - 7500A< "completely swollen"desc ~9900A (+"injured" status)
  - causes rot at 9900
    - THIS rot does not trigger functionality-checks (can be triggered by bruising)
 
CE_IMPAIR_FUNCTION:
  - haults lung operation at 9900
  - no partial impairment below threshhold
  - always abrupt

CE_*:...:RESISTABLE:
  - does nothing?

The important note here is that 10k and 1M show up quite frequently in the data. If we divide these values by 10k, we end up with values that fall between 1-100. The outlier is swelling, which seems to have a factor of 100. The effects I tested were of the "constant-effect" variety (as opposed to "cumulative-effect" like CE_NECROSIS that scales with duration).

The vanilla RAWs use SEV levels between 1 and 100 exclusively. This means that most of the default syndromes are totally ineffective, and leads me to believe that the behaviour outlined above is a bug.

The factors of 100 and 10,000 (100^2) being the specific factors here are significant. My guess would be that there is a percentage-conversion that got changed from a "/" to a "*" at some point.
« Last Edit: January 26, 2024, 04:26:58 am by Caldfir »
Logged
where is up?

Caldfir

  • Bay Watcher
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #1 on: January 24, 2024, 01:30:11 pm »

Did a search on the forums for anyone else who noticed this, and the only promising hit was this one from 2016:
After trying to make a human breathe dust with syndrome affects, in the raws of my region 1, i just could not get it to work. Aggravated, i decided to go into the object testing arena (using the default, unedited raws). Lo and behold! The bark scorpion's poison had no effect, and nor did the iron man's gas! I am very confused at this point,  is this a bug or something? i waited a while for the syndromes to show their effects, but i got nothing.

Will try to grab an old 0.4x version to see how far back this goes.

edit: confirmed in 0.47.05

edit: confirmed in 0.43.05 (2016)

edit: present in 0.34.11, but manifestation is slightly different
  - values below CE_FEVER:SEV:9900 result in "slight fever" rather than nothing at all

I could go back farther but it gets harder to test because interactions don't exist, so it would involve licking modded cave-blobs or whatever. The point is somewhat moot. This issue is ten years old.

This explains so much. Why do most forgotten beasts seem so weak? Whatever random syndrome their blood or breath is causing is very likely to be pulling from a pool of effects that are effectively locked to zero!
« Last Edit: January 24, 2024, 07:35:51 pm by Caldfir »
Logged
where is up?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #2 on: January 25, 2024, 06:18:26 pm »

So, how it ought to work is that syndromes have an "adjusted level" which is multiplied by severity, then divided by 100, and then it adds 1 to all that, and if that's below 100 it just doesn't do the effect. How adjusted_level is calculated is:

1. Start with the current syndrome concentration (I think this is usually 10000, by default? A lot of syndromes have explicit set-to-10000 lines just in case in the vanilla raws)
2. Calculate dilution factor as DISEASE_RESISTANCE * SYNDROME_DILUTION_FACTOR/100 (only used for dwarves and alcohol right now, but important to point out)

2. If the symptom is RESISTABLE, multiply the dilution factor by min(500, exposure count*10+100)/100 (apparently RESISTABLE refers to immunity from repeat exposure???? I didn't know this either????)

3. Multiply the dilution factor by min(500, exposure count*10+100)/100

4. If SIZE_DILUTES, multiply dilution factor by body size/100

5. Do... the equation in this graph. Where adjusted_level was L_0, it is now L_1. As you can see, in practice these means that a dilution level of 5000 makes it 1% as strong, of 0 makes it 2x as strong, and 2500 is the halfway point between these.

6. Set the level to 1, if it's lower.

7. If there's a PEAK, multiply so you get a linear ramp-up to PEAK from START, if before PEAK; if after PEAK and no ABRUPT_END, do a similar linear interpolation.

Quick test with king cobra on a human got me an adjusted_level of 990, which sent the pain to "urgent care required" levels immediately, so I suspect it's an issue with PEAK calculations; this syndrome has a PEAK, and an early one, so it gets strong quickly.

Code: [Select]
[SYNDROME]
[SYN_NAME:king cobra bite]
[SYN_AFFECTED_CLASS:GENERAL_POISON]
[SYN_IMMUNE_CREATURE:KING_COBRA:ALL]
[SYN_INJECTED]
[CE_PAIN:SEV:75:PROB:100:RESISTABLE:SIZE_DILUTES:LOCALIZED:VASCULAR_ONLY:START:10:PEAK:50:END:1200]
[CE_DIZZINESS:SEV:50:PROB:100:RESISTABLE:SIZE_DILUTES:START:30:PEAK:100:END:1200]
[CE_DROWSINESS:SEV:50:PROB:100:RESISTABLE:SIZE_DILUTES:START:30:PEAK:100:END:1200]
[CE_PARALYSIS:SEV:100:PROB:100:RESISTABLE:SIZE_DILUTES:START:60:PEAK:100:END:1200]

Caldfir

  • Bay Watcher
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #3 on: January 25, 2024, 09:03:34 pm »

@Putnam Thanks for the quick response!

2. If the symptom is RESISTABLE, multiply the dilution factor by min(500, exposure count*10+100)/100 (apparently RESISTABLE refers to immunity from repeat exposure???? I didn't know this either????)
This explains why my testing made it seem like RESISTABLE does nothing. It makes sense from the perspective of syndromes originally just being poisonous bites, with creatures "building a tolerance" to the poison. With the modern expansion of their functionality, this is unexpected.

An initial expected "concentration factor" of 10k would explain the oddities in my testing. Since I was only testing interaction-based syndromes, and there is no "concentration" available from the interaction itself like with attacks.

The use of the SYN_CONCENTRATION_ADDED tag seems intended as a workaround:
The SYN_CONCENTRATION_ADDED tag was a precaution after I had one bug with effects not fully manifesting due to low levels.  It may not be necessary, but I decided to give everybody a full dose of the juice until I could get a closer look at it.

The vanilla raws, however, use a value of 1000, not 10000. I tested it and this does still mean that CE_FEVER:SEV:100 + SYN_CONCENTRATION_ADDED:1000:0 results in only "slight fever". With this pumped up to 10k, this produces the "serious fever" you'd expect. There seems to be a hidden hard-cap of 1000 on SYN_CONCENTRATION_ADDED:X so this cannot be cranked up to 10k to fix the issue. Values below 1000 seem to work alright, but you need SEV:500 to get a "moderate fever" with the maximum concentration-multiplier.

edit: (removed section - information was bad and rambling)
« Last Edit: January 25, 2024, 11:13:08 pm by Caldfir »
Logged
where is up?

Caldfir

  • Bay Watcher
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #4 on: January 26, 2024, 12:09:31 am »

There is definitely still some kind of problem. I will try illustrate with a specific example:

It is not currently possible for an interaction (or vermin-bite) to cause a syndrome that results in "moderate fever" without setting CE_FEVER:SEV larger than 100. Current values for CE_*:SEV in the vanilla game are never larger than 100, indicating this is the "correct" range. SYN_CONCENTRATION_ADDED can be used to increase the adjusted-level, but the maximum allowed value of 1000 is not enough.

The following conditions can be applied easily in the arena to demonstrate:

I've created syndromes specifically avoiding contributions of the dilution-factor, so the problem appears to be with the initial "syndrome concentration".
« Last Edit: January 26, 2024, 12:21:39 am by Caldfir »
Logged
where is up?

Ulfarr

  • Bay Watcher
  • Going on a pilgrimage to Mars
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #5 on: January 26, 2024, 02:25:16 am »

I'm not sure if it'll be of any help, but I've done some limited testing on the effect of severity some years ago (v. 0.44.xx) and it might add a few more "data points".

http://www.bay12forums.com/smf/index.php?topic=173349.msg7935099#msg7935099
Logged
Bring Kobold Kamp to LNP! graphics compatibility fix.

So the conclusion I'm getting here is that we use QSPs because dwarves can't pilot submarines.

Caldfir

  • Bay Watcher
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #6 on: January 26, 2024, 03:57:07 am »

Thanks Ulfarr.

One more piece of information - it does seem like syndromes applied by injection via creature attacks have an extra ~10x multiplier. The following syndrome was used:
Code: [Select]
    [SYNDROME]
      [IE_ARENA_NAME:fever 100A]
      [CE_FEVER:SEV:100:PROB:100:START:1:END:5000:ABRUPT]

  • Via interaction with [SYN_CONCENTRATION_ADDED:1000:0], the target got "slight fever" (vermin bites same)
  • Via creature-attack with [SPECIALATTACK_INJECT_EXTRACT:LOCAL_CREATURE_MAT:IBLOOD_100:LIQUID:1000:1000], the target got "serious fever"

So you unfortunately the amount-injected isn't directly usable as a concentration :S

It kinda felt like I was going crazy because I couldn't find a bug report or anything. Now that I know this is a long-standing "to be looked into" thing I am less worried. Gonna wrap up the investigation here unless someone asks me to keep digging. Will summarize this data on the bug-report and update the relevant sections on the wiki.
Logged
where is up?

dikbutdagrate

  • Bay Watcher
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #7 on: January 27, 2024, 07:40:06 pm »

There is definitely still some kind of problem. I will try illustrate with a specific example:

It is not currently possible for an interaction (or vermin-bite) to cause a syndrome that results in "moderate fever" without setting CE_FEVER:SEV larger than 100. Current values for CE_*:SEV in the vanilla game are never larger than 100, indicating this is the "correct" range. SYN_CONCENTRATION_ADDED can be used to increase the adjusted-level, but the maximum allowed value of 1000 is not enough.


Hey, thanks a ton for doing this research. Roughly 70% of my time modding deals with vermin, vermin bites, and syndromes.
And getting some data here had been on by backburner for awhile.

I also have an idea for how to bypass the 1000 limit, Note that this also works for bypassing the maximum temperature limit.

Try this out, and note the use of the "-" sign:
Code: [Select]
[SYN_CONCENTRATION_ADDED:-13535]

This should permit adding a concentration of a whopping 52000.

Spoiler (click to show/hide)
Logged

Caldfir

  • Bay Watcher
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #8 on: January 28, 2024, 09:51:17 pm »

I mean you don't need to rely on int-shenanigans to get the concentration up - SEV is happy to accept very large values for most of the effects I tested. The main problem is that SEV:100 seems like it is intended to be the maximum, but in practise this isn't the case.
Logged
where is up?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #9 on: January 29, 2024, 03:48:10 pm »

Try adding PEAK:2 to those?

dikbutdagrate

  • Bay Watcher
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #10 on: January 29, 2024, 06:48:46 pm »

2. (apparently RESISTABLE refers to immunity from repeat exposure???? I didn't know this either????)

I don't think anybody knew about that.

It certainly isn't on the wiki.
Spoiler (click to show/hide)
Logged

Caldfir

  • Bay Watcher
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #11 on: February 01, 2024, 01:55:05 am »

Some additional results. I was thinking about bite attacks, and realized I hadn't checked how SYN_CONCENTRATION_ADDED interacts with SPECIALATTACK_INJECT_EXTRACT.

Testing with bite-inject attacks with fevers. Modded dogs attacking standard humans (6 of each set to fight in pairs).
Spoiler: venomous fever-dogs (click to show/hide)

Comparing these to application via interaction (directly applied via arena interface to 6 humans).

Summary of results:
  • (bite) CE_FEVER:SEV:100 + SPECIALATTACK_INJECT_EXTRACT:...:100:100 => "slight fever" (SYN_CONCENTRATION_ADDED:NA/1/10/100 all same)
  • (bite) CE_FEVER:SEV:100 + SPECIALATTACK_INJECT_EXTRACT:...:1000:1000 => "serious fever" (SYN_CONCENTRATION_ADDED:NA/1/10/100 all same)
  • (interaction) CE_FEVER:SEV:100 => nothing
  • (interaction) CE_FEVER:SEV:100 + SYN_CONCENTRATION_ADDED:10:0 => nothing
  • (interaction) CE_FEVER:SEV:100 + SYN_CONCENTRATION_ADDED:100:0 => "slight fever"
  • (interaction) CE_FEVER:SEV:100 + SYN_CONCENTRATION_ADDED:1000:0 => "slight fever"
  • (interaction) CE_FEVER:SEV:1000 + SYN_CONCENTRATION_ADDED:1000:0 => "serious fever"

From this we can deduce:
  • SYN_CONCENTRATION_ADDED is *ignored* when using SPECIALATTACK_INJECT_EXTRACT.
  • SYN_CONCENTRATION_ADDED is a simple multiplier applied to SEV for interactions (and vermin-bites?).
  • SYN_CONCENTRATION_ADDED:X:0 is ~10x weaker than SPECIALATTACK_INJECT_EXTRACT:...:X:X

I am very curious where that extra 10x multiplier is coming from on the inject attacks.
Logged
where is up?

Caldfir

  • Bay Watcher
    • View Profile
Re: most syndromes do nothing [BUG]
« Reply #12 on: February 01, 2024, 02:18:43 am »

Testing suggested by Putnam with PEAK:2 rather than ABRUPT.

Spoiler: fever interactions (click to show/hide)

Everybody starts off with "moderate fever" here. The 400x1000@2 tapered-off to "slight fever" first, followed shortly by the 600x1000@2 group. Everybody ends up "healthy" at around the same time (I couldn't tell any difference) which is kinda strange - would expect the PEAK values to end first.

The SEV*SYN_CONCENTRATION_ADDED seems to dictate the peak value, and ABRUPT/PEAK work as advertized (square vs triangle-wave).

Logged
where is up?