Search Unity

Simple Object Pool for Playmaker

Discussion in 'Assets and Asset Store' started by IllogicalGames, Dec 19, 2013.

  1. IllogicalGames

    IllogicalGames

    Joined:
    Apr 16, 2013
    Posts:
    174
    IMPORTANT: THIS KIT REQUIRES PlayMaker

    Requires unity 4.3
    ​price: 5$ only

    Improve your FPS with object pooling. instead of creating and destroying objects in your scene which is very expensive in term of memory management, use object pooling. "Simple Object Pool for Playmaker" is very simple to use, made with only playmaker actions.

    Creating and destroying object is very expensive especially if you're developing on mobile device where memory management is very important. Use this Simple Object Pool if you need to create and destroy many objects within small amount of time to reduce memory usage.


    Play the demo scene here

    $pool1copy.png $pool2 copy.png $pool3 copy.png $pool4 copy.png $big.png
     
  2. IllogicalGames

    IllogicalGames

    Joined:
    Apr 16, 2013
    Posts:
    174
    this asset is live now! for only 5$
     
  3. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Hey IllogicalGames, are you around?

    I was wondering if you might give me a hand with something with this kit?

    Thanks :)
     
  4. IllogicalGames

    IllogicalGames

    Joined:
    Apr 16, 2013
    Posts:
    174
    hi, yes, what do you have in mind.
     
    snowcult likes this.
  5. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Great :)

    I'm trying to figure out a way to do this, and SOP was one idea I had in mind, but I'm not really sure if it's a good idea or not.

    The idea is that, as the player progresses through the world, the world changes around him. For example, in this screenshot, the pavers below his feet are changing from grey to green with a simple instantiate and destroy script hooked to a trigger on each paver. I'll try to move this over to SOP if it's going to be better. The trees change as well, and animals will be added.

    http://i.imgur.com/Sqp0qu3.png

    The problem I'm having is trying to find a way to made the landscape change as well. One idea I had, because it would be a neat visual, would be to comprise the landscape of hundreds of cubes, that would change along with the pavers in a "wave" as you might be able to grasp from the gfy below (overhead example)

    http://gfycat.com/WideGrandioseIndianspinyloach

    Would this be a) possible with SOP and b) a good idea? Aiming for mobile platform so obviously frames are needed to be saved at every possible corner.

    What do you think?

    Thanks for your time :)
     
  6. IllogicalGames

    IllogicalGames

    Joined:
    Apr 16, 2013
    Posts:
    174
    that what you should use SOP for. if you're planning to instantiate and destroy alot, you should consider using object pool. but may i ask, how many objects do you expect to be destroyed and instantiated within 1 second? (you could still doing fine if it just between 10-20 objects per second, depending on the object.) if the amount is lower than that, i wouldnt recommend using pool, unless u suffer performance lost, u could try using object pooling.

    you could form the lanscape with cubes and prefab it, and then call it in with SOP. and as the landscape moving outside of the screen rect, despawn it. yes you will save lots of frames this way, but, you will also consume lots of frames too because you're using lots of cubes to form the landscape. i would suggest you to model the lanscape with modelling software rather than forming it using cubes, but u can give it a try, maybe the performance suffer not as bad as i thought.
     
  7. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Well, I'm note entirely sure the exact amount but I'm sure I can keep it below ten per second. Here's a good example of what we're currently doing



    Perhaps I can create a "line" and have it animated as a single object, so for that gfy, each vertical line would be a single object with an animation. Or maybe every 3rd or 4th would be alright, hopefully that might cut on frame rate issues.
     
  8. IllogicalGames

    IllogicalGames

    Joined:
    Apr 16, 2013
    Posts:
    174
    from your preview, i wouldnt recommend using object pooling. you dont need to. any way, thats a cool looking game!
     
  9. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Well, at the very least I'm going to use it for the animals, as I'll have a bunch of frogs and birds and whatnot instantiating and destroying. And I want the trees a lot more thicker.

    Hmm, well I'll have to figure out how I'm going to do this. Thanks anyway buddy :)
     
  10. IllogicalGames

    IllogicalGames

    Joined:
    Apr 16, 2013
    Posts:
    174
    yes, if you're going for thicker trees, maybe u need pooling. goodluck with your project
     
  11. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Thanks buddy :)
     
    IllogicalGames likes this.
  12. Sir-Gatlin

    Sir-Gatlin

    Joined:
    Jan 18, 2013
    Posts:
    28
    Was wondering if this asset is still kept up with or has been abandoned. It currently does not work with the latest version of Playmaker.
     
  13. IllogicalGames

    IllogicalGames

    Joined:
    Apr 16, 2013
    Posts:
    174
    i've tested the asset with playmaker and it seems to be working. can you post the error you got?
     
  14. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    253
    I know this is old, but does this still work with the current version of PlayMaker?