Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filthiness overhaul #20160

Closed
wants to merge 6 commits into from
Closed

Filthiness overhaul #20160

wants to merge 6 commits into from

Conversation

Night-Pryanik
Copy link
Contributor

After long time of absense, many thoughts and a lot of read discussions I decided to rework the filthiness system.

  • No more morale penalties for wearing filthy clothes. Squeamish characters still can't wear them at all.
  • Instead, non-squeamish characters can wear them as usual, but now it is pretty dangerous to go for melee attack while wearing filthy gear. Now there is a chance for getting an infection due to being hit (the blow must penetrate the armor) by monsters. The chance is rather slim for weak monsters like ordinary zombies and rather high for strong ones, because chance is calculated based on sum of bash, cut and stab damage types.
  • Sneaky or pacifist characters can use filthy gear to trick monsters in ZOMBIE monster group. Wearing filthy clothes makes them to "semi-ignore" the player character. While zombies are far away from player character (but still in their field of view), they actually ignore him, but on small distances zombies will still be acting hostile.
  • Small addition to the washboard using. Now water needed for washing will depend on item volume.

@DangerNoodle
Copy link
Contributor

Seems reasonable, shifting the focus of filthy clothing from morale to a practical concern. There will likely remain the exploit of cutting up filthy clothing to obtain clean raw material, though.

@Coolthulhu
Copy link
Contributor

All of those features look as if better introduced as option than the default, at least at first until they are well tested and mature:

  • Infection for wounds does make sense as a debuff to armors, but there was a giant argument about whether a debuff for zombie-scavenged armor is needed or even wanted. Doubly so when it can be removed by washing.
  • Filthy clothing making zombies have the "ignore" attitude sounds gamebreaking. I didn't test how it works, but from what I can tell it would make zombies only attack player when randomly stumbling and not using special abilities. Also test it with NPCs because NPC aggro code may be a bit better than player aggro.
  • Filthy clothing "invisibility" is currently activated by wearing any filthy clothing. For example, filthy plug (no slots) or filthy socks (very unlikely to be targeted by physical attacks).

Some technical problems:

  • Morale types can't be removed without breaking saves. They have to be obsoleted instead.
  • worn_with_flag is (most common case here) linear with total number of items worn by a character. attitude is called once per character (player/NPC) per monster. This adds up pretty quickly. This would need to be cached somehow, such as by adding an int filthy_volume to Character and recalculating it on wear/takeoff of filthy items.

@BorkBorkGoesTheCode
Copy link
Contributor

The issue chaosvolt mentioned is still valid: Will filthy clothes still disassemble into clean rags, or will filthiness remain attached to the rags as well?

@DangerNoodle
Copy link
Contributor

DangerNoodle commented Jan 29, 2017

That is what I was asking as well. I recall learning of it from seeing their forum signature when observing discussion on the forums.

@Night-Pryanik
Copy link
Contributor Author

Night-Pryanik commented Jan 29, 2017

First of all, this overhaul still leave filthiness in mods category, so I think it could suit for "better introduced as option than the default"

Infection for wounds does make sense as a debuff to armors, but there was a giant argument about whether a debuff for zombie-scavenged armor is needed or even wanted. Doubly so when it can be removed by washing.

Restriction to filthy-only items could easily be removed. Need some more opinions on this.

Filthy clothing making zombies have the "ignore" attitude sounds gamebreaking. I didn't test how it works, but from what I can tell it would make zombies only attack player when randomly stumbling and not using special abilities. Also test it with NPCs because NPC aggro code may be a bit better than player aggro.

Tested this on several types of zombies. They do actually pursuit player on purpose if they are close enough. That's why "semi-ignore".

Filthy clothing "invisibility" is currently activated by wearing any filthy clothing. For example, filthy plug (no slots) or filthy socks (very unlikely to be targeted by physical attacks).

Maybe activate "invisibility" only if filthy clothing covers the head, torso, arms and legs?

Morale types can't be removed without breaking saves. They have to be obsoleted instead.

Need help on this.

The issue chaosvolt mentioned is still valid: Will filthy clothes still disassemble into clean rags, or will filthiness remain attached to the rags as well?

Rags will be filthy too when it will implemented.

@Mecares
Copy link
Contributor

Mecares commented Jan 29, 2017

I have serious doubts that the cleanliness of your clothes would matter if you get injured by an attack from a rotting corpse. Like the cleanliness of your spoon would matter when eating rotten soup...

@Coolthulhu
Copy link
Contributor

First of all, this overhaul still leave filthiness in mods category, so I think it could suit for "better introduced as option than the default"

At the moment it doesn't: the mod option is for filthiness morale penalty, not for filthiness itself. For example, you can take squeamish in full vanilla world and it will work.
To make it a mod thing, you'd need to create a new option in options.cpp, refer to it in mod like in no vitamins mod and check said option before applying the new effects.

They do actually pursuit player on purpose if they are close enough. That's why "semi-ignore".

Test with silent movement and no smell debug traits. It may rely on scent on sound, which would make it really strong for the player. Also test vs. NPCs - that's pretty important because if it's smell+sound, NPCs will be able to freely wreck hulks.

Maybe activate "invisibility" only if filthy clothing covers the head, torso, arms and legs?

I'd add head to that. All body parts with HP is a good arbitrary choice.

Need help on this.

Rename it and change the message, but keep the vector sized as before.
Also, you'll need to obsolete the filthy morale mod by adding "obsolete": true (check blazemod modinfo.json) and remove the now-obsolete morale penalty on game load (I think there is a function to remove morale of particular type).

Instead of obsoleting the morale mod, you could instead change it to the new one and keep the old ID, though that would be a bit confusing.

const int required_water = 2 * mod.volume() / 250_ml;
const inventory &crafting_inv = p->crafting_inventory();
if( !crafting_inv.has_charges( "water", required_water ) && !crafting_inv.has_charges( "water_clean", required_water ) ) {
p->add_msg_if_player( _( "You need %1$i charges of water to wash your %2$s." ), required_water, mod.tname().c_str() );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly misleading? Above checks for both X water and X water_clean, whereas this line only mentions the former.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume that players will understand that they can use either ordinary or clean water in this simple "... of water". But I can change this to explicitly mention both types of water, if needed.

Copy link
Contributor

@keyspace keyspace Jan 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I meant is - yes, the above checks for either, but several lines below, both are pushed to comps. EDIT: So, the checks and message are for one thing, but the components used are another. Meh, nevermind.

@@ -4823,6 +4823,17 @@ dealt_damage_instance player::deal_damage(Creature* source, body_part bp, const
}
}

int infection_chance = dealt_dams.type_damage( DT_BASH ) + ( dealt_dams.type_damage( DT_CUT ) + dealt_dams.type_damage( DT_STAB ) ) * 4;
Copy link
Contributor

@keyspace keyspace Jan 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be const int infection_chance. Same for filthy below.

@Barhandar
Copy link
Contributor

Rags will be filthy too when it will implemented.

Only if they then can be bulk-washed.

Also that will require making thread (made from these rags) filthy too, and the clothes made from them...

How about requiring time (required), water, soap and washboard (all three not required but reducing amount of time spent) for filthy clothes cut-up instead?

@kevingranade
Copy link
Member

kevingranade commented Jan 29, 2017 via email

@BorkBorkGoesTheCode
Copy link
Contributor

@DangerNoodle Sorry, I didn't see your post.

@DangerNoodle
Copy link
Contributor

The morale issue isn't, "filthy clothes shouldn't cause a morale penalty", it's, "intermittent morale impacting actions aren't as persistent as they should be".

My assumption was that morale penalties are not a significant reason to justify filthy clothing. This is another instance where I agree with points that @chaosvolt has brought up in the past, mainly that it does not contribute enough to balancing to actually deter players from using clothing scavenged from enemies.

@DangerNoodle Sorry, I didn't see your post.

No worries.

@kevingranade
Copy link
Member

kevingranade commented Jan 30, 2017 via email

@Night-Pryanik
Copy link
Contributor Author

Test with silent movement and no smell debug traits. It may rely on scent on sound, which would make it really strong for the player. Also test vs. NPCs - that's pretty important because if it's smell+sound, NPCs will be able to freely wreck hulks.

Tested with debug traits. "Semi-ignore" turns into full ignore with no smell trait. Sound is irrelevant here, because player can stand still.
Tested with NPCs. They seem to like filthy items. In my tests they got one filthy item (usually t-shirt if present) and started to ignore zombies much like as zombies ignore them - on short distances they fight, on long distances they have no interest in each other.

@kevingranade
Copy link
Member

kevingranade commented Jan 30, 2017 via email

@Night-Pryanik
Copy link
Contributor Author

Ok, I'll do it.

@Night-Pryanik
Copy link
Contributor Author

I have serious doubts that the cleanliness of your clothes would matter if you get injured by an attack from a rotting corpse. Like the cleanliness of your spoon would matter when eating rotten soup...

This affect attacks not only from zombies, but also from other non-zombie-monsters, NPCs and maybe even from other sources of damage, such as explosions (needs further testing to confirm this, though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants