Skip to content

Karma: Improved karma health scaling#1867

Merged
saibotk merged 3 commits into
TTT-2:masterfrom
mexikoedi:fix-karma-health-scaling
Apr 6, 2026
Merged

Karma: Improved karma health scaling#1867
saibotk merged 3 commits into
TTT-2:masterfrom
mexikoedi:fix-karma-health-scaling

Conversation

@mexikoedi

Copy link
Copy Markdown
Contributor

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:

Karma 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).

Comment thread gamemodes/terrortown/gamemode/server/sv_player.lua Outdated
@saibotk saibotk added the skip-changelog Skips the requirement for an entry in the CHANGELOG.md label Apr 6, 2026
@saibotk saibotk enabled auto-merge (squash) April 6, 2026 17:47
@saibotk saibotk merged commit 391a6df into TTT-2:master Apr 6, 2026
4 checks passed
@mexikoedi mexikoedi deleted the fix-karma-health-scaling branch April 6, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Skips the requirement for an entry in the CHANGELOG.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants