Raised This Month: $32 Target: $400
 8% 

[TF2] Preventing lag by precaching weapon models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Steveh
Member
Join Date: Oct 2010
Old 09-15-2014 , 02:22   [TF2] Preventing lag by precaching weapon models
Reply With Quote #1

Hi,

Lately, one of my plugins I've been writing has been getting a lot of lag due to a recent TF2 update which adds the following:
Quote:
Improved client memory usage by updating weapon models to only be loaded on demand
Full update link

Due to this happening mid-game, it's causing lag for clients in the server at the time.

To fix this, I was going to precache all weapon models in `OnMapStart`, but I was wanting a second opinion - incase anyone knew a better workaround.

Thanks,
Steveh
Steveh is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-15-2014 , 09:09   Re: [TF2] Preventing lag by precaching weapon models
Reply With Quote #2

I came up with the same conclusion about what was causing the lag. Unfortunately I don't know a better workaround.

Here's hoping Valve will just fix it on the server today instead so we don't have to worry about it.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-15-2014 at 10:48. Reason: Reworded to flow better.
Powerlord is offline
Requiesta
Senior Member
Join Date: May 2012
Location: Texas
Old 09-15-2014 , 10:49   Re: [TF2] Preventing lag by precaching weapon models
Reply With Quote #3

Quote:
Originally Posted by Powerlord View Post
I came up with the same conclusion about what was causing the lag. Unfortunately I don't know a better workaround.

Here's hoping Valve will just fix it on the server today instead so we don't have to worry about it.
So it would remove the lag or wouldn't?
__________________
YouTuber, Modder, Accountant, and somehow I still enjoy programming after all that.

Check out my YouTube Channel.
Requiesta is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 09-15-2014 , 13:30   Re: [TF2] Preventing lag by precaching weapon models
Reply With Quote #4

I can't help but feel that this thread is grasping at straws. I'm fairly certain the dynamic model loader is intended to load content off the main thread on both the client and server. Valve simply enabled it for weapon models where it had previously only been enabled for wearables.

I don't recall anyone complaining about "lag" when hat models get loaded.

Supposedly many other people are encountering "lag" with the update to SM 1.6, but apparently nobody is competent enough to do any profiling to figure out the root cause. If you are getting hitches, do the SM team a favor and actually profile to find the root cause instead of making WAGs.
__________________

Last edited by VoiDeD; 09-15-2014 at 13:32.
VoiDeD is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-15-2014 , 14:03   Re: [TF2] Preventing lag by precaching weapon models
Reply With Quote #5

Quote:
Originally Posted by VoiDeD View Post
I can't help but feel that this thread is grasping at straws. I'm fairly certain the dynamic model loader is intended to load content off the main thread on both the client and server. Valve simply enabled it for weapon models where it had previously only been enabled for wearables.

I don't recall anyone complaining about "lag" when hat models get loaded.
I haven't ruled out other sources, but I can tell you explicitly that it happens the first time a player spawns. I haven't done more in-depth testing to see exactly what causes it or if it goes away on a stock server. However, I can tell you it happens on multiple servers with different configurations.

Quote:
Originally Posted by VoiDeD View Post
Supposedly many other people are encountering "lag" with the update to SM 1.6, but apparently nobody is competent enough to do any profiling to figure out the root cause. If you are getting hitches, do the SM team a favor and actually profile to find the root cause instead of making WAGs.
I don't know about other lag, but the lag being discussed in this conversation appeared when upgrading from TF2 previous version / MM:S 1.10.2 / SM 1.6.2-git4558 to TF2 version 2395700 (the current version) / MM:S 1.10.3-git913 / SM 1.6.2-git4562.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 09-15-2014 , 16:04   Re: [TF2] Preventing lag by precaching weapon models
Reply With Quote #6

How would one do a SM profiling?
Getting a lot of lag spikes on my CSGO server, so I could do it there.
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 09-15-2014 , 21:36   Re: [TF2] Preventing lag by precaching weapon models
Reply With Quote #7

I believe this is also responsible for fixing mvm crashing issues. Mine used to crash every 2-4 hours. Now they dont crash... Ever.

Probably a combination of other things not being precached as well. I used to get this lag problem, but deleting all of my .cache files on my client fixed it, along with disabling multicore rendering.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode