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

feat(balance): make AoE damage falloff based on range #6035

Conversation

scarf005
Copy link
Member

@scarf005 scarf005 commented Feb 2, 2025

Purpose of change (The Why)

Describe the solution (The How)

see: #6028 (comment)

falloff is limited to at most 50% of damage

Describe alternatives you've considered

  • add UI for it but the formula is simple enough so we could add them later.
  • could also make falloff begin at half the max range but then it'd need UI to communicate the falloff so it's not in scope of the PR.

Testing

2025-02-02_12-17-54.mp4

image

  1. spawn zombies
  2. fire saiga
  3. see that far away zombies take less damage

Checklist

Mandatory

@github-actions github-actions bot added the src changes related to source code. label Feb 2, 2025
@scarf005 scarf005 changed the title feat: make AoE damage falloff based on range feat(balance): make AoE damage falloff based on range Feb 2, 2025
Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

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

  1. Compiled and load-tested.
  2. Spawned in a shotgun and loaded it with birdshot.
  3. Spawned in a gaggle of zombies to test it against.
  4. Observed the damage numbers seem to vary with distance.

That said uh, AoE can crit it turns out, completely at random and separately for every single zed hit by it, which makes it REALLY hard to actually tell if this is scaling right or not. XD

Point-blank:
image

Guy behind them is also dead:
image

Next person in line is unexpectedly actually less injured instead of more:
image

Fourth in line took slightly MORE damage than third place?
image

Last guy at the end actually looks like damage falloff has happened:
image

@scarf005
Copy link
Member Author

scarf005 commented Feb 2, 2025

the damage log should show how much damage has been dealt with like my screenshot shows

@chaosvolt
Copy link
Member

chaosvolt commented Feb 2, 2025

Gave myself the "no ranged crit" mutation and tested again to grab the damage log:
image

Main problem with using this for testing is I dunno what order it's going in. Your test showed higher numbers up top to imply it's going from closest to furthest, while mine seems to be in ascending order as if it's standing with the ones at the end instead? This is confusing...

That said, without random crits messing things up I can see a more overt progression as I hover on down the line from closest to farther, going from 29 HP left to 50 HP left at the end.

@chaosvolt
Copy link
Member

So given that, that seems to confirm it works. Will go ahead and wait for others to look at it too, mainly because I dunno if they'd want to suggest a different rate of damage falloff of whether they're fine with the current "half damage at max range" scaling.

@scarf005
Copy link
Member Author

scarf005 commented Feb 2, 2025

went to 50% scaling because it's simple, just as Coolthulhu intended

@scarf005 scarf005 force-pushed the feat/shot-distance-damage-falloff branch from aa0d4ec to b5eb4de Compare February 2, 2025 06:18
@scarf005 scarf005 force-pushed the feat/shot-distance-damage-falloff branch from b5eb4de to 540acc0 Compare February 2, 2025 06:20
@chaosvolt
Copy link
Member

went to 50% scaling because it's simple, just as Coolthulhu intended

Only issue is the phrasing implies more aggressive scaling than "half at max range", hecc. Decided to pester him on the server and wait for a reply to clarify if that's what he meant or not before making any code suggestions tho:
image

Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

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

In the event that Coolthulhu does say to scale it all the way down instead of half damage being the minimum damage, the below is the change that'd be needed to implement it. Can just leave it here while we wait to find out whether it's needed or not, and mark as resolved if we end up not using it.

With buckshot (10 range) previous tests showed this increased level scaling will produce 60% damage when target is 5 tiles away and 10% damage when target is the full 10 tiles away.

const float dist = trig_dist( sh.get_origin(), atk.end_point );
const float range = std::max( 1, atk.proj.range );

return 1 - ( 0.5 * ( std::max( 0.0f, dist - 1 ) / range ) );
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return 1 - ( 0.5 * ( std::max( 0.0f, dist - 1 ) / range ) );
return 1 - ( 1 * ( std::max( 0.0f, dist - 1 ) / range ) );

@scarf005 scarf005 closed this Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Damage falloff with distance for AoE ammo
2 participants