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

Fix UEF SACU fire rate upgrade using inaccurate fire rate value #6121

Open
wants to merge 8 commits into
base: deploy/fafdevelop
Choose a base branch
from

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Apr 26, 2024

Description of the proposed changes

Changes the UEF SACU's fire rate upgrade from 1.82 fire rate to 2.00 fire rate because 1/1.82 = 0.5494 so it rounds down to 0.5 fire delay, which is equal to 2 fire rate. Also updates the localizations.

Testing done on the proposed changes

Spawn a UEF combatant preset and step 5 ticks while paused to confirm that it does shoot 2 times per second with the 1.82x fire rate.

Checklist

  • Changes are documented in the changelog for the next game version

@lL1l1 lL1l1 added the area: unit-blueprint related to issues in unit blueprints (*_unit.bp) label Apr 26, 2024
@Garanas
Copy link
Member

Garanas commented Apr 26, 2024

We recently introduced a test suite for invalid fire rates, see also;

local rateOfFire = weaponBlueprint.RateOfFire
if rateOfFire then
luft.test(
"Rate of fire",
function()
luft.expect(rateOfFire).to.be.number()
if rateOfFire > 6.6666 then
luft.expect(rateOfFire).to.be.close.to(10)
elseif rateOfFire > 4.0 then
luft.expect(rateOfFire).to.be.close.to(5)
elseif rateOfFire > 2.8571 then
luft.expect(rateOfFire).to.be.close.to(3.333)
elseif rateOfFire > 2.2222 then
luft.expect(rateOfFire).to.be.close.to(2.5)
elseif rateOfFire > 1.8182 then
luft.expect(rateOfFire).to.be.close.to(2.0)
elseif rateOfFire > 1.5384 then
luft.expect(rateOfFire).to.be.close.to(1.666)
elseif rateOfFire > 1.3333 then
luft.expect(rateOfFire).to.be.close.to(1.428)
elseif rateOfFire > 1.1765 then
luft.expect(rateOfFire).to.be.close.to(1.25)
elseif rateOfFire > 1.0526 then
luft.expect(rateOfFire).to.be.close.to(1.111)
elseif rateOfFire > 0.9524 then
luft.expect(rateOfFire).to.be.close.to(1.0)
elseif rateOfFire > 0.8696 then
luft.expect(rateOfFire).to.be.close.to(0.909)
elseif rateOfFire > 0.8 then
luft.expect(rateOfFire).to.be.close.to(0.833)
elseif rateOfFire > 0.7407 then
luft.expect(rateOfFire).to.be.close.to(0.769)
end
end
)
end

Would you be interested to enhance the test suite to catch these cases too?

@MrRowey MrRowey added area: balance related to units balance DO NOT MERGE Don't Merge until removed labels Apr 26, 2024
@lL1l1
Copy link
Contributor Author

lL1l1 commented Apr 26, 2024

This isn't a balance change, its effect is only for the UI.

@lL1l1
Copy link
Contributor Author

lL1l1 commented Apr 27, 2024

There's only 4 units with fire rate enhancements, does it need a test?

@Garanas
Copy link
Member

Garanas commented Apr 27, 2024

oh, I miss understood then. I thought this was a more broader problem! Great solution however 😃

@MrRowey
Copy link
Member

MrRowey commented Apr 27, 2024

This isn't a balance change, its effect is only for the UI.

you have changed a Unit Fire Rate tho so that is a balance Change

@Garanas
Copy link
Member

Garanas commented Apr 27, 2024

This isn't a balance change, its effect is only for the UI.

you have changed a Unit Fire Rate tho so that is a balance Change

If I'm not mistaken, practically it is the same value due to rounding 😃 ! It's now just more obvious what the value is.

@Garanas
Copy link
Member

Garanas commented Apr 27, 2024

It appears the tests do not run on this branch 🤔 , any idea as to why that is?

@lL1l1
Copy link
Contributor Author

lL1l1 commented Apr 27, 2024

Not sure why it doesn't show up in the "checks" tab of the PR, but the tests do run on my fork's page https://github.com/lL1l1/fa/actions/workflows/test.yaml

@MrRowey MrRowey removed the DO NOT MERGE Don't Merge until removed label Apr 28, 2024
@MrRowey
Copy link
Member

MrRowey commented Apr 28, 2024

That's gin then feel free to merge then when you happy jip

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 area: unit-blueprint related to issues in unit blueprints (*_unit.bp)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants