krefsar
New member
I'm still having trouble understanding the workflow for pooling external behaviors for the purpose of handling the initialization performance drop in a loading screen. In my case, I have an ObjectPool set up with characters with BehaviorTree's. Is the idea to:
1) Leave the reference to external behavior tree blank at first, then
2) Set up a pool of instances of the external behavior tree that have all been initialized, then
3) When spawning a character, assign the external behavior tree reference to an instance from the external behavior pool?
4) When the character is returned to the pool (or destroyed, etc), remove the reference to the pooled external behavior?
The concept of freeing up the external behavior is making me confused. I understand it for a pool of GameObjects, but how does this work for something like External Behaviors?
Alternatively, I could do something like:
During loading, as the ObjectPool populates with the characters, quickly enable and disable their behavior so that they get initialized.
This would theoretically work, but I can't find the place where I would hook into the ObjectPool initialization! I am using the default ObjectPool component that is set up by the Opsive Setup Wizard. This option also makes sense to me, because I'm seeing that when I reuse characters from the pool, I don't have nearly the same performance hit as during the initialization.
For context, I am making a 3D Smash TV clone, which relies on many agents being active at once. You're my only hope!
1) Leave the reference to external behavior tree blank at first, then
2) Set up a pool of instances of the external behavior tree that have all been initialized, then
3) When spawning a character, assign the external behavior tree reference to an instance from the external behavior pool?
4) When the character is returned to the pool (or destroyed, etc), remove the reference to the pooled external behavior?
The concept of freeing up the external behavior is making me confused. I understand it for a pool of GameObjects, but how does this work for something like External Behaviors?
Alternatively, I could do something like:
During loading, as the ObjectPool populates with the characters, quickly enable and disable their behavior so that they get initialized.
This would theoretically work, but I can't find the place where I would hook into the ObjectPool initialization! I am using the default ObjectPool component that is set up by the Opsive Setup Wizard. This option also makes sense to me, because I'm seeing that when I reuse characters from the pool, I don't have nearly the same performance hit as during the initialization.
For context, I am making a 3D Smash TV clone, which relies on many agents being active at once. You're my only hope!