Skip to content

Automatic Object Pool

Swap and exchange your logic containers here

Automatic Object Pool

Postby Viziopleasure » 17 Aug 2011, 13:41

I've been looking around and I see the competitors of Antares promising this feature to their users.
Would be interesting for you guys take note about it as a future feature :)
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Re: Automatic Object Pool

Postby Neodrop » 17 Aug 2011, 14:23

Whats this pool mean ?
User avatar
Neodrop
Администратор
 
Posts: 1068
Joined: 15 Jan 2011, 13:18

Re: Automatic Object Pool

Postby Viziopleasure » 17 Aug 2011, 17:27

I mean a "pool" where you load all the gameObjects/prefabs and its instances once for that level loaded in Awake() or Start() of the scene.
Like old consoles used to do, than we just delete in run-time those gameObject we won't use anymore, but the instanciate/destroy common workflow causes Garbage Collection too often, so a gamObject pool is super necessary for iOS/Android games. Its just a way to load all objects used in the scene just once before the scene starts running.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Re: Automatic Object Pool

Postby Neodrop » 17 Aug 2011, 17:32

We have realised it a lot month ago. I mean for our code.
Since 1.23 will be released, it's a work for 5 minuts to create such pool as reused Container
User avatar
Neodrop
Администратор
 
Posts: 1068
Joined: 15 Jan 2011, 13:18

Re: Automatic Object Pool

Postby Neodrop » 17 Aug 2011, 17:42

If you will remind me about it, I will show how to do it.
User avatar
Neodrop
Администратор
 
Posts: 1068
Joined: 15 Jan 2011, 13:18

Re: Automatic Object Pool

Postby Viziopleasure » 17 Aug 2011, 19:26

I have my own pool hand coded.
My intention was just to let you know that other visual editors plan to have an in-built solution for those who don't know how to do it. Goodies for noobs, you know, good marketing practice. ;P
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Re: Automatic Object Pool

Postby Neodrop » 17 Aug 2011, 20:10

Thank you.
User avatar
Neodrop
Администратор
 
Posts: 1068
Joined: 15 Jan 2011, 13:18

Re: Automatic Object Pool

Postby Neodrop » 25 Sep 2011, 03:01

Here we go :

GameObjects Pool.unitypackage
(195.3 KiB) Downloaded 223 times

(Probably, you will need to reimport your latest Universe package after importing this Container)

GameObjects Pool.jpg


GameObjects Pool_01.jpg
GameObjects Pool_01.jpg (14.94 KiB) Viewed 8827 times


This Container has a three IN triggers :

FILL POOL - то fill the pool with instancies.
REFILL POOL - то refill it.
and GET INSTANCE - то get an instance from the Pool.

Three OUT Triggers :

FILLED (when filled)
DONE (when you get Instance)
and
POOL IS EMPTY (when you try to get Instance from empty pool)

Three IN Parameters :

SOURCE OBJECT (GameObject to instantiate in Pool)
POOL LENGHT (Instancies count)
DEATIVATE OBJECTS IN POOL (Bool parameter to keep your instancies deactivated (or not))

Four OUT Parameters :

POOL (GameObjects array with all instancies)
CURRENT INSTANCE (Last one instance from pool)
CURRENT INDEX (int index of last instance from pool)
OBJECTS IN POOL (Quantity of objects in a pool)

I did not check it in real battle, but should work well, I think. Please, somebody, let me know what you think.
User avatar
Neodrop
Администратор
 
Posts: 1068
Joined: 15 Jan 2011, 13:18

Re: Automatic Object Pool

Postby Viziopleasure » 26 Sep 2011, 13:14

Sweet!
I think we can use containers to everything now, instead of building custom blocks.
People out there need to know how useful containers are! Very well done Neodrop.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Re: Automatic Object Pool

Postby Neodrop » 26 Sep 2011, 16:07

Yes. Now, I have used it almost everywhere. At least - it's a very fast and convenient way for code prototyping. In most cases, Containers can replace any code in any project.
User avatar
Neodrop
Администратор
 
Posts: 1068
Joined: 15 Jan 2011, 13:18

Re: Automatic Object Pool

Postby Alewinn » 13 Mar 2012, 18:35

Don't work anymore.

Syntax:
Using csharp Syntax Highlighting
MissingFieldException: Field 'Antares.Vizio.Blocks.ContainerSimple.dontDestroyOnLoad' not found.
Antares.Vizio.Editor.LogicBlockInspector.a (.at A_0, Rect A_1)
h.a (.at A_0, Rect A_1)
VizioWindow.d ()
VizioWindow.u ()
VizioWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
 
Parsed in 0.007 seconds, using GeSHi 1.0.8.4


When importing the package inside Vizio.
Alewinn
 
Posts: 26
Joined: 08 Mar 2012, 15:01

Re: Automatic Object Pool

Postby cowenchin » 14 Mar 2012, 01:49

Update to 1.26rc3 in asset store. It should work. I have the same error message and solved after upgrade.
cowenchin
 
Posts: 13
Joined: 11 May 2011, 02:37

Re: Automatic Object Pool

Postby Alewinn » 14 Mar 2012, 08:40

mmmm didn't work for me...
I have the last update from the asset store, do not work :p

Which version do you use ? Free or not ?
Alewinn
 
Posts: 26
Joined: 08 Mar 2012, 15:01

Re: Automatic Object Pool

Postby cowenchin » 14 Mar 2012, 09:08

Opps... After I import the object pool package it didn't work too, in fact it totally mess up the whole thing. Sorry, I guess
the automatic object pool not update with the new Vizio.
cowenchin
 
Posts: 13
Joined: 11 May 2011, 02:37

Re: Automatic Object Pool

Postby Alewinn » 14 Mar 2012, 09:20

Yes i think so ; the current version of the pool package actually replaces the Antares.Vizio.UnityEngineBlocks.dll file with an old one.
Anyway i'm implementing an integration with PoolManager 2 (http://forum.unity3d.com/threads/104320-PoolManager-2-Released!-By-Path-o-logical-Games?highlight=poolmanager)

Just give a shout here if you're interrested :
http://forum.unity3d.com/threads/127573-PoolManager-AntaresVizio-adapter-interresting
Alewinn
 
Posts: 26
Joined: 08 Mar 2012, 15:01

Next

Return to Containers

Who is online

Registered users: Bing [Bot], Yandex [Bot]