playMaker

Author Topic: FPS spikes on IOS when objects activated and collision happen for the first time  (Read 3330 times)

PaulH

  • Junior Playmaker
  • **
  • Posts: 50
    • View Profile
when activating game objects (through pooling etc) on IOS for the first time, i get a big FPS spike. It only happens the 'first time' an object is activated, then when i deactivate and reactivate its fine.

Also first time collisions etc cause a major spike, then there after no problem, just the first ones. I have found from using the profiler this is down to playmaker.

Is there any way around this? a way to have all this happen before on startup so it doesn't happen mid game? because this does cause a major problem in my game, i have tried everything to get rid but with no luck.

regards,

ps maybe an action that lets you list the objects you need preloading for all this to happen and preloading into the GPU?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15411
  • Official Playmaker Support
    • View Profile
Hi,

Is your pool prefilled before the scene starts? what pooling system are you using?

 typically, some pool are filled at runtime and you get a spike for each new pool item, and other pools gets prefilled at editor time which means no spike at all.

 Bye,

 Jean

PaulH

  • Junior Playmaker
  • **
  • Posts: 50
    • View Profile
Hi,

Is your pool prefilled before the scene starts? what pooling system are you using?

 typically, some pool are filled at runtime and you get a spike for each new pool item, and other pools gets prefilled at editor time which means no spike at all.

 Bye,

 Jean

hi Jean,

i use coregamekit for the pooling. The pool is loaded/filled before the game starts, but when an item from the pool is activated/used for the first time it spikes, but the second time after its been deactivated and reactivated it doesn't.

also the first collisions/Triggers cause a spike. Then when that object collides for the second time (after despawning and re-spawning) its fine.

if i restart the game after playing it (after all these things have already happened for the first time, using the 'restart level' action) its fine and plays smooth with no spikes at all. The problem is playmaker onAwake, onCollisionEnter etc according to the unity profiler.

If there was some way to make all this happen as the game starts/loads it would eliminate this problem.

or is there something wrong with those actions themselves?


« Last Edit: September 18, 2014, 10:21:23 AM by elusive52 »

PaulH

  • Junior Playmaker
  • **
  • Posts: 50
    • View Profile
Hi Alex or Jean

please can you tell me if anything is going to be done about this?

This issue was first reported a while ago and so its obvious im not the only person experiencing this.

Its nothing to do with the pool its playmaker onAwake and playmaker onCollision/onTriggerEnter that's the problem.

cheers,

Paul


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15411
  • Official Playmaker Support
    • View Profile
Hi,

 this needs a lot more debugging and profiling to pin point exactly what the problem is.

Likely, in most case, it's not really the trigger that is the issue but more what's being done when a trigger is fired.

 Have you profiled it?

 Typically, I would create a dummy prefab, and simply remove all actions apart from the trigger event leading to an empty state, not even logging anything. do you witness a spike still?

 Bye,

 Jean

PaulH

  • Junior Playmaker
  • **
  • Posts: 50
    • View Profile
Hi,

 this needs a lot more debugging and profiling to pin point exactly what the problem is.

Likely, in most case, it's not really the trigger that is the issue but more what's being done when a trigger is fired.

 Have you profiled it?

 Typically, I would create a dummy prefab, and simply remove all actions apart from the trigger event leading to an empty state, not even logging anything. do you witness a spike still?

 Bye,

 Jean

Hi Jean

The same as the other person said regarding this problem, its just the 'first' time these events happen that is the problem, i dont think it is anything in my game, its the actions themselves, or something in playmaker (i think, although of course i could be wrong)

Because the second (third fourth fifth...etc) times these events happen, the 'exact' same actions are used on the 'exact' same objects in the 'exact' same way but there is nowhere near the same spike.

i 'have' profiled it and the spike is caused 99.9% by physics simulate - playmaker onTriggerEnter collisionEnter the first time they are used...why?

the second, third ...etc times these events happen it is roughly 70-90% less of a spike on the exact same objects with the exact same actions.

i know you are busy jean, but please don't leave it days before answering, i really need to get a fix for this.

many thanks

Paul
« Last Edit: September 23, 2014, 11:50:08 AM by elusive52 »

PaulH

  • Junior Playmaker
  • **
  • Posts: 50
    • View Profile
bump for an answer... 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15411
  • Official Playmaker Support
    • View Profile
Hi,

 Can you send me your project? pm me.

I need to see the profiler. If it turns out that it's the physics.simulate call, then I am not sure what can be done.

 Also, I remember a conversation with Alex at Unite, I'll drop him an email so that he looked at your thread, maybe he has some comments on this.


Bye,

 Jean