So I've started making abilities for my real time combat, and I realize that I should definitely be using object pooling for all these spawned prefabs (particle effects, damage colliders, etc.), but I'm not sure how to do this with Ork's event system.
I know there's an integration with a product called Pool Boss, and I'd be happy to use that, but could someone explain how that might work before I go down that path? Even the most basic example would be very helpful. I assume I'd have to set up all these object pools at the start of battle?
Additionally, if there's another method you'd suggest, I'm happy to try anything. I just need some kind of pooling system I can use for each ability.
Thanks so much in advance!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I imported pool boss (version 1.2.1), then imported the plugin found here: http://orkframework.com/plugins/pool-boss-wrapper/
and then followed the steps laid out for adding the plugin.
And now I'm getting a bunch of errors in every scene that look something like this:
Pool Boss has not initialized (does so in Awake event and may take additional frames if you configured it that way) and is not ready to be used yet. Check that PoolBoss.IsReady returns true before calling other methods.
UnityEngine.Debug:LogError(Object)
DarkTonic.PoolBoss.PoolBoss:Despawn(Transform, Boolean) (at Assets/DarkTonic/PoolBoss/Scripts/PoolBoss.cs:925)
ORKPoolBossWrapper:Destroy(GameObject) (at Assets/ORK Framework/Scripts/ORKPoolBossWrapper.cs:34)
System.Reflection.MethodBase:Invoke(Object, Object[])
ORKFramework.UnityWrapper:DestroyGameObject(GameObject)
ORKFramework.UnityWrapper:Destroy(GameObject)
ORKFramework.GUIBox:Unregister()
ORKFramework.GUIBox:Tick(Single)
ORKFramework.GUIHandler:Tick(Single)
ORKFramework.GUIHandler:Tick()
ORKFramework.ORKCore:FireTick()
ORKFramework.ORKHandler:Update()
as well as this:
Method call failed (ORKPoolBossWrapper): Instantiate
Exception has been thrown by the target of an invocation.
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
at ORKFramework.UnityWrapper.InstantiateGameObject (UnityEngine.GameObject prefab, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) [0x00037] in <6a7acab215dc44b19768ddcebb1ebd48>:0
UnityEngine.Debug:LogWarning(Object)
ORKFramework.UnityWrapper:InstantiateGameObject(GameObject, Vector3, Quaternion)
ORKFramework.UnityWrapper:Instantiate(GameObject, Vector3, Quaternion)
ORKFramework.Combatants.CombatantObject:Spawn(Vector3, Boolean, Single, Boolean, Vector3)
ORKFramework.CombatantAccessHandler:Spawn(Combatant, Vector3, Boolean, Single, Boolean, Vector3)
ORKFramework.Combatants.CombatantObject:SpawnAccess(Vector3, Boolean, Single, Boolean, Vector3)
ORKFramework.Combatants.CombatantObject:LoadPosition(DataObject)
ORKFramework.Combatant:.ctor(DataObject, Boolean, Group)
ORKFramework.Group:LoadMembers(DataObject, Boolean)
ORKFramework.PlayerHandler:LoadGame(DataObject)
ORKFramework.SaveGameHandler:Loaded(DataObject)
ORKFramework.Behaviours.<OnSceneLoaded2>d__27:MoveNext()
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
ORKFramework.Behaviours.SceneChanger:OnSceneLoaded()
ORKFramework.ORKCore:FireSceneLoaded()
ORKFramework.ORKCore:OnSceneLoaded(Scene, LoadSceneMode)
UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)
Each error looks a bit different, and lines up with whatever is being spawned or destroyed at the time.
Any idea what the issue might be? Are there steps I'm missing here?
Thanks a ton!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I don't suppose it would be difficult to update this plugin to spawn/destroy normally on any prefabs not included in a pool boss component? Or maybe just adding an option to include which prefabs to run through custom instantiate and custom destroy?
Cause really, it seems a bit unnecessary to use object pooling for anything other than particle effects and projectiles.
Shouldn't be too difficult to add in the wrapper, though currently somewhat lacking time to get into that :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I know you're probably swamped, but I was wondering if you ever had a chance to look at adding this at all? If not, that's cool, just wanted to check. :D
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!