playMaker

Author Topic: Optimization in play maker  (Read 12580 times)

qaaz345

  • Playmaker Newbie
  • *
  • Posts: 39
Optimization in play maker
« on: November 11, 2013, 04:51:09 AM »
When you use play maker make Android games
Is there any optimization tips?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Optimization in play maker
« Reply #1 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

qaaz345

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Optimization in play maker
« Reply #2 on: November 12, 2013, 02:43:49 PM »
Thank you very much!

3d_Artist1987

  • Beta Group
  • Full Member
  • *
  • Posts: 157
Re: Optimization in play maker
« Reply #3 on: November 13, 2013, 12:12:40 AM »
hi,

Good tips and very useful.

Dev

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Optimization in play maker
« Reply #4 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


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Optimization in play maker
« Reply #5 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

90degreedesigns

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Optimization in play maker
« Reply #6 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.

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Optimization in play maker
« Reply #7 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?
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Optimization in play maker
« Reply #8 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.

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Optimization in play maker
« Reply #9 on: March 29, 2014, 11:51:30 AM »
Thanks! I will definitely keep this in mind for my next project.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Graham

  • Sr. Member
  • ****
  • Posts: 333
  • I Love Playmaker!
    • Portfolio
Re: Optimization in play maker
« Reply #10 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?
More templates on the Unity Asset Store!

Disclosure: We are using affiliate links to our assets; we may receive a commission for purchases made through them. This helps us to continue developing and maintaining great products!

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Optimization in play maker
« Reply #11 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)

Gav (HeyBud)

  • Full Member
  • ***
  • Posts: 126
    • Tumblr
Re: Optimization in play maker
« Reply #12 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.

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Optimization in play maker
« Reply #13 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.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Gav (HeyBud)

  • Full Member
  • ***
  • Posts: 126
    • Tumblr
Re: Optimization in play maker
« Reply #14 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.
« Last Edit: March 30, 2014, 07:50:13 PM by Sarcophagav »