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

[BUG] DamagedPlayer event causes FPS drops on fast firing weapons #263

Closed
mtxfellen opened this issue Mar 30, 2024 · 2 comments
Closed

[BUG] DamagedPlayer event causes FPS drops on fast firing weapons #263

mtxfellen opened this issue Mar 30, 2024 · 2 comments
Assignees
Labels
bug report A general purpose bug report.

Comments

@mtxfellen
Copy link
Contributor

event DamagedPlayer in hudanimations_custom.txt currently looks like this:

event DamagedPlayer
{
	Animate CustomCrosshair		FgColor     "Hitmarker"		Linear 	0.0 	0.00001
	Animate CustomCrosshair		FgColor     "Crosshair"		Linear 	0.10 	0.10001
}

This will cause the animation to queue up on fast firing weapons and incur potentially significant performance penalties (regardless of whether you actually use a custom crosshair or hitmarker), most easily reproducible by using the Projectile Shield in MvM.

The remedy for this is to use a guard like this, which will cancel the previous event before running the next.

event DamagedPlayer
{
	StopEvent HitMarker 0.0
	RunEvent HitMarker 0.00001
}

event HitMarker
{
	Animate CustomCrosshair		FgColor     "Hitmarker"		Linear 	0.0 	0.00001
	Animate CustomCrosshair		FgColor     "Crosshair"		Linear 	0.10 	0.10001
}
@mtxfellen mtxfellen added the bug report A general purpose bug report. label Mar 30, 2024
@CriticalFlaw
Copy link
Owner

Good catch, other custom HUDs all use this.

@Kruphixx
Copy link
Contributor

Tested the fix on another hud and it does seem to fix the perfomance issue as expected. No framerate drops with the shield.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report A general purpose bug report.
Projects
None yet
Development

No branches or pull requests

3 participants