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

Butchering proficiencies #76156

Merged
merged 15 commits into from
Sep 5, 2024
Merged

Conversation

GuardianDll
Copy link
Member

@GuardianDll GuardianDll commented Sep 2, 2024

Summary

Features "Butchering now require proficiency to do it fast and effectively"

Purpose of change

Close #54392

Describe the solution

Add four proficiencies:

  • Basic butchery (drastically reduces flesh obtained from butchering and speed of butchering),
  • Advanced butchery (same as basic, but has only little effect),
  • Basic and Advanced skinning (same as butchery)

Lack of butchery_basic applies little (10-15%) penalty to amount of meat, but huge (~2x) penalty to speed
Having butchery_basic still has some less than moderate speed penalty
Having butchery_adv removes this penalty

Lack of skinning_basic applies little penalty to speed, but massive penalty to skin dropped
Having skinning_basic applies less than moderate penalty to skin dropped
Having skinning_adv removes this penalty

Testing

TBD, trying to solve error in loops, that causes crazy things like @screenshot
UPD: current numbers are like this:

  • for meat output (quick butchering cow with butcher knife):

    • unmodified game: 60 kg of meat
    • character with no proficiency: 53 kg of meat
    • character with basic proficiencies: 60 kg of meat
    • character with adv proficiency: 60 kg
  • for time spend:

    • unmodified game:
      image
    • character with no proficiency:
      image
    • character with basic proficiencies (butchering, skinning):
      image
    • character with adv proficiencies:
      image

Additional context

I would like to add few more stuff, but it would not fit the game really - proper bleeding of the corpse, lack of bleeding causing it smell and taste bad are two what i thought about
Also maybe i should treat quick butchery more laxed than full butchery?

TODO in future prs: make butchery snippets, make event for butchery finish, make snippets for it also
maybe todo in future: bleeding or lack of it affect meat quality?

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) <Enhancement / Feature> New features, or enhancements on existing labels Sep 2, 2024
Copy link
Contributor

github-actions bot commented Sep 2, 2024

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • You know how to properly remove offals from the body.

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

Hints for adding a new word to the dictionary
  • If the word is normally in all lowercase, such as the noun word or the verb does, add it in its lower-case form; if the word is a proper noun, such as the surname George, add it in its initial-caps form; if the word is an acronym or has special letter case, such as the acronym CDDA or the unit mW, add it by preserving the case of all the letters. A word in the dictionary will also match its initial-caps form (if the word is in all lowercase) and all-uppercase form, so a word should be added to the dictionary in its normal letter case even if used in a different letter case in a sentence.
  • For a word to be added to the dictionary, it should either be a real, properly-spelled modern American English word, a foreign loan word (including romanized foreign names), or a foreign or made-up word that is used consistently and commonly enough in the game. Intentional misspelling (including eye dialect) of a word should not be added unless it has become a common terminology in the game, because while someone may have a legitimate use for it, another person may spell it that way accidentally.

@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Sep 2, 2024
@NetSysFire
Copy link
Member

Dont forget to add the butchering proficiency to some of the backgrounds/hobbies.

@GuardianDll GuardianDll force-pushed the butchery_prof branch 2 times, most recently from b6d2c94 to 85d7c23 Compare September 2, 2024 21:44
@GuardianDll GuardianDll marked this pull request as ready for review September 2, 2024 21:53
@github-actions github-actions bot added the Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies label Sep 2, 2024
Copy link
Contributor

@TheShadowFerret TheShadowFerret left a comment

Choose a reason for hiding this comment

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

I think the X hunters should get either basic skinning or basic butchering, all of them do carry hunting knives.

data/json/proficiencies/butchering.json Outdated Show resolved Hide resolved
data/json/proficiencies/butchering.json Outdated Show resolved Hide resolved
Co-authored-by: TheShadowFerret <[email protected]>
@github-actions github-actions bot removed the json-styled JSON lint passed, label assigned by github actions label Sep 2, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Sep 2, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 3, 2024
@harakka
Copy link
Member

harakka commented Sep 3, 2024

I'm not sure if evisceration distinct from butchery really makes sense. These things kinda go hand in hand in practice.

@GuardianDll
Copy link
Member Author

GuardianDll commented Sep 3, 2024

sound reasonable, gotta throw it away same as bleeding prof
upd: hmm, it will mess up leaning stuff a bit

@Night-Pryanik
Copy link
Contributor

I don't like the idea of corpse's meat magically disappearing into nowhere if you're not so skilled in butchering. Maybe the remaining meat from the corpse should be converted to meat scraps?

@GuardianDll
Copy link
Member Author

it's not magically disappeared, it is transformed into butchery refuse

@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Sep 3, 2024
GuardianDll and others added 2 commits September 3, 2024 11:25
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@GuardianDll
Copy link
Member Author

I see what you mean now, I'll tweak it tomorrow to apply speed penalty relatively to the type of butchery (and how long skinning/butchering step lasts in it)

@GuardianDll GuardianDll marked this pull request as draft September 3, 2024 21:53
@RedMisao
Copy link
Contributor

RedMisao commented Sep 3, 2024

I think the mass penalties are too harsh, considering there's also time penalties. I do think the latter should be the primary component over the former, given that unless you somehow destroy or discard otherwise usable flesh, it can still be handled by meat scraps.

Speaking from experience butchering small animals (chicken, fish, rabbit), there's only two possibilities:

  1. You either do it efficiently and obtain the maximum possible amount of meat (optimal amount), or
  2. You do it inneficiently by wasting time while getting less than the optimal amount, which is usually stick to the bones or to the skin by cutting it improperly.

There is no way you lose ~40% (25 kg) of the maximum amount of meat (60 kg) by spending twice the total time handling the carcass. That means there's almost half still stuck to the bones or the skin, which is not just useless but also can't be scrapped away. One thing is to hack so bad you mix the cuts (i.e. drumstick with a chunk of the thighs), another is to make it 100% useless for consumption.

@IdleSol
Copy link
Contributor

IdleSol commented Sep 3, 2024

For example, you could damage the intestines (guts?). And its contents will spill out onto the meat. I think that's a typical rookie mistake. Is this meat considered spoiled? Does it meet the 50% mark? I don't know.

Forgetting to drain the blood or not draining all the blood. Does this sort of count as spoiled meat? Would it be considered spoiled under cataclysmic conditions?

@GuardianDll
Copy link
Member Author

GuardianDll commented Sep 3, 2024

No, lack of drain is, at first, not emulated, and second, do not spoil the meat quality to the unusable level
Damaging digestive system, spilling organ content, ineffective cuts (tho this one is tricky, because we don't have "meat on a bone" thing, only them being separately) is what i considered the consequences of bad skill.
@RedMisao i should remind that we talk about quick butchery, not full one, it is lossy butchery type on its own
Despite i don't like it (because i already spend time making it), it is a strong argument to make butchery not affect amount of meat obtained, but affect only the speed of it

So, in short:
Lack of butchery_basic applies little (10-15%) penalty to amount of meat, but huge (same as now) penalty to speed
Having butchery_basic still has some less than moderate speed penalty
Having butchery_adv removes this penalty

Lack of skinning_basic applies little penalty to speed, but massive penalty to skin dropped
Having skinning_basic applies less than moderate penalty to skin dropped
Having skinning_adv removes this penalty

And the speed of butchery should be revisited in the future to match real life numbers, not 2 hours to butcher an entire cow

Sounds good for me

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 4, 2024
@GuardianDll GuardianDll marked this pull request as ready for review September 4, 2024 18:02
@IdleSol
Copy link
Contributor

IdleSol commented Sep 4, 2024

Is it possible that I'm misunderstanding? Is there a mistake?

 // 40% of butchering and gutting, 40% of skinning, 20% another activities
        time_to_cut *= 1 + ( penalty_small * ( 1 - butch_adv ) * 0.4 );
        time_to_cut *= 1 + ( penalty_big * ( 1 - butch_basic ) * 0.4 );
        time_to_cut *= 1 + ( penalty_small * ( 1 - skin_basic ) * 0.4 );

This turns into a sequential multiplication of penalties, doesn't it? I.e. again we take the total cutting time and multiply it by three penalties. Instead of taking a part of the total time and penalizing only that part (with the appropriate penalty).

Or have you decided not to do that?

And there's a strange way the 40% factor is taken into account. We don't take 40% of the time, we take 40% of the penalty.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 4, 2024
@GuardianDll
Copy link
Member Author

that's on me
would this one work now?

@HadeanLake
Copy link
Contributor

HadeanLake commented Sep 4, 2024

pr body (before edits) was showing that full butchering takes twice as much time with 0 prof
penalties to achieve that with new formula are:
penalty_small = 0.5;
penalty_big = 1.5;

@IdleSol
Copy link
Contributor

IdleSol commented Sep 4, 2024

@GuardianDll

If I have not made a mistake in my calculations, then everything is correct. Although such a record, in my opinion, is difficult to understand.

@GuardianDll
Copy link
Member Author

what record?

@IdleSol
Copy link
Contributor

IdleSol commented Sep 4, 2024

Prof 0.25/0.75 0.5/1.5
none x 1.5 x 2.0
b_butch x 1.4 x 1.8
b_skin x 1.4 x 1.8
b_butch & b_skin x 1.3 x 1.6
b_butch & a_butch x 1.1 x 1.2
b_butch & a_butch & b_skin x 1.0 x 1.0

what record?

The way you wrote the formula to calculate it.

@IdleSol
Copy link
Contributor

IdleSol commented Sep 4, 2024

    double butch_basic = you.get_proficiency_practice( proficiency_prof_butchering_basic );
    double butch_adv = you.get_proficiency_practice( proficiency_prof_butchering_adv );
    double skin_basic = you.get_proficiency_practice( proficiency_prof_skinning_basic );
    double penalty_small = 0.25;
    double penalty_big = 0.75;
--    int prof_penalty = 0; 
++  int prof_butch_penalty = penalty_big * ( 1 - butch_basic ) + penalty_small * ( 1 - butch_adv );
++  int prof_skin_penalty = penalty_small * ( 1 - skin_basic );

    if( action == butcher_type::FULL ) {
        // 40% of butchering and gutting, 40% of skinning, 20% another activities
--        prof_penalty += ( time_to_cut * 0.4 ) * penalty_small * ( 1 - butch_adv );
--        prof_penalty += ( time_to_cut * 0.4 ) * penalty_big * ( 1 - butch_basic );
--        prof_penalty += ( time_to_cut * 0.4 ) * penalty_small * ( 1 - skin_basic );

--        time_to_cut += prof_penalty;

++      time_to_cut *= 0.4 * ( 1 + prof_butch_penalty ) + 0.4 * ( 1 + prof_skin_penalty ) + 0.2;
    }

    if( action == butcher_type::QUICK ) {
        // 70% of butchery, 15% skinning, 15% another activities
--        prof_penalty += ( time_to_cut * 0.7 ) * penalty_small * ( 1 - butch_adv );
--        prof_penalty += ( time_to_cut * 0.7 ) * penalty_big * ( 1 - butch_basic );
--        prof_penalty += ( time_to_cut * 0.15 ) * penalty_small * ( 1 - skin_basic );

--        time_to_cut += prof_penalty;

++      time_to_cut *= 0.7 * ( 1 + prof_butch_penalty ) + 0.15 * ( 1 + prof_skin_penalty ) + 0.15;
    }

    if( action == butcher_type::FIELD_DRESS ) {
--        prof_penalty += time_to_cut * penalty_small * ( 1 - butch_adv );
--        prof_penalty += time_to_cut * penalty_big * ( 1 - butch_basic );

--        time_to_cut += prof_penalty;

++      time_to_cut *=  1 + prof_butch_penalty
    }

    if( action == butcher_type::SKIN ) {
--        prof_penalty += time_to_cut  * penalty_small * ( 1 - skin_basic );

--        time_to_cut += prof_penalty;
++      time_to_cut *=  1 + prof_skin_penalty
    }

@IdleSol
Copy link
Contributor

IdleSol commented Sep 4, 2024

By the way, what if we do this:

double knife_skills = you.get_proficiency_practice( proficiency_prof_knife_skills );
double penalty_big = 1.25 + 0.25 * (1 - knife_skills);

"id": "prof_knife_skills",

@GuardianDll
Copy link
Member Author

i like it, but i suspect having no knife skill above of not knowing how to butcher need to penalize thing even more (but also train knife skill)

penalty_big = 1.5 + 0.5 * (1 - knife_skills)

?

@GuardianDll
Copy link
Member Author

GuardianDll commented Sep 4, 2024

oh, wrong, proficiency specifically says about chopping, not at carving meat from the bones and skin from the meat, so it doesn't fit here

@IdleSol
Copy link
Contributor

IdleSol commented Sep 4, 2024

Why not? Although I thought the 1.5 factor already incorporated poor knife handling.

oh, wrong, proficiency specifically says about chopping, not at carving meat from the bones and skin from the meat, so it doesn't fit here

We have a strange way of butchering bodies in our game. For some reason we immediately separate meat from bones and cut it into equal pieces. From this point of view, this skill could work.

Alternative:

"id": "prof_knives_familiar",
"category": "prof_combat",
"name": { "str": "Knife Familiarity" },
"description": "You've got a handling on gripping knives so they don't slip out of your hand.",

"id": "prof_knives_pro",
"category": "prof_combat",
"name": { "str": "Knife Proficiency" },
"description": "You handle your knife like a butcher, and are ready to prove it.",

"id": "prof_knives_master",
"category": "prof_combat",
"name": { "str": "Knife Mastery" },
"description": "Your knife is like an extension of yourself, you wield it effortlessly.",

But I don't like it. Combat professions are best left for combat.

src/activity_handlers.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 5, 2024
@Maleclypse Maleclypse merged commit ab971ba into CleverRaven:master Sep 5, 2024
23 of 27 checks passed
@GuardianDll GuardianDll deleted the butchery_prof branch September 5, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new "butchery" proficiency
10 participants