playMaker

Author Topic: Create object skipping frames. [SOLVED]  (Read 2468 times)

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
    • View Profile
Create object skipping frames. [SOLVED]
« on: September 30, 2013, 05:30:04 AM »
I asked this on the Unity forums as I thought it was more of an engine thing but I'll ask here too.

When I create an object my game will skip a few frames so I was told to hide the object and use it when I need it. But what should I do if I need 10 of the same object? Just have 10 of them loaded from the start? Is there an action I've missed that would help me?
« Last Edit: October 04, 2013, 02:46:23 AM by TIGGYsmalls »

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
    • View Profile
Re: Create object skipping frames.
« Reply #1 on: September 30, 2013, 08:54:31 AM »
Ok, I got told, if want 10 of the objects in the scene, all 10 should be there from the start.

Is this the best way of doing it?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Create object skipping frames.
« Reply #2 on: September 30, 2013, 07:30:28 PM »
This is generally called object pooling, where you re-use objects from a pool of pre-created objects instead of creating new objects while the game is running.

Here are some pooling systems compatible with Playmaker:
http://hutonggames.com/playmakerforum/index.php?topic=4608.msg21650#msg21650

Or you could roll your own in Playmaker...

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
    • View Profile
Re: Create object skipping frames.
« Reply #3 on: October 01, 2013, 08:11:03 AM »
What Actions would I need to use if I was using playmaker?

Or do you mean keep the items off screen till I want them?

I'll get something working with them all loaded from the start and see how the phone handles it.

Thanks for the information.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14574
  • Official Playmaker Support
    • View Profile
Re: Create object skipping frames.
« Reply #4 on: October 01, 2013, 11:37:29 PM »
Hi,

 You can use something like pool manager plugins. I wrote some actions to go with this.

https://hutonggames.fogbugz.com/?W839

bye,

 Jean

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
    • View Profile
Re: Create object skipping frames.
« Reply #5 on: October 02, 2013, 08:30:32 AM »
Assets/PlayMakerCustomActions/Path-o-logical/PoolManager2/PmtCheckIfPrefabPoolExists.cs(36,25): error CS0246: The type or namespace name `SpawnPool' could not be found. Are you missing a using directive or an assembly reference?

I understand this means the script is in the wrong location but I'm not sure what goes where?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14574
  • Official Playmaker Support
    • View Profile
Re: Create object skipping frames.
« Reply #6 on: October 02, 2013, 11:41:39 PM »
Hi,

 Can you redownload the package? I think I had not updated to the latest pool manager ( 5)

https://hutonggames.fogbugz.com/default.asp?W839

bye,

 Jean

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
    • View Profile
Re: Create object skipping frames.
« Reply #7 on: October 04, 2013, 02:45:20 AM »
One or two hiccups with my FSMs but apart from that it works perfectly. Thank you.