Playmaker Forum
PlayMaker Help & Tips => Android Help => Topic started by: qaaz345 on November 11, 2013, 04:51:09 AM
-
When you use play maker make Android games
Is there any optimization tips?
-
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
-
Thank you very much!
-
hi,
Good tips and very useful.
Dev
-
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
-
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
-
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.
-
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?
-
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.
-
Thanks! I will definitely keep this in mind for my next project.
-
- If you don't need normals - delete them
What exactly do you mean LampRabbit? How can you delete your normals?
-
When you import a model you get a bunch of options in the inspector - select none for normals (if you can)
-
Are there any examples of how to make a pool manager? Not sure how to make a pool of objects.
-
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.
-
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.
-
I pool using the exact same method sebaslive suggested, it's quite simple and very effective.