cris
New Member
Posts: 9
Posts: 9
|
Post by cris on Jul 8, 2017 9:26:27 GMT
Hi again,
I've been looking at the documentation but I couldn't see any place to completely destroy a category in PoolBoss or a group of entities within a category, how can I achieve that?
Not sure if this might come as an odd question, the reason I need to do that is because I use PoolBoss persistently in my project (the PoolBoss gameobject is flagged as don't destroy on load), this way every scene will load what needs through Pool Boss and destroy them before the scene finishes and transitions to another scene. Global objects (also flagged as don't destroy on load) use PoolBoss as well so I cannot use a normal instance of PoolBoss in each scene since there is some data that I need to be alive all the time.
Many thanks, Cris.
|
|
|
Post by DarkTonic Dev on Jul 8, 2017 17:14:06 GMT
Yes it is an odd question. The very reason for using a pooling plugin is to avoid skipped frames due to Instantiates and Destroy calls. So no, there's no way to lose one of your pools aside from destroying the entire Pool Boss game object. I will add this to the roadmap though. I'm doing Pool Boss items recently anyway.
|
|
cris
New Member
Posts: 9
Posts: 9
|
Post by cris on Jul 10, 2017 10:23:53 GMT
Thanks for your quick reply. Well I guess depending on the nature of the project this might not make much sense, but for example if you think of a project similar to GTA where every part of the city have excluive pedestrians (poor, rich, workers, etc...) and vehicles, if the player is in the same part of the city those game objects get reused, however if you travel to another part of the city you would destroy the old ones (unless they also need to appear in the new part of the city) and instantiate new ones. Actually this feature is quite vital to my project, when do you think we can realistically expect it in PoolBoss?
|
|
|
Post by DarkTonic Dev on Jul 10, 2017 15:58:28 GMT
Just destroying a cagegory isn't all you need. You will also want to create new categories and items. Which will take more doing.
You should probably for now just use a separate PoolBoss 0bject and destroy the other one when you switch areas.
Any reason that wouldn't work?
|
|
cris
New Member
Posts: 9
Posts: 9
|
Post by cris on Jul 15, 2017 11:06:08 GMT
The reason why I cannot do that is because I have a PoolBoss that is flagged as dontdestroyonload, and some entities flagged the same way instantiate game objects under this persistent pool boss. I have a scene called startup, all entities here are persistent (they are flagged as dontdestroyonload) and instantiate resources they need (and they need to be managed through a pooling system). Then I load the next scene (which entities in that scene use the persistent pool boss as well). The idea is when I transition, let's say from scene A to scene B, all the objects in scene A need to tell the persistent Pool Boss to delete all the objects they instantiated. Then Scene B loads and instantiates, and so on. I could hack it for now, but I am ok with just simply not deleting anything (since at the moment I am not concerned about memory), but at some point I would need this functionality. I would be concerned it this will arrive very late since it is part of my core architecture.
Ultimately, if you guys think this is not a priority, could you help me point out where I could modify PoolBoss to implement this myself?
Again many thanks for your fast responses.
|
|
|
Post by DarkTonic Dev on Jul 15, 2017 17:25:24 GMT
Yeah I understood all that already. What I'm wondering is how many things would stay permanently in the "startup" pool? Is it just your player game object? I'm saying you can possibly work around this for now by duplicating the common items that are needed in every Scene in each Scene's Pool Boss, and getting rid of the "dontdestroyonload" one. If that's only a small number of items, this becomes easier.
We will be adding this feature some time.
|
|