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

feat(balance): Bionic zombies generate CBMs less often, harvesting of what generates made more reliable #3719

Merged
merged 5 commits into from
Nov 23, 2023

Conversation

chaosvolt
Copy link
Member

Purpose of change

Finally decided to make a move on an item in my todo list. Idea here is to make harvesting of generated CBMs and other dissection items more reliable, and change the impact of tool quality to a more consistent bonus instead of being applied at random.

In exchange the variety of potential spawns will change so that a comparable amount of what generates is made of potentially useful non-bionic scrap, and in some cases generate nothing at all.

This in turn makes bionic scanners more useful since there's less certainty that a bionic zed will drop a CBM (but it can have stuff you might still want that the scanner could overlook) but make it less finicky to extract the CBM.

Describe the solution

C++ changes:

  1. In activity_handlers.cpp, changed activity_handlers::butcher_finishso that the calculation ofroll_quality` takes most of the randomness out of it, only randomizing the dexterity check. To compensate for how this would affect non-dissection butchery, the effect of survival skill is now halved. Likewise, the skill effects in the case of dissection have been halved further to make tool quality more important in comparison.
  2. Also in activity_handlers.cpp, reworked the math for check_butcher_cbm to instead use "roll in 10" to determine chance of success, making the match easier to determine, and adjusting things so that minimum potential chance is 10% as before. This means the chances start as bad as they were before, but the effect of skills and tools is applied consistently, making it possible to get a 100% success chance with enough skills, tools, or good RNG on the dex roll.
  3. Changed the "damaged some organs" messages for destroying non-bionic yields to be less specific, since there's a good chance that what you're harvesting would not reasonably be considered an organ.

JSON changes:

  1. Moved the faulty bionic spawns out of bionic_salvage_junk and directly into cyborg_harvest, defined itemgroup bionics_broken_cyborg specifically for the CBMs so mods can add to that pool without affecting the other results, and added a chance of a null result.
  2. Added a few more potential items to bionic_salvage_junk.
  3. Defined bionic_salvage_junk_mil itemgroup for use by military bionic harvest entries, which pairs the contents of bionic_salvage_junk with some additional potential loot, including a bit higher occurrence of alloy sheets.
  4. Defined harvest_power_storage and harvest_power_storage_mil itemgroups, so that mods injecting items into the power storage CBM itemgroups won't affect the weight of CBMs vs. junk vs. nothing.
  5. Replaced direct usage of bionic_power_storage_civ and bionic_power_storage_mil in harvest entries with the related variable harvest itemgroups.
  6. Likewise defined harvest_bionics_zapper, harvest_bionics_common, harvest_bionics_sci, harvest_bionics_tech, harvest_bionics_subs, harvest_bionics_op, harvest_bionics_op2_off, harvest_bionics_op2_def, and harvest_bionics_op2_utl for existing bionic harvests. These lean towards 50/25/25% split of CBMs/components/nothing for the more elite itemgroups, and an even 1-in-3 chance for lesser harvest itemgroups.
  7. MISC: Fixed feral scientists applying old flags to their bionics when harvested.
  8. Removed the overrides to vanilla harvest entries from Aftershock for the time being, replacing it with a decent-sized injection of the titanium implant item into the bionic_salvage_junk itemgroup. I plan to follow up on this PR with an expansion of vanilla harvests anyway so basic zeds will eventually regain a small chance of having an implant, but it definitely should not be a 100% chance of pre-generating on every zed.
  9. Updated bionic doggo harvest entry in Aftershock accordingly as well.
  10. Updated Dinomod harvest entries accordingly, together with related doc file.

Describe alternatives you've considered

  1. Keeping the jank RNG and building the minimum failure chance with it in mind.
  2. Converting all uses of roll_butchery and such to deal in floats instead of ints, this would fix some rounding troubles pertaining to how the skill bonuses are applied.

Testing

  1. Checked affected JSON files for syntax and lint errors.
  2. Compiled and load tested.
  3. Spawned in and debug-killed a couple shocker zombies.
  4. Turned debug mode on and came after them with no skills and 1 fine cutting, success chance listed is 10%.
  5. Debugged in max skills and a scalpel, chance is now 100%.
  6. Temporarily set it to only ever give null when butchering shockers, confirmed that no message prints if it spits out null.
  7. Checked affected C++ file for astyle.

Additional context

Checklist

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. mods PR changes related to mods. labels Nov 19, 2023
@Admiral-Daala1541
Copy link

Ehhhhh

Still not sure how I feel about this.

On the one hand, i actually get to see what all those failed dice rolls could have gotten me. On the other hand, Im nervous about what the new generation odds are.

@RoyalFox2140
Copy link
Collaborator

Ehhhhh

Still not sure how I feel about this.

On the one hand, i actually get to see what all those failed dice rolls could have gotten me. On the other hand, Im nervous about what the new generation odds are.

We discussed it on the discord, I pushed for 100% odds at 10 first aid, 10 electronics, 3 fine cutting, and an active bionic scanner, and less and less as you get worse. I think having 5 and 5 with 3 cutting is a 60% chance now.

@Admiral-Daala1541
Copy link

Ehhhhh
Still not sure how I feel about this.
On the one hand, i actually get to see what all those failed dice rolls could have gotten me. On the other hand, Im nervous about what the new generation odds are.

We discussed it on the discord, I pushed for 100% odds at 10 first aid, 10 electronics, 3 fine cutting, and an active bionic scanner, and less and less as you get worse. I think having 5 and 5 with 3 cutting is a 60% chance now.

I mean for whats actually in the body.

As for components, is it just gonna be mainlining aftershock's stuff?

@RoyalFox2140
Copy link
Collaborator

As for components, is it just gonna be mainlining aftershock's stuff?

Likely throwing out Aftershocks components. They don't fit the game basically, there was a discussion about it.

@chaosvolt
Copy link
Member Author

As for components, is it just gonna be mainlining aftershock's stuff?

Right now it's using a broad selection of various vanilla components. And currently you can hit 100% at about...if my math is right, 3 fine cutting, 10 first aid, and 5 or so electronics (plus or minus mixing and matching). Active bionic scanner could be added to grant a bonus but I assume it should only add a bonus if the item being targeted is a CBM.

Also note that while the chance of a CBM generating is going down, I plan to follow up on this by making other types of zeds potentially spawn with CBMs too. Already I'm thinking about 10% chance of bionics on standard military zeds, and probably a 1% chance on standard civilian zeds. Or possibly even lower, "standard civilian zeds" is basically all of them except for the bionic ones, so you'd be getting a lot of dice rolls added back in there.

@scarf005 scarf005 self-assigned this Nov 22, 2023
@scarf005 scarf005 added this pull request to the merge queue Nov 23, 2023
Merged via the queue into cataclysmbnteam:upload with commit 428d071 Nov 23, 2023
13 of 15 checks passed
@chaosvolt chaosvolt deleted the bionics-gonyoom branch November 23, 2023 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format. mods PR changes related to mods. src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants