Skip to content

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Oct 3, 2025

Issue

Cybran shields have terrible buildtime stats due to previously high shield assist costs, as written in #2703.
UEF T3 shields cost significantly more than other shields to assist. This is just a problem with RegenAssistMult never being touched, alongside the faction having poor shield stats.

Current assist cost stats:

Shield AssistRegen/BP AssistRegen/Mass
Sera T3 2.80 6.06
UEF T3 2.18 4.40
Aeon T3 2.50 5.69
Cybran ED5 2.33 5.19
Cybran T3 ED4 2.17 4.13

Buildtime stats:

Shield BT
Sera T3 5841
UEF T3 4988
Aeon T3 4097
Cybran ED5 7100
Cybran T3 ED4 3515

Description of the proposed changes

Implements new shield blueprint fields that make it easier/possible to balance shield assist.

  • RegenPerBuildRate: Makes it easier to think about RegenAssistMult by disconnecting the desired balance effect from the regen rate of the shield.
  • AssistCostEnergyPerBuildRate and AssistCostMassPerBuildRate: Makes it possible to balance shield assist cost by disconnecting the assist cost from the shield unit's cost stats.

I am interested in thoughts on how user-friendly (UI information display and game intuition), how developer-friendly, and how performant the implementation is.

Testing done on the proposed changes

I read the decompilation that mentions the string "RegenRate", which is around where the RegenAssistMult is used (.text:005F602E).

Re-apply the commit with the Aeon T2 shield.
Spawn in the test units:

   CreateUnitAtMouse('ual0301_rambo', 0,    5.07,    8.48, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,   -0.93,   -4.00, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,   -2.07,   -4.26, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,   -1.21,   -2.60, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,   -1.93,   -6.00, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,   -3.21,   -6.60, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,   -2.93,   -8.00, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,   -4.27,   -8.86, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,    3.93,    7.74, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,    4.07,    6.00, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,    2.79,    5.40, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,    1.93,    3.74, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,    3.07,    4.00, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,    2.07,    2.00, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,    1.07,   -0.00, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,    0.79,    1.40, -0.00000)
   CreateUnitAtMouse('ual0301_rambo', 0,    0.07,   -2.00, -0.00000)
   CreateUnitAtMouse('uab4202', 0,   -4.93,    2.48,  0.00000)
   CreateUnitAtMouse('ual0105', 0,   -9.74,    2.05,  0.35222)
   CreateUnitAtMouse('ual0301_rambo', 0,   -0.71,    1.58, -0.22020)
   CreateUnitAtMouse('xab1401', 0,    7.07,   -2.52,  0.00000)

Damage the shield by groundfiring with the SACU and assist the shield with the T1 engineer. It should repair 50 HP per tick and consume 50m/s and 50e/s, which matches up with the test stats.
Let the shield regen to full, then reclaim the shield with an SACU to damage the unit's HP and see that the engineer consumes an additional 1.89 mass/s and 22.7 energy/s.

Damage the shield, assist, and then reclaim the unit. The engi should update its consumption correctly after the unit is damaged (50% of both the assist and repair costs). This is also an opportunity to see the engine behavior of the repair effects being split evenly when both the shield and unit are damaged: the 50 HP per tick regen will go down to 25 HP per tick after the unit is damaged.

Reclaim the unit, assist, and then damage the shield. The engi should again update the consumption correctly.

Checklist

@lL1l1 lL1l1 requested review from 4z0t, Garanas and speed2CZ October 3, 2025 05:00
@lL1l1 lL1l1 added type: enhancement area: balance related to units balance, but not as a suggestion area: sim Area that is affected by the Simulation of the Game labels Oct 3, 2025
Copy link
Member

@Garanas Garanas left a comment

Choose a reason for hiding this comment

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

I like the idea of it. I'm not a huge fan of the amount of code that requires it to implement it. In particular, the complexity that is introduced to UpdateConsumptionValues which was already a difficult function to reason about before these additions.

lL1l1 added 5 commits October 3, 2025 15:07
This makes adjacency and the positive number restriction apply to shield assist consumption.
This is already covered by the regen thread consumption updates. I tested both power stalling and manual re-enabling.
@lL1l1
Copy link
Contributor Author

lL1l1 commented Oct 3, 2025

I found an engine bug that you can repair shield HP of disabled shields if you trigger the repair by repairing the unit HP, but I didn't remove the cost logic (in OnShieldDisabled, and focusShield:IsUp checks) hoping the bug gets fixed/so that consumption logically makes sense visually (UI isn't displaying updated shield HP when this repair occurs).

@lL1l1
Copy link
Contributor Author

lL1l1 commented Oct 3, 2025

I like the idea of it. I'm not a huge fan of the amount of code that requires it to implement it. In particular, the complexity that is introduced to UpdateConsumptionValues which was already a difficult function to reason about before these additions.

I refactored it to try to make it easier to reason about the function by putting the condition branches in order of increasing complexity.

@lL1l1 lL1l1 marked this pull request as ready for review October 12, 2025 04:41
@lL1l1
Copy link
Contributor Author

lL1l1 commented Oct 12, 2025

I assume the usage format of the blueprint values is ok, so I marked the PR as ready for review.

It was accidentally removed since previously time,energy,mass was always set and then multiplied by the repair ratio afterwards if the conditional was met.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: balance related to units balance, but not as a suggestion area: sim Area that is affected by the Simulation of the Game type: enhancement

Projects

Status: To Discuss

Development

Successfully merging this pull request may close these issues.

2 participants