Skip to content

Conversation

@cattslmao
Copy link

This PR contains various performance related commits carried over from Team Comtress 2 with permission.


What each commit does

This list describes each commit in this PR:

General performance:

Team Fortress 2 specific:


PR Checklist

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

cattslmao and others added 12 commits August 22, 2025 15:57
it's only being used by a single effect. this is slower, worse for cache, and less accurate
than using the builtins. why software emulate a table?

to ensure backwards compat, i kept the functions and just redirected them to
the function calls. but i did remove the constants, if anyone used these I don't
think they can/should be helped

Co-authored-by: mastercoms <mastercoms@tuta.io>
instead of doing a O(n) lookup per frame in some cases, we can just
init the ConVarRef once

these ones are just possible during runtime or called relatively more
compared to other non-static ConVarRefs

there is one in R_LoadSkys for skyname as well, but not sure if that
was fixed or not

Co-authored-by: mastercoms <mastercoms@tuta.io>
Co-authored-by: mastercoms <mastercoms@tuta.io>
Co-authored-by: mastercoms <mastercoms@tuta.io>
* lower LODs are now marked as set up
* align parent transform matrix

Co-authored-by: mastercoms <mastercoms@tuta.io>
this skips a pre-mature/extra bone setup during particle simulation
and flexing by allowing for the last frame's attachment position to be used

technically this is a bit of a hack but it works well from my analysis.

it gets rid of almost all of the particle cost in team fights besides sprite rendering

Co-authored-by: mastercoms <mastercoms@tuta.io>
cheap water LOD was disabled with local specular
due to shipping constraints
but re-enabled for ep2 on xbox 360

this change now re-enables it for all platforms

Co-authored-by: mastercoms <mastercoms@tuta.io>
some players report that they have tracked down some cases
where the player model could still update its rendering
outside the class menu

this is commonly observed through FPS increasing when
using the scoreboard

may only be relevant for some custom HUDs

Co-authored-by: mastercoms <mastercoms@tuta.io>
g_ragdoll_fadespeed was not being used in TF2 ragdolls
despite being used in other games

fix cl_ragdoll_forcefade not working on the same frame
if delay is 0

fix cosmetics not respecting ragdoll fade settings

Co-authored-by: mastercoms <mastercoms@tuta.io>
despite being a less efficient renderer, DX8 is still used for
performance reasons due to its lower quality settings.
we can continue to provide these lower quality settings
with the much more robust and efficient DX9 renderer,
which will benefit the playerbase and game.

engine change: mastercomfig/tf2-patches-old@eaac092#diff-260f8c14c7dd12646fa64721dcdf647450005b5002ce33047bc6a9ccb578daac

Co-authored-by: mastercoms <mastercoms@tuta.io>
Co-authored-by: mastercoms <mastercoms@tuta.io>
this fixes platform inconsistencies between Linux and Windows
on certain floating point values.

for example, on Windows servers, small ammo packs will grant 41 metal when
on Linux servers they provide the intended 40 metal.

Ceil2Int is also faster computationally

Co-authored-by: mastercoms <mastercoms@tuta.io>
Copy link
Member

@Blixibon Blixibon left a comment

Choose a reason for hiding this comment

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

I know of a few HL2 modders who have tried and failed to restore water_lod_control on expensive water over the years. I don't know much about it, nor do I necessarily know what it's supposed to look like, but I tested it in-game and it does indeed seem to fade out to cheap water at the specified distances... I guess I'll pass that on 🥴

That and everything else in this PR looks good to me 👍

@Blixibon Blixibon merged commit 8c896ae into mapbase-source:mapbase-mp-2025 Sep 5, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants