Facepunch / garrysmod-issues

Garry's Mod issue tracker
141 stars 56 forks source link

Maps with packed content cause CMaterial::PrecacheVars errors + lag after switching off them. #5870

Open wrefgtzweve opened 3 months ago

wrefgtzweve commented 3 months ago

Details

Loading into any map after playing on a map with packed content will cause CMaterial::PrecacheVars errors. I'm not exactly sure why or how long it takes before it happens on the next map but it seems to happen roughly at the same time for all clients on the server so i assume something is triggering it. I've had cases where the lag spike was triggered twice with a few seconds in between so there is highly likely some kind of way to manually trigger it which i cannot figure out. Console will effectively be flooded with dozens of these lines:

CMaterial::PrecacheVars: error loading vmt file for models/props_c17/door01g_skin2
CMaterial::PrecacheVars: error loading vmt file for models/props_c17/door01g_skin3
CMaterial::PrecacheVars: error loading vmt file for models/props_c17/door01g_skin4
CMaterial::PrecacheVars: error loading vmt file for models/props_c17/door01g_skin5
CMaterial::PrecacheVars: error loading vmt file for models/props_c17/door01g_skin6
CMaterial::PrecacheVars: error loading vmt file for models/props_c17/door01g_skin7

This causes a massive lag spike for players. This is extra annoying for gamemodes like TTT which switch map rather frequently.

Steps to reproduce

The main issue is that i don't know exactly how to trigger the lag pike, it seems to be rather random.

  1. Play on a map with custom content packed into the map
  2. Load into any other map
  3. Wait a certain amount of time and experience the lag spike
Noahbg commented 3 months ago

I'm also experiencing the same issue: random lag spikes after that console spew.

StrawWagen commented 3 months ago

Same here.

robotboy655 commented 3 months ago

Can you please provide a link to a map that is known to cause the issue?

Not sure what I can do with "Wait a certain amount" at any rate.

wrefgtzweve commented 3 months ago

Switching from https://steamcommunity.com/sharedfiles/filedetails/?id=2010286798 or https://steamcommunity.com/sharedfiles/filedetails/?id=2925489145 to gm_construct will trigger it on spawning in image Not exactly the same as the issue players have as that happens even after spawning in, but that can happen multiple times so im assuming that its the same issue.

wrefgtzweve commented 3 months ago

I just found a way to reliably trigger it.

PrecacheParticleSystem( "invalidparticle" )

image

brandonsturgeon commented 3 months ago

Yeah it seems like if you PrecacheParticleSystem an invalid particle, it will print warnings about stuff from the previous map.

You can probably reproduce:

robotboy655 commented 3 months ago

I have pushed some changes to dev that may or may not fix the issue, can you guys please test it and let me know if the hangs you were experiencing are gone?

wrefgtzweve commented 3 months ago

Seems to help a lot yeah! I did notice that a 3 still showed up but there wasn't any lag.

Attemped to precache unknown particle system "qudtchfnrs"!
CMaterial::PrecacheVars: error loading vmt file for particle/warp_rain
CMaterial::PrecacheVars: error loading vmt file for particle/vistasmokev1_add_nearcull
CMaterial::PrecacheVars: error loading vmt file for particle/moth/moth

Might just be from the current map/addon rather than the previous map