Karma: Improved karma health scaling#1867
Merged
Merged
Conversation
saibotk
requested changes
Apr 6, 2026
saibotk
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried the karma health scaling and noticed an issue:
I started a round with 1000 karma points (default starting karma convar) and I got the text in the upper right corner that I do max damage and have max health this round but my health is only 90.
This happened because the maximum karma convar was at 1250 (higher than the starting karma convar).
So I looked into it:
dfwas 1 andkwas 1000 (it usesGetBaseKarma()which uses the starting karma amount (1000))GetKarmaMax()which is set to 1250Karma max convar is only there to provide a buffer (starting karma | max karma) and shouldn't influence health scaling.
I adjusted the calculation and now the messages appear correct and it's more consistent with the damage scaling.
Some examples:
Karma starting convar is at 1000 and Karma max convar is at 1250 in these examples.
Karma min health convar is at 0 and I start a round:
-> I have 100 health points and the messages display correctly (full damage and full health)
Karma min health convar is at 0 and I start the next round but now I set my karma to 0:
-> I have 10 health points and the messages say I do 90% less damage and I have 90 HP less
Karma min health convar is at 0 and I start the next round but now I set my karma to 500:
-> I have 15 health points and the messages say I do 85% less damage and I have 85 HP less
Karma min health convar is at 50 and I start the next round but now I set my karma to 500:
-> I have 57 health points and the messages say I do 85% less damage and I have 43 HP less
Karma min health convar is at 50 and I start the next round but now I set my karma to 750:
-> I have 85 health points and the messages say I do 31% less damage and I have 15 HP less
So it seems to be working fine now.
Now it's more consistent with the damage scaling and the message works correctly (and also displays the lost health points).