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): HEAVY_WEAPON_SUPPORT flag for large mutation and power armors #3691

Merged
merged 10 commits into from
Nov 21, 2023

Conversation

chaosvolt
Copy link
Member

@chaosvolt chaosvolt commented Nov 16, 2023

Purpose of change

This was a side idea floated during discussion of #1496 that I decided to set aside for another time, since Coolthulhu mentioned in the BN discord if I recall that he wasn't 100% sure about giving this benefit to power armor or not. I figure it's worth making the case that, given it does take a fair bit of effort to get power armor up and running, combined with the idea that it fits thematically (the classic Fallout imagery of a power armored soldier hefting a minigun), it might be reasonable to enable this for active power armor.

In short, implements an item flag that enables access to the ability to use heavy weapons without supporting terrain, and applies it to some appropriate items.

Describe the solution

C++ changes:

  1. Added HEAVY_WEAPON_SUPPORT flag to flag.cpp and flag.h.
  2. In ranged.cpp, set ranged::gunmode_checks_weapon so that wearing an item with the HEAVY_WEAPON_SUPPORT flag enables you to fire heavy weapons without needing mountable terrain.
  3. Updated the if/else logic for recoil and dispersion penalties of hip-firing heavy weapons. Per discussion with Coolthulhu, harshest penalty now kicks in if you only have power armor to rely on, while being Large now gets the reduced penalty, and Huge negates the penalty entirely.
  4. Also per said feedback, dispersion penalty changed from a multiplier to a flat +1000 or +500.
  5. Per findings while testing, reworked it so that can_use_bipod is able to check if the shooter is riding a mech that allows them to fire from it (i.e. unarmed mechs like the lifter mech), fixing mech cockpits not counting as a stable firing platform and allowing the extra checks in ranged::gunmode_checks_weapon to be replaced with a check for can_use_bipod.

JSON changes:

  1. Added HEAVY_WEAPON_SUPPORT to flags.json, and updated description of MOUNTED_GUN flag to hopefully convey all this with a bit less length.
  2. Added HEAVY_WEAPON_SUPPORT flag to active light, medium, and heavy power armor.
  3. Added HEAVY_WEAPON_SUPPORT flag to active EM vest in C.R.I.T. mod.
  4. MISC: Typo fix in description of inactive EM vest.

Doc changes:

  1. Added documentation for new flag, updated MOUNTED_GUN flag.

Describe alternatives you've considered

  1. Setting it so only medium or heavy power armor only has the fire support feature.
  2. Creating a smartgun harness style power armor accessory so that using this feature with power armor requires additional setup.
  3. Making it so only mod sources of the feature can provide this.

Testing

  1. Checked affected JSON files for syntax and lint errors.
  2. Compiled and load-tested.
  3. Hefted a M2 browning.
  4. Confirmed that it still won't let me fire it unsupported by default.
  5. Confirmed I can correctly fire it while standing on a mound of dirt, open window, a bench, and in a vehicle.
  6. Made myself Large, confirmed I can now fire the M2 unsupported.
  7. Unlarge'd myself and put together power armor, confirmed I gain ability to fire it unsupported when it's turned on.
  8. Confirmed that making myself Large AND wearing active power armor also still works fine for firing unsupported.
  9. Temporarily set power armor to be oversize, tested that I can indeed shoot unsupported while Huge with active power amror too.
  10. Checked affected C++ files for astlye.
  11. . Temporarily added info messages when being hit with aim penalties, confirming that worst penalty kicks in if using active power armor while normal size, lower penalty applies if Large regardless of power armor use, and being Huge triggers no penalty.

image

Additional context

I also looked into trying to solve #3644 while I was at it but it's a bit more complex than I was hoping it'd be so bleh.

@github-actions github-actions bot added docs PRs releated to docs page src changes related to source code. JSON related to game datas in JSON format. mods PR changes related to mods. labels Nov 16, 2023
@chaosvolt chaosvolt requested a review from Coolthulhu November 16, 2023 10:01
@KheirFerrum
Copy link
Collaborator

If I recall Coolthulhu's argument against was that this makes Huge mutation and mutations that prevent you from wearing PA even more undesirable as they offer little to no unique advantages that make the mutation line worth it.

@chaosvolt
Copy link
Member Author

If I recall Coolthulhu's argument against was that this makes Huge mutation and mutations that prevent you from wearing PA even more undesirable as they offer little to no unique advantages that make the mutation line worth it.

Fair, it ends up making both options overlap a bit. The bonuses do combine, so if there was a form of power armor that was compatible with Huge characters, then the best bonus would entail combining Huge with active power armor, encouraging you to stack up both.

An alternative would be to make it so active power armor only ever equals the effects of having Large, with Huge still outclassing either option and Large+PA not combining their effects. This would make power armor compete with Large mutation but still be worth upgrading into Huge, which might be more reasonable since that's the point where you can no longer wear power armor.

You are huge! That means you have huge guts!
@chaosvolt
Copy link
Member Author

Went with the "Huge is an upgrade over power armor" option for now.

@chaosvolt
Copy link
Member Author

So, I added some info messages temporarily to test if using a lifter mech to support a heavy weapon triggers the penalty and:
image

So I'm gonna add a check for riding a mech to can_use_bipod then we can condense some of the checks in gunmode_checks_weapon to use that function instead.

chaosvolt added a commit to chaosvolt/cdda-tankmod-revived-mod that referenced this pull request Nov 16, 2023
Per feedback this permits treating the 25mm Bushmaster and makeshift version like heavy weapon such as the M2 or Mk. 19, allowing you to reload it and just use it on foot without exploiting code jank.

Will also pair well with cataclysmbnteam/Cataclysm-BN#3691 for power armor lovers in BN version but not dependant on it.
chaosvolt and others added 2 commits November 16, 2023 16:50
1. Renamed flag per Coolthulhu's suggestion.
2. Also removed some test messages I left in by mistake.
src/ranged.cpp Outdated Show resolved Hide resolved
@@ -1573,7 +1573,7 @@
"id": "MOUNTED_GUN",
"type": "json_flag",
"context": [ ],
"info": "This weapon is <bad>too unwieldy</bad> to fire on its own and <info>must be mounted</info> on a vehicle or furniture (window, table, mound of dirt, etc.) before use, <info>Large or Huge</info> mutants can fire from the hip with <bad>reduced accuracy.</bad>"
"info": "This weapon <info>must be mounted</info> on a vehicle or furniture (window, table, mound of dirt, etc.) to fire, <info>Large or Huge</info> mutants or those with active <info>Power Armor</info> can fire from the hip with <bad>reduced accuracy.</bad>"
Copy link
Member

@Coolthulhu Coolthulhu Nov 16, 2023

Choose a reason for hiding this comment

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

The "must be mounted" should be rephrased as <bad>.
Maybe something like "this weapon <bad>can only be fired if mounted</bad> [insert text]. Sufficiently <info>hueg</info> or PA'd shooters can <info>fire from hip</info> <bad>at reduced accuracy</bad>.

The idea is that the player should see at a first glance why is it bad: most of the time it's bad because you need to mount it, but in some cases, it's bad because you can only fire it at reduced accuracy or when mounted.

"id": "HEAVY_WEAPON_SUPPORT",
"type": "json_flag",
"context": [ ],
"info": "This equipment allows you to fire unwieldy weapons without requiring support from mountable terrain, as a <info>Large or Huge</info> mutant could, at the expense of <bad>reduced accuracy.</bad>"
Copy link
Member

@Coolthulhu Coolthulhu Nov 16, 2023

Choose a reason for hiding this comment

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

A <good> would be helpful. Negating the <bad> from mountable weapons is worth a greentext.

@Coolthulhu
Copy link
Member

As for balancing: I'd buff the effect from HUGE. It wrecks slots on everything.
I don't think that giving it ability to always count as mounted would unbalance it.

At the same time, LARGE doesn't need a big buff. You can even wear PA with it. And PA doesn't need a buff either.
I'd still allow the feature, for the flavor, but we should sneak in a nerf for PA soon after. Ideally, making PA provide percentage armor and less flat armor, so that it doesn't make you indestructible, but still provides good resistance vs hard hits.

Penalizing dispersion doesn't sound like "the right thing". Miss rolls have a cap, but there's always the stray bullet hit chance, so there's a lowcap of hit chance that depends only on distance.
Ideally, being just LARGE would let you hipfire single shots, but not let you burst fire without mounting. This way you'd be limited to anti-materiel rifles rather than miniguns, so the accuracy penalty would matter much more.
The current solution is still acceptable, but if it's not a huge load of work, it would be good if you at least tried to implement it.

I'm considering flat penalty to dispersion. It would mostly affect sniping at very low dispersion where the multiplier no longer does its job. Not sure if it's needed, though.

@chaosvolt
Copy link
Member Author

As for balancing: I'd buff the effect from HUGE. It wrecks slots on everything. I don't think that giving it ability to always count as mounted would unbalance it.

At the same time, LARGE doesn't need a big buff. You can even wear PA with it. And PA doesn't need a buff either. I'd still allow the feature, for the flavor, but we should sneak in a nerf for PA soon after. Ideally, making PA provide percentage armor and less flat armor, so that it doesn't make you indestructible, but still provides good resistance vs hard hits.

Penalizing dispersion doesn't sound like "the right thing". Miss rolls have a cap, but there's always the stray bullet hit chance, so there's a lowcap of hit chance that depends only on distance. Ideally, being just LARGE would let you hipfire single shots, but not let you burst fire without mounting. This way you'd be limited to anti-materiel rifles rather than miniguns, so the accuracy penalty would matter much more. The current solution is still acceptable, but if it's not a huge load of work, it would be good if you at least tried to implement it.

I'm considering flat penalty to dispersion. It would mostly affect sniping at very low dispersion where the multiplier no longer does its job. Not sure if it's needed, though.

  1. Having Huge count as functionally identical to bracing on appropriate terrain or a mech cockpit seems reasonable, sure.
  2. Likewise, converting the dispersion penalty for Large/PA from a multiplier to a flat penalty seems acceptable too. Any suggestions for number? 500, 1000, ???
  3. Negating the ability to fire automatic weapons wouldn't work super well. Currently just about every vanilla weapon to have the MOUNTED_GUN flag is a machinegun of some sort, while anti-material rifles can all be fired from the shoulder just fine (relying more on bipod as opt-in for better aim). Additionally, the recoil penalty matters more for burst-fire weapons if I recall, and especially turns hefting a minigun into a spray and pray experience (that is nonetheless entertaining and flavorful despite its ammo inefficiency, in my testing experience).
  4. I could even rig it so that the current penalties are shifted such that Large characters get the 2x-tier penalty Huge currently uses, and make "Medium or smaller in active power armor" use the penalty that both currently use. This would make it so Large characters automatically get a passive upgrade to their ability to hip-fire heavy weapons with or without power armor, giving them less reason to care about PA in general, and makes human purists in power armor not on par with Large mutants. Would combo with the above suggestion to allow Huge characters to just go all-out with heavy weapons for free, as that'd be a pretty good offensive tradeoff for losing access to power armor.

Converting power armor to rely on percentage damage reduction would be neat, and possibly a buff that could be shifted to its active state (which can be justified by using flavor from the RM13 that also gains an armor boost when active) in exchange for cutting the base material thickness by however much we feel like. That could be good for a follow-up PR. Easily doable using relic data stuff, though one drawback is I have zero idea how to communicate it to the player since it won't show up on the armor screen.

src/ranged.cpp Outdated Show resolved Hide resolved
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

changes look OK, logic could be structured better but the original code were very hard to edit in first place. however, it'd be great to rename the function for future contributors.

@KheirFerrum
Copy link
Collaborator

KheirFerrum commented Nov 19, 2023

As for balancing: I'd buff the effect from HUGE. It wrecks slots on everything. I don't think that giving it ability to always count as mounted would unbalance it.

At the same time, LARGE doesn't need a big buff. You can even wear PA with it. And PA doesn't need a buff either. I'd still allow the feature, for the flavor, but we should sneak in a nerf for PA soon after. Ideally, making PA provide percentage armor and less flat armor, so that it doesn't make you indestructible, but still provides good resistance vs hard hits.

Penalizing dispersion doesn't sound like "the right thing". Miss rolls have a cap, but there's always the stray bullet hit chance, so there's a lowcap of hit chance that depends only on distance. Ideally, being just LARGE would let you hipfire single shots, but not let you burst fire without mounting. This way you'd be limited to anti-materiel rifles rather than miniguns, so the accuracy penalty would matter much more. The current solution is still acceptable, but if it's not a huge load of work, it would be good if you at least tried to implement it.

I'm considering flat penalty to dispersion. It would mostly affect sniping at very low dispersion where the multiplier no longer does its job. Not sure if it's needed, though.

Yeah, been wanting to look at PA, I think the high encumbrance versions making you more or less invincible to most enemies is fine, but light and normal shouldn't stack up so high against rifles and small arms to negate them.

I feel like there's an issue with encumbrance not really mattering if you can block all the damage, but it feels like we'd need to redesign the combat to deal with that. (inb4 suffocation)

@chaosvolt chaosvolt requested a review from scarf005 November 19, 2023 01:22
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

huge.mp4
large.mp4
large-pa.mp4
just-pa.mp4

LGTM

@scarf005 scarf005 changed the title feat(balance): Active power armor supports heavy weapons feat(balance): HEAVY_WEAPON_SUPPORT flag for large mutation and power armors Nov 21, 2023
@scarf005 scarf005 added this pull request to the merge queue Nov 21, 2023
Merged via the queue into cataclysmbnteam:upload with commit 70662ff Nov 21, 2023
14 of 15 checks passed
@chaosvolt chaosvolt deleted the BoS-memes branch November 21, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs PRs releated to docs page 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