Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pool Manager Nullref
#1
Hey, I have a problem with CurvySplines

I have a generator with a lot of create game object CGModules.
It seems like every CGModule will create its own set of pools as it differs in its Unique Id. 

CGModule.cs
Code:
protected PrefabPool GetPrefabPool(GameObject prefab)
{
     return Generator.PoolManager.GetPrefabPool(UniqueID.ToString(System.Globalization.CultureInfo.InvariantCulture) + "_" + prefab.name, prefab);
}

It got so bad that I get hudge performance drops when opening the Generator in the inspector.
So I decided to disable Auto Create Pools.

The problem is, that I then run into a nullref exception:

PoolManager.cs
Code:
public PrefabPool GetPrefabPool(string identifier, params GameObject[] prefabs)
{
      if (!IsInitialized)
            Initialize();
      IPool pool;
      if (!Pools.TryGetValue(identifier, out pool))
      {
            if (AutoCreatePools)
                pool = CreatePrefabPool(identifier, null, prefabs);
      }
      return (PrefabPool)pool;
}
Returns null


CreateGameObject then accesses Identifier of the null value -> NullRef Exception:

CreateGameObject.cs
Code:
string poolIdent = GetPrefabPool(VGO[id].Object).Identifier;


As a quickfix for my problem, I could change GetPrefabPool to:
Code:
protected PrefabPool GetPrefabPool(GameObject prefab)
{
      return Generator.PoolManager.GetPrefabPool(prefab.name, prefab);
}
removing the unique id and having one pool for each prefab. Do you think that this might cause other problems?

Thanks in advance!
Reply
#2
Hi,
I will take a look at this soon. Can you please tell me what version of Curvy do you use?
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
Thanks! As of the ReadMe.txt I am using 5.2.2
Reply
#4
On Curvy 6.0.0, the following optimization was done:
"[OPTIM] Modules that are out of the view are now culled"
That means that when you have for example 300 modules, and the generator window is showing 20 of them, in versions pre-6 rendering was done for all of the 280 out of window modules. This might be the reason for your slowdowns, and not the pooling thing.
The null reference exception is definitely something I need to look at, but could you please Update to the latest Curvy version and tell me if you still suffer from the same issues?
Thanks
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#5
A rough feeling tells me that this should fix the issue that the visual graph is slow. The problem is that I have a component in the inspector for every pool with ~600pools because of the 600 CreateObject Modules having a unique id.
I will try out later and come back to you with the results.
Reply
#6
600 modules are definitely too much for the old Curvy version.
I don't believe that 600 pools would create an issue. It would be smarter to have less pools, I agree, but I don't think that having so many pools is currently problematic
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#7
And about the null reference when disabling Auto Create Pools, I couldn't reproduce the issue. Things were done in that field since the Curvy version you are using. Pleas let me know if you can reproduce this issue using the latest version
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting MissingReferenceException from the component pool when I destroy a spline Excrubulent 5 1,898 11-22-2020, 11:38 AM
Last Post: _Aka_
Sad Spawning Controller Prefab with Matched Spline Prefab Using Pool Manager Kerkenez 10 17,132 03-29-2016, 08:19 PM
Last Post: Kerkenez

Forum Jump: