Clearing Model Cache
Posted: Sun Feb 07, 2016 10:22 pm
Hello Fellows,
i am trying to figure out if there is a way to use SP ( maybe memory hook ) to clear model cache from the server and even client? ( clearing of a specific model OR even the entire cache)
lets say i am spawning many DIFFERENT models on the server and client, but are going towards the cache limit ( which for "ModelMesh" is 256MB, using cache_print in console ).
Now, some models have already faded and are technically not needed anymore on the server and client.
But now i am unable to spawn any new (DIFFERENT) models or else it will crash the game.
is there a methode to release/unload any "old"/unneeded models from the cache, so that i can keep spawning new models after old ones have faded?
right now i am looking into: https://github.com/alliedmodders/hl2sdk/blob/98fe5b5a34b3721fe4d60ec7ba3a28ade3512560/public/datacache/imdlcache.h
which shows that the engine itself has commands to do so. ( they are probably applied on mapchanges etc )
i am trying to figure out if there is a way to use SP ( maybe memory hook ) to clear model cache from the server and even client? ( clearing of a specific model OR even the entire cache)
lets say i am spawning many DIFFERENT models on the server and client, but are going towards the cache limit ( which for "ModelMesh" is 256MB, using cache_print in console ).
Now, some models have already faded and are technically not needed anymore on the server and client.
But now i am unable to spawn any new (DIFFERENT) models or else it will crash the game.
is there a methode to release/unload any "old"/unneeded models from the cache, so that i can keep spawning new models after old ones have faded?
right now i am looking into: https://github.com/alliedmodders/hl2sdk/blob/98fe5b5a34b3721fe4d60ec7ba3a28ade3512560/public/datacache/imdlcache.h
which shows that the engine itself has commands to do so. ( they are probably applied on mapchanges etc )