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

BUG: Effective duplicate application of player multipliers in Bladeburner's Training and Field Analysis #1607

Open
cmfrydos opened this issue Aug 19, 2024 · 10 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@cmfrydos
Copy link
Contributor

Bug Description

Completing Training in Bitburner results in excessively high effective stat gains compared to the console and what appears to be intended in the code.

Issue Details

The problem seems to originate from the following lines:

Those multipliers are then applied again in successive functions:

I believe that the double application of multipliers is not intended. My proposed solution is to remove the multiplier application on the Bladeburner.completeAction function's return value (retValue), but then apply it to the console output to accurately reflect the effective stats in the terminal message.

Additional Information

  • I am working on a Pull Request to address this issue.
  • This bug likely arose during recent Bladeburner refactorings, which should be verified.
  • The Terminal Calculation also does not include the Augmented Max Stamina Multiplier, which is another bug on its own (#todo).

Note: Removing this bug significantly alters Bladeburner late-game balance. For example, a 300% Combat Stat Multiplier is currently applied twice (900%), so a bug fix would reduce net gains by 66% in this scenario.

Steps to Reproduce

  1. Have some Combat Skill Multipliers on the player or some skill points in Cyber's Edge.
  2. Complete the General > Training Bladeburner action.
  3. Observe the increase in Max Stamina in the Bladeburner Status Window or Combat Skills in Stats.

Version

Screenshots

Note: The screenshots were taken on v2.62 but were checked again in v2.6.3dev, resulting in the same outcomes:

  1. Notice the Maximum Stamina Stat increase of 0.048 from 421.502 to 421.550, whereas the console reports an increase of 0.044. This was observed with 5x Cyber's Edge, resulting in a Player Skill multiplier of 1.1.

    output2

    • Terminal Calculation: 0.040 * 1.1 ≈ 0.044
    • Effective Calculation: 0.040 * 1.1 * 1.1 * 1 (Aug. Max Stamina) ≈ 0.048.4
  2. Notice the Maximum Stamina Stat increase of 0.058 from 508.190 to 508.248, whereas the console reports an increase of 0.048. This was observed with 10x Cyber's Edge, resulting in a Player Skill multiplier of 1.2.

    output

    • Terminal Calculation: 0.040 * 1.2 ≈ 0.048
    • Effective Calculation: 0.040 * 1.2 * 1.2 * 1 (Aug. Max Stamina) ≈ 0.0576
  3. ToDO: Add Combat Stat Increase Screenshot

Save File in BN7 Bladeburner Training

bitburnerSave_1724100804_BN7x1.json.gz

@catloversg
Copy link
Contributor

Your proposed solution is a balance change. You should be careful when doing that. The "double application" of stat multipliers might be an oversight when we designed Bladeburner, but it's a part of the balance of Bladeburner nowadays. These are things that we should consider:

  • Both Training and Field Analysis do that.
  • Many things in Bladeburner are time-gated, so Bladeburner has already been a "slow" winning route. If you want to nerf Training, you must provide a very good reason.
  • In terms of combat stats, Training is much worse than Gym until the player improves stat multipliers via augmentations. Without the "double application", Training is almost useless; max stamina gain will be the only reason to do it. It seems that you also want to "fix" the gain rate of max stamina. I don't think Training (combat stats gain and max stamina gain) is OP and needs to be nerfed.

It's fine to fix the wrong console log, but if you want to make a balance change, you should wait until the maintainers agree.

@cmfrydos
Copy link
Contributor Author

cmfrydos commented Aug 20, 2024

Good catch that Field Analysis is also affected!

Next, I'll verify whether this issue has existed for a longer time. If it has, we definitely need to discuss how to maintain the balance while untangling the spaghetti in the code / game mechanic.

@cmfrydos cmfrydos changed the title BUG: Effective duplicate application of player multipliers when Training in Bladeburner BUG: Effective duplicate application of player multipliers when Leveling in Bladeburner Aug 20, 2024
@cmfrydos cmfrydos changed the title BUG: Effective duplicate application of player multipliers when Leveling in Bladeburner BUG: Effective duplicate application of player multipliers in Bladeburner's Training and Field Analysis Aug 20, 2024
@cmfrydos
Copy link
Contributor Author

I believe it was introduced when Sleeves were added, but I need to run some tests in v2.1 first: 2613948

@cmfrydos
Copy link
Contributor Author

So, I can confirm, as I assumed, that 2613948 has the bug regarding player stat increases, but its parent does not (tested in-game). However, the double application of Cyber's Edge is broken in both versions, indicating this part of the issue originates even deeper. I'll continue to investigate, but I'm currently considering just doubling Cyber's Edge Base Effect (2% -> 4% max stamina increase). I agree that the current primary purpose of training is to increase max stamina, and it could use a buff rather than a nerf. However, this ticket is NOT about altering the intended balance. So let's so how long this bug has existed...

cmfrydos added a commit to cmfrydos/bitburner-src that referenced this issue Aug 21, 2024
@cmfrydos
Copy link
Contributor Author

The issue where the effect of CyberEdge on maximum stamina is applied twice has existed since Bladeburner was introduced:

staminaGain = 0.04 * this.skillMultipliers.stamina;

maxStamina *= this.skillMultipliers.stamina;

The effective max stamina gain from CybersEdge has therefore always been quadratic.

Below is a table showing the effective max stamina gain multiplier for the current quadratic 2% formula, as well as for a linear 4% and a linear 5% proposal.

CybersEdge Level Quadratic 2% Linear 4% Linear 5%
0 1 1 1
1 1.0404 1.04 1.05
10 1.44 1.4 1.5
25 2.25 2 2.25
50 4 3 3.5
100 9 5 6

With these data points in mind, I propose changing CybersEdge's effect to a linear 5%, which results in a slight buff < Level 25, an unchanged balance at Level 25, and a linear nerf for all levels > 25.

I just played BN6 and BN7, trying a few things, and for me it didn't feel rewarding leveling CybersEdge past Level 10 - 20 or so. Each level costs more than the previous, and all the other possible upgrades were more rewarding.

Note: Saying that the current max stamina formula is quadratic is technically not correct but a usable estimation. In fact, the effect of a past training session on the current max stamina is a product of the level of CybersEdge at the time the training occurred, times the current level of CybersEdge. So saying that the max Stamina is just quadratic in the current level of CybersEdge is slightly overestimating the actual effect.

cmfrydos added a commit to cmfrydos/bitburner-src that referenced this issue Aug 21, 2024
@gmcew gmcew added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 21, 2024
@gmcew
Copy link
Collaborator

gmcew commented Aug 21, 2024

To justify the tags, I'll echo Catloversg point - if this bug has existed since Bladeburner was first created this is a balance change now. The pathways are broadly:

  • "Fix" the double application as you've proposed here and the impact on BB progression scaling, however minor.
  • Change the documentation and logging in the console to more accurately reflect that this upgrade is applied twice, with no change to BB mechnically.

@d0sboots and/or @Snarling may have a strong opinion one way or the other on how to handle this.

@cmfrydos
Copy link
Contributor Author

cmfrydos commented Aug 21, 2024

if this bug has existed since Bladeburner was first created, ...

It has not. It wasn't present from 2018, when Bladeburner was initially introduced, until 2021, when Sleeves were added. This balance-changing bug was silently introduced with this commit: 2613948

I strongly suspect that this is not an intended mechanic, neither from this commit nor from the base game design of Bitburner, and is therefore a bug. EXP multipliers are meant to function as multipliers, not roots of multipliers, across all game mechanics.

Removing these bugs (XP and stamina) would not significantly alter the early to midgame of Bitburner (with not all bitnodes beaten), since at that stage you typically don't have multipliers high enough for it to matter. However, it might impact the super-late game of Bladeburner (NFG > 1k), as this would be the only instance where an action’s effects scale quadratically instead of linearly. We all know that O(n²) is much larger than O(n) for large n.

EDIT: Actually, we are dealing with at least three different bugs here, which originated at different times:

  • XP multipliers being applied twice (since Sleeves were introduced)
  • CyberEdge (Max Stamina) being applied twice (since Bladeburner’s introduction)
  • Log/in-game info not reflecting what’s actually happening (a result of the two issues above, and the Max Stamina Augmentation not being reflected in the log)

So, maybe splitting the issue into a few smaller ones could help? I believe the two (though minor) balance changes would need approval from the maintainer(s), regardless of where the original balance came from, whereas the game texts could be updated beforehand. I'll write a proper justification for the balance-changing fixes in my pull request tomorrow and then look forward to hearing the opinion of the maintainer(s).

@gmcew
Copy link
Collaborator

gmcew commented Aug 21, 2024

Apologies, I misunderstood your earlier comment on the CyberEdge issue from inception and missed the one prior that there's a separate issue introduced alongside Sleeves - I see that now. I also fully appreciate your points and the reasoning behind it; I'm also mindful that super-lategame Bladeburner is a popular strategy for grinding a lategame skill and the broader impacts on that are worth bearing in mind for this fix - and it's not an area I'm an expert on.

With how long this bug has been present, I've labelled this as documentation and enhancement simply to reflect gameplay impact from any change now rather than committing to either direction on how to resolve it. Your edit seems to align with that approach; documentation can be clarified now with any future balance changes for broader discussion.

@d0sboots
Copy link
Collaborator

This is a complicated one for sure. I left some comments on your draft PR; I think they're applicable regardless of how we go forward here. I.e., whether we "fix" the issue and accept a nerf, or "preserve" the weird behavior to keep current balance, IMO restructuring things will make it more clear what's going on.

@cmfrydos
Copy link
Contributor Author

cmfrydos commented Aug 22, 2024

I like the idea of refactoring it first, but I have some concerns about your proposed solution, which I commented in #1606.

One new issue with the current state of completeAction is that Sleeves are also affected by this strange behavior. They receive their XP bonus in Training and Field Analysis, but unlike the player, their calling function does not apply the bonus a second time. So, we end up in this scenario:

Type Training / Field Analysis Other BB Actions
Player 2 1
Sleeves 1 0

Cells describe how often the XP multiplier is applied.

I haven't played with Sleeves yet, so I can't say how a removal affects balance. Are high sleeve-XP augmentations (or source files) a thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
4 participants