Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4 ... 8

Author Topic: Customizable disease mod for contagious, non-communicable and epidemics. Reuse!  (Read 28498 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist

Haha, I actually have rabies and flu and the black plague in my todo list, this will make it quite a bit easier. I plan a system for stopping/healing them as well, but this is nice groundwork. The current system I use is similar, but for made up sicknesses and not quite as refined.

I would like to expand on this and add it to masterwork, probably in with the second next update.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Brilliand

  • Bay Watcher
    • View Profile

Dwarven diagnosers do diagnose syndromes... I'm not clear on what they try to do about them, though.

Sometimes when a dwarf succumbs to "grossed out in the kitchen syndrome" or whatever in Masterwork, he heads off to the hospital and gets diagnosed with... whatever the actual name of the syndrome was, I forget.  Then he goes back to work, because the doctor barely had time to identify the syndrome before it wore off (my doctor being a Lifemancer might have contributed to that).
Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.

Halfling

  • Bay Watcher
    • View Profile

Add saliva to all creatures with the material templates; after that, have rabies add a syndrome effect that makes saliva spread the disease.

That's a pretty sweet idea. I'll do that later today.

Oh man, this is all just so cool.  I've never seen diseases implemented quite as well as you have.

Do you think you'll make more various diseases? It might be interesting to see "Useful" diseases, such as insomnia (adds [NO_SLEEP]) or just plain curious ones, like mutism (removes [CAN_SPEAK]).

Thanks! Making any new disease with this takes literally as much time as copying and editing existing raws (e.g. EPIDEMIC_1 -> NONCOMMUNICABLE_5), changing the syndrome and changing the frequency in the relevant "switch" or adding a new switch. So I could make a metric ton of them. I think I might just add at least noncommunicable blindness for 1% of dwarves later. Insomnia is a good idea too, I'm just not sure I want to give some dwarves superpowers.

Halfling

  • Bay Watcher
    • View Profile

Haha, I actually have rabies and flu and the black plague in my todo list, this will make it quite a bit easier. I plan a system for stopping/healing them as well, but this is nice groundwork. The current system I use is similar, but for made up sicknesses and not quite as refined.

I would like to expand on this and add it to masterwork, probably in with the second next update.

I'd be honored!

I'll give you a short summary of how this works to help you decide how to customize it.

1. The bit in add to creature makes creature capable of performing the relevant SET_EPIDEMIC_BOOL on itself. This has e.g. 5% chance of giving it the EPIDEMIC_BOOL_TRUE syndrome and 100% chance of giving it EPIDEMIC_BOOL_SET syndrome (to prevent repeating this ever).

2. EPIDEMIC_BOOL_TRUE allows a creature to perform EPIDEMIC_SWITCH, which is just what it says - adds random epidemic(s) to the creature. It contains a set of probabilities for a creature to be able to perform SPREAD_EPIDEMIC_1, SPREAD_EPIDEMIC_2, etc. on itself. If prob SPREAD_EPIDEMIC_1 = 50%, any creature of that race now has 2.5% chance of instantly becoming sick with influenza once after entering the map. This happens only once per creature because EPIDEMIC_BOOL_TRUE lasts a shorter time than is required to perform the interaction twice, while EPIDEMIC_BOOL_SET is permanent.*

3. SPREAD_EPIDEMIC_1 is the disease model. A creature that it is performed on can now do SPREAD_EPIDEMIC_1 according to the CDI parameters (this part is to be removed for noncommunicable disease), and will now perform DISEASE_EPIDEMIC_1 on itself at defined intervals for as long as the disease lasts.

4. DISEASE_EPIDEMIC_1 is the disease's symptoms. It's actually an interaction that gives a creature one or several of the disease's syndromes when performed. For example pneumonia has two: [SYN_NAME:is wracked by a violent cough!] (95%) - Coughing blood and fever lasting 1 month, and [SYN_NAME:is losing their lungs to pneumonia!] (10%) - lung necrosis.

Currently my "vanilla" diseases cause a creature to perform DISEASE_X_Y on itself either only once (epidemics) or every month to choose syndromes, and all syndromes last 1 month once chosen, so a diseased dwarf gains and loses symptoms every month, but it could just as well be every day or year.

5. MEDICINE_X is added to IT_CANNOT_HAVE_SYNDROME_CLASS in SPREAD_EPIDEMIC_1 and DISEASE_EPIDEMIC_1 targeting. Currently all my medicines work as both cures for symptoms and for preventing the spread of disease, but for example the following is possible too:

a) Vaccines - add token to SPREAD_EPIDEMIC_1 only. Prevents spread, but does not cure; make permanent by removing the END: in the medicine syndrome
b) Symptomatic drugs - add token to DISEASE_EPIDEMIC_1 only. Prevents symptoms, but not spread.
c) Drugs that relieve particular symptoms of a disease only: split  DISEASE_EPIDEMIC's targeting into two creatures (A and B), define both as SELF_ONLY in the CDI, make syndromes target separately and add IT_CANNOT_HAVE_SYNDROME_CLASS to one syndrome's target only.

Hope that made it more approachable. I'm not assuming you can't read the raws just fine; you're much better at this than I am. Just thought I'd save you some time rather than have you read it line by line. :D



*You may notice this can lead to some clustering of a class of diseases and it does, but it's mostly insignificant in actual play since you still generally get the epidemics and diseases separately so long as their probabilities aren't very high (current: prob: flu=2.5%, pneumonia=1.5%, flu AND pneumonia =0.75%). Why it works this way is I started with diseases with cross-immunity, where a system like this gives no clustering and you can use cumulative probability, plus it's faster to write. I kept it this way because it's faster to write and easier to add to creatures as is for lazy people - to remove clustering, just have every disease have its own EPIDEMIC_SWITCH; then you have to decide individually which gets what. EDIT: I just realized how to fix this if desirable without doing that - make creatures' probability to get epidemics relatively high and individual epidemics' probabilities really low, which would give e.g. bool_epidemic: 50%, flu 5%, pneumonia 3% -> flu 2.5%, pneumonia 1.5%, flu AND pneumonia = 0.0625% ~ 0.0375%=2.5%*1,5%.

Later edit 2: Clustering is now fixed by default in the newest updates.

Halfling

  • Bay Watcher
    • View Profile

Made an update to further test what can be done. This:

Spoiler (click to show/hide)

New disorders:

Developmental disorders:

Gigantism: affects 0,1% of dwarves - does not spread - permanent - dwarf is permanently 2 times the size of regular dwarves and described as "extremely tall". Grants visible label: giant
Dwarfism: affects 0,1% of dwarves - does not spread - permanent - dwarf is permanently 50% the size of regular dwarves and described as "very small". Grants visible label: midget
Congenital blindness: affects 1% of dwarves - does not spread - permanent, treatable with MEDICINE_MIRACLE if defined - dwarf is permanently blind. Grants visible label: blind

Abnormal psychology:

Insomnia: affects 1% of dwarves - does not spread - permanent, treatable with psychiatric medicine - dwarf cannot sleep for one year and then is somewhat drowsy (and sleeps) for half a year. Grants visible label: insomniac
Depression: affects 2% of dwarves (not as depressed as humans) - does not spread - permanent, treatable with psychiatric medicine - unless treated, dwarf is emotionless, moves 20% slower and does sloppy work (lower creativity)
Psychopathy: affects 0,1% of dwarves - does not spread - permanent, not treatable - dwarf is permanently bloodsucker and will sometimes drain sleeping dwarves of blood. Dwarf occasionally goes berserk for ½ day (avg: 1 per 10 months) and attacks any nearby dwarves, then returns to completely normal (and will not be discoverable if there were no witnesses and you missed it). Grants hidden label: serial killer

Also plagues were changed for more realism. Now smallpox is the one that gives blisters (and only occasionally hemorrhagia), and bubonic plague and black plague resemble each other more.

People were feeling like only berserk animals should spread rabies, so I made it spread by attack only. However, I was unable to make it spread by saliva. Creating saliva went fine:


and so adding it to creatures:

Spoiler: creature_domestic (click to show/hide)

However, I then tried making rabies do this:
Spoiler: new raws (click to show/hide)

which didn't work at all, no matter what I tried, so I abandoned that. Anybody want to help me with this?

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile

Oh this is very cool. I would love to see fantasy pack too.

Brilliand

  • Bay Watcher
    • View Profile

which didn't work at all, no matter what I tried, so I abandoned that. Anybody want to help me with this?

Did you see Hugo's post at the end of the last page?  He suggested that instead of having the bit inject saliva, you could just have the creature's mouth by constantly coated in saliva, which would then spread the disease when it came in contact with the skin (i.e. through biting).

Ideally, only creatures with rabies should have saliva coming out of their mouths... not sure whether that's possible, though.
Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution

which didn't work at all, no matter what I tried, so I abandoned that. Anybody want to help me with this?

Did you see Hugo's post at the end of the last page?  He suggested that instead of having the bit inject saliva, you could just have the creature's mouth by constantly coated in saliva, which would then spread the disease when it came in contact with the skin (i.e. through biting).

Ideally, only creatures with rabies should have saliva coming out of their mouths... not sure whether that's possible, though.

Of course most bite attacks use TEETH instead of MOUTH to attack now so you'd need to slap [SECRETION:LOCAL_CREATURE_MAT:SALIVA:LIQUID:BY_CATEGORY:TOOTH:ALL] so now all animals with this (and hopefully saliva material on them) will coat their teeth with saliva, then by somehow  reverse engineering the vampire curse interaction
Spoiler (click to show/hide)

so that it gives the infected creatures saliva the interaction or syndrome to pass on rabies, I've never dabbled into this so this is all the suggestions I can give on a biting attack (I was thinking of suggestions looking at were beast bite attacks + interaction but you can't give or alter an attack through an interaction/syndrome (or can you?))

Also here is an example from an old minior mod I released about how an external syndrome can work.
Spoiler (click to show/hide)

Uses another creatures venom which has ENTERS_BLOOD in it.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile

CE_BODY_MAT_INTERACTION:MAT_TOKEN:LOCAL_CREATURE_MAT:SALIVA

Halfling

  • Bay Watcher
    • View Profile

CE_BODY_MAT_INTERACTION:MAT_TOKEN:LOCAL_CREATURE_MAT:SALIVA
Ha ha oh wow. Thanks. I feel very stupid now, thinking it was something more complex. I'll try it again later. :D

I'm not really a fan of the contact poison saliva because that tends to lead to cascades where dwarves covered in such stuff spread the disease very fast, compare to thralls.

evictedSaint

  • Bay Watcher
  • if (ANNOYED_W_FANS==true) { KILL_CHAR(rand()); }
    • View Profile

I really think this whole "saliva" thing is unnecessary. I like it the way you had it, adding saliva as a poison that spread the disease, being secreted by teeth that can be washed off in the rain and leave puddles of drool...it seems like you're making this way too complicated. 

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile

I like just having it inject better.

Halfling

  • Bay Watcher
    • View Profile

Well, the saliva bit is cool because it actually makes it dependent on how the battles go who gets rabies. Wrestling a dog with rabies - bad idea. Engaging one in steel armor - still somewhat bad idea but much less dangerous. Plus it might open some new modes of contagion for use later.

As it is a rabid creature will use a special attack interaction to transmit it once per day, and there's nothing you can do to prevent it. This is very reliable, predictable and works. If I can get the saliva working, I'll then arena test it to see how reliably and how fast it actually transmits disease to see if it's better.

Can't deny that there's bigger fish to fry though. I just recently discovered I had forgotten a bunch of CDI tokens from the instructions on how to add disease to creatures which lead to the game just plain crashing on embark if you followed them. Fortunately very few people had downloaded those :P but still very bad. It's fixed now. In my own playtesting all seems to be working fine. But definitely needs more "beta" testing.

It also seems that as it is, epidemics are not as bad as you would expect. Dwarves tend to be somewhat apart from each other and epidemics just sometimes die out and vanish without you doing anything if people aren't just chilling in a crowded dining hall. But in an overcrowded, small fort, well... you're going to have meningitis, pneumonia and flu bonanza. And vomit all over your hallways. I like it.

evictedSaint

  • Bay Watcher
  • if (ANNOYED_W_FANS==true) { KILL_CHAR(rand()); }
    • View Profile

Two questions:

1) Will your starting 7 or the first two migrant waves ever have one of the diseases, or are they excluded? I ask because vampires don't show up in either one (I think), but you mentioned earlier that units perform this interaction whenever they entered the map.

2) Are there any suggestions on how to implement medicine?  Obviously, you could make wine a medicine, but I was wondering if there was any way to make medicine that is only used by infected dwarves while they're in the hospital (like a real medicine, I guess.)
Pages: 1 [2] 3 4 ... 8