Playmaker Forum

PlayMaker Help & Tips => Android Help => Topic started by: qaaz345 on November 11, 2013, 04:51:09 AM

Title: Optimization in play maker
Post by: qaaz345 on November 11, 2013, 04:51:09 AM
When you use play maker make Android games
Is there any optimization tips?
Title: Re: Optimization in play maker
Post by: jeanfabre on November 12, 2013, 01:44:18 AM
Hi,

 the optimization really are on your content first:

-- use mobile friendly shaders
-- use very optimized and low poly meshes
-- don't use fancy camera effects
-- don't use iTween in your game loop, prefer mobile friendly tweening libraries
-- optimize your physics triggers and rigidbodies if you have a lot ( using physics layers)
-- dont' use costly methods like gameobject find by string ( prefer tag based finding), and cache your references instead of searching everytime if you use the find action.
-- use a pool manager if you are instanciating destroying a lot of gameobject.

Also, the best way to go about mobile development is to test and profile on the deivec very regularly ( almost during and after each feature implementation) as you progress in your game development. This is critical!

Bye,

 Jean
Title: Re: Optimization in play maker
Post by: qaaz345 on November 12, 2013, 02:43:49 PM
Thank you very much!
Title: Re: Optimization in play maker
Post by: 3d_Artist1987 on November 13, 2013, 12:12:40 AM
hi,

Good tips and very useful.

Dev
Title: Re: Optimization in play maker
Post by: escpodgames on November 13, 2013, 05:25:08 PM
On top of Jean's tips. the biggest thing I've had to optimize on my current game is the draw calls ... here's a few tips to do that.

- Use the same materials whenever you can (atlas textures to help this)
- If you don't need UV's delete them (this will add to the dynamic batch vert count)
- If you don't need normals - delete them
- Check your shaders aren't doing more than one pass (can be more but you will increase draw calls)
- Do not scale models! This one seems weird but if you scale a prefab(model) it can not batch

Title: Re: Optimization in play maker
Post by: jeanfabre on November 14, 2013, 12:18:39 AM
Hi,

 good points here, also one more thing on scaling:

Don't scale Physics gameobject too, the Physics engine do no like weird scaling and collision detection can be affect if scaling is not consistent. It's a general tip but a very important one as well.

bye,

 Jean
Title: Re: Optimization in play maker
Post by: 90degreedesigns on January 09, 2014, 06:36:38 AM
Another thing I could add is don't use mouse input. It sounds silly I know, but when developing my first big game it was originally a mouse-based game and used mouse controls. When I switched it over to be an Android game, I didn't remove the mouse input and I was told (I can't remember where) that allowing for mouse input was costly on mobile.
Title: Re: Optimization in play maker
Post by: sebaslive on March 28, 2014, 02:38:23 PM
Hey jean, what do you mean by...

-dont' use costly methods like gameobject find by string ( prefer tag based finding), and cache your references instead of searching everytime if you use the find action.

How do you cache a reference?

And lane, what do you mean by...

-do not scale models, it can not batch?
Title: Re: Optimization in play maker
Post by: escpodgames on March 28, 2014, 05:53:04 PM
Hey jean, what do you mean by...

-dont' use costly methods like gameobject find by string ( prefer tag based finding), and cache your references instead of searching everytime if you use the find action.

How do you cache a reference?

And lane, what do you mean by...

-do not scale models, it can not batch?

I can answer those!

If you're going to search for a game object, just do it once and store it as a variable. Don't keep searching during gameplay as you will get lag.

If you scale a model (imported from a 3D package) it will not dynamically batch. Search 'Draw calls' for more info.
Title: Re: Optimization in play maker
Post by: sebaslive on March 29, 2014, 11:51:30 AM
Thanks! I will definitely keep this in mind for my next project.
Title: Re: Optimization in play maker
Post by: Graham on March 29, 2014, 07:21:59 PM
- If you don't need normals - delete them

What exactly do you mean LampRabbit? How can you delete your normals?
Title: Re: Optimization in play maker
Post by: escpodgames on March 30, 2014, 01:16:05 AM
When you import a model you get a bunch of options in the inspector - select none for normals (if you can)
Title: Re: Optimization in play maker
Post by: Gav (HeyBud) on March 30, 2014, 11:57:27 AM
Are there any examples of how to make a pool manager? Not sure how to make a pool of objects.
Title: Re: Optimization in play maker
Post by: sebaslive on March 30, 2014, 12:28:40 PM
Are there any examples of how to make a pool manager? Not sure how to make a pool of objects.

How I pooled in my last game was to have an empty gameObject with 2 of each object I meant to spawn, which are deactivated, and then I would grab that child based off a tag and place it into the game while activating it and once they are "destroyed" I would deactivate them again and place them as a child into the same empty gameObject. That way it gets loaded from the beginning and looks like it is being created constantly.
Title: Re: Optimization in play maker
Post by: Gav (HeyBud) on March 30, 2014, 12:51:01 PM
That sounds like a good plan for a pool thanks. Your Kaptain kat game is fun btw.
Edit: I just found Smart Pool on the asset store with playmaker support as an option.
Title: Re: Optimization in play maker
Post by: Graham on March 31, 2014, 08:01:52 AM
I pool using the exact same method sebaslive suggested, it's quite simple and very effective.