ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
633 stars 74 forks source link

[TF2] Custom assets missing textures if different maps packed with them are played consecutively(?) #4776

Open Unicake opened 1 year ago

Unicake commented 1 year ago

We discovered this bug on custom gamemode maps, if you play a map stuffed with certain custom assets and then switch to another stuffed with the same assets it will have missing textures on the second map? image I don't remember the technicality of this, someone said it's a problem with tf2's material cache if that's even a thing, someone said it happens if the first map has a custom prop with a 1 skin, and then the second map has the same prop using a different skin.

Some info:

  1. The missing textures only show to players that don't have these custom props installed in their tf folders (so just normal players that are seeing them off the packed map), the missing textures don't show for mappers with the custom assets in their tf folders.

  2. This bug has been spotted when changing from 2 maps: jb_carnival and jb_district_remake, 2 maps rich packed with custom assets and very big filesizes. Both use vehicle and frontline model packs and the props from these would be missing textures on map change between the two.

  3. Both of these maps have custom assets packed correctly, they show properly if you launch both maps on their own, but only playing them consecutively messes the textures up for players.

Ashetf2 commented 1 year ago

Technically this issue is the same as https://github.com/ValveSoftware/Source-1-Games/issues/4214

worMatty commented 1 year ago

I think this is happening because the model is packed into the first map with a limited selection of skins. The second map is showing a missing texture because it's using a skin the previous map did not have. The game will have cached the model on the first map along with any materials that were present at the time. When loading the second map, the game is looking for the material in its cache but does not find it.

This will have happened because the auto-packing tools the map authors used excluded unused skins to keep the map's size down. That's a good thing, but the game's code was apparently not written to account for this. Ideally, the game should recache the model when the second map loads.

Midlou commented 3 months ago

I can confirm that this issue persists. We are having issues with our Tropic Crisis asset pack maps. The behavior is exactly the same as @worMatty described.