playMaker

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

qaaz345

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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14400
  • Official Playmaker Support
    • View Profile
Re: Optimization in play maker
« Reply #1 on: November 11, 2013, 11:44:18 PM »
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
    • View Profile
Re: Optimization in play maker
« Reply #2 on: November 12, 2013, 12:43:49 PM »
Thank you very much!

3d_Artist1987

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

Good tips and very useful.

Dev

escpodgames

  • Hero Member
  • *****
  • Posts: 686
    • View Profile
    • Assets
Re: Optimization in play maker
« Reply #4 on: November 13, 2013, 03: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: 14400
  • Official Playmaker Support
    • View Profile
Re: Optimization in play maker
« Reply #5 on: November 13, 2013, 10:18:39 PM »
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
    • View Profile
Re: Optimization in play maker
« Reply #6 on: January 09, 2014, 04: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: 557
    • View Profile
    • Frame Tale Studios
Re: Optimization in play maker
« Reply #7 on: March 28, 2014, 11:38:23 AM »
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: 686
    • View Profile
    • Assets
Re: Optimization in play maker
« Reply #8 on: March 28, 2014, 02: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: 557
    • View Profile
    • Frame Tale Studios
Re: Optimization in play maker
« Reply #9 on: March 29, 2014, 08: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: 318
  • I Love Playmaker!
    • View Profile
    • Portfolio
Re: Optimization in play maker
« Reply #10 on: March 29, 2014, 04: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: 686
    • View Profile
    • Assets
Re: Optimization in play maker
« Reply #11 on: March 29, 2014, 10:16:05 PM »
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: 117
    • View Profile
    • Tumblr
Re: Optimization in play maker
« Reply #12 on: March 30, 2014, 08: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: 557
    • View Profile
    • Frame Tale Studios
Re: Optimization in play maker
« Reply #13 on: March 30, 2014, 09:28:40 AM »
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: 117
    • View Profile
    • Tumblr
Re: Optimization in play maker
« Reply #14 on: March 30, 2014, 09:51:01 AM »
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, 04:50:13 PM by Sarcophagav »