Increasing max loaded materials? -
[Twixx] - 18.12.2015
Hello,
Currently the maximum loaded SetObjectMaterials seem to be limited to 1000 (including several layers). Say, if I have a map with 1000 objects and each has atleast 2 retextured layers, that would add up to 2000 materials total.
If I were to keep all 1000 objects loaded with a streamer, it would cause crashing. That is because of the max loaded textures limit (although it's not mentioned under
https://sampwiki.blast.hk/wiki/Limits).
Would be great if Kalcor could increase the limit to, say, 2000 for the next SA-MP update. You may talk about preformance issues and whatnot, but the server developers should be the ones worrying and dealing with that. Give us more access to what we can do.
Currently trying to create a custom gameworld and I'm retexturing pretty much every object up to 10 layers. Recently ran into this crashing issue. Can't seem to find a way around it.
If anyone has an idea how to fix this, reply below.
Re: Increasing max loaded materials? -
Kalcor - 18.12.2015
I'm not sure what limit that is. It makes a difference if you use global objects vs player objects (streamed) when changing materials. It sounds like it's tied to the overall object limit (if it's exactly 1000). The game has hardcoded limits all over the place. Some have been hacked around, others I've just left.
Re: Increasing max loaded materials? -
[Twixx] - 18.12.2015
Quote:
Originally Posted by Kalcor
I'm not sure what limit that is. It makes a difference if you use global objects vs player objects (streamed) when changing materials. It sounds like it's tied to the overall object limit (if it's exactly 1000). The game has hardcoded limits all over the place. Some have been hacked around, others I've just left.
|
I'm not sure if the material limit is exactly 1000. Sometimes I can have 900-1000 objects loaded with custom textures and it still doesn't crash. But the limit is definately somewhere between 1000 and 1500.
According to this thread
https://sampforum.blast.hk/showthread.php?tid=339691 the crash is indeed caused by having too many materials loaded at the same time (0x00415D47 ; 0x00536DF4).
Any ideas on how I could work around this issue?
Re: Increasing max loaded materials? -
[Twixx] - 15.08.2016
Bumping this since after all this time I'm still having problems with this. I've noticed some new information that could be useful.
The frequency of crashing seems to rely a lot on your movement speed. If you're in a fast car driving around, you're more likely to crash, but if you're on foot it's less likely. I feel like it's because it's loading in new objects/materials before it can unload the old ones, therefore causing too many objects/materials and crashing.
This is really irritating as it limits us, the server developers, in what we can do with SA-MP. I'm trying to create something new that features a entirely new game-world (pretty large scale map) but it's almost impossible for me to do this.
Any assistance/ideas from anyone?
Re: Increasing max loaded materials? -
SickAttack - 15.08.2016
I remember you said that you had a custom object streamer (not talking about streamer, but something like that), meaning you'd never reach the limit. Or was it just a fluck?
Re: Increasing max loaded materials? -
[Twixx] - 15.08.2016
Quote:
Originally Posted by SickAttack
I remember you said that you had a custom object streamer (not talking about streamer, but something like that), meaning you'd never reach the limit. Or was it just a fluck?
|
We had a custom system that chooses the objects render distance depending on its size, larger objects render further than smaller ones, but that is really irrelevant in this case. Even when I set the render distances myself in a local server theres still the same problem.
Also, even lowering the max loaded objects down to around 700-800 doesn't seem to help. Really looking to Kalcor or someone with knowledge about this.
Re: Increasing max loaded materials? -
Kar - 15.08.2016
Maybe in your custom streamer, count how many material objects are loaded aside, and only apply the material when there is enough space.
Dunno, just trying to help.