playMaker

Author Topic: Running really badly.  (Read 3719 times)

shinodan

  • Full Member
  • ***
  • Posts: 180
    • View Profile
    • Shinozone
Running really badly.
« on: December 10, 2012, 04:12:00 AM »
I was giving a bash at porting moonman to my phone, HTC EVO 3D, not that bad a phone.
but it runs really badly and i can only really think of it being too many fsm's over the graphics.
can anyone tell me where to start with making this run better? with 3d i would probably drop the polygons and draw distance ect, but this is only sprites, grrrr.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3618
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Running really badly.
« Reply #1 on: December 10, 2012, 08:33:25 PM »
One thing that kills performance on some android devices is per-pixel lighting (controlled in Quality settings). Maybe try decreasing the Quality setting all the way to eliminate graphics as the bottleneck.

If that doesn't help, I'll take a look at your project if you email it to me...

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Re: Running really badly.
« Reply #2 on: December 11, 2012, 05:28:57 AM »
I was giving a bash at porting moonman to my phone, HTC EVO 3D, not that bad a phone.
but it runs really badly and i can only really think of it being too many fsm's over the graphics.
can anyone tell me where to start with making this run better? with 3d i would probably drop the polygons and draw distance ect, but this is only sprites, grrrr.

There is a lot of things that can slow down a phone.
Most of the time its graphic. Reduce them as much you can. Also look at the shaders you are using.
Also if you use particle effects you can reduce them.
Sounds is also a area you need to look at.
If you use scripts, beside playmaker you should look at them to, so they do not use the cpu/gpu to much.
Also look at the FSM so there is not anyone that is looping a lot. they can slow down the phone very fast.

Beside that its hard to tell what to look at.

Sjones

  • Full Member
  • ***
  • Posts: 201
    • View Profile
Re: Running really badly.
« Reply #3 on: December 17, 2012, 03:20:44 PM »
the two main things that I have noticed thus far for performance issues is draw calls, combine your meshes to save draw calls, or even better yet and is more efficient all around as it will not render offscreen geometry is to use batching.

secondly, with about 60 ish FSM's running per frame I noticed a sharp decrease in performance on my sony experia S, they wernt complex at all, needless to say that these where leftover FSM's I didnt need and deleted/disabled them once I finished with them, and the Xperia S is now just under top performance phone along with the galaxy S2 (only a few beat it like the S3 and phones with the built in nVidia tegra chips) so this came as a little surprise as there wasn't much going on.

I havnt worked too much with ausio and sound so not sure on that front

and can agree with shaders, these will be handled by the gpu, large maps with pixle shaders will multiply the time it takes to render.

best way to see if it is the shaders is to lower the resolution of the textures (again in the quality settings this can be done) and see if you get a large performance increase, this is the easiest way, failing this go change your shaders to something like mobile diffuse and re-test.

but if you havnt done any work with draw calls then my guess is that this will be your killer atm.

shinodan

  • Full Member
  • ***
  • Posts: 180
    • View Profile
    • Shinozone
Re: Running really badly.
« Reply #4 on: January 10, 2013, 05:39:46 AM »
Okay so ive managed to get rid of about 150fsm's (obviously the reason for bad performance)
And i still am trying to figure out how to get rid of the rest of them, instead of having an fsm attached to each object im making 1 fsm that responds to tagged triggers globally.

This has increased performance a great deal, but its still not fit for mobile.

thanks for the input guys!

cb

  • Junior Playmaker
  • **
  • Posts: 66
    • View Profile
Re: Running really badly.
« Reply #5 on: February 19, 2013, 03:02:31 PM »
How many Drawcalls are showing under Unity 'Stats'? And how many objects updating on screen? If there's lots then Atlas mapping is the way to get smooth gameplay.

Sjones

  • Full Member
  • ***
  • Posts: 201
    • View Profile
Re: Running really badly.
« Reply #6 on: February 20, 2013, 07:09:26 AM »
atlas mapping is only useful if you are joining multiple different objects into one, otherwise each separate mesh will be its own draw call regardless if their texture map is atlased.

My research dissertation on the subject from a couple of years ago if you want to find out more and how to make things more efficient, also gives tips and tricks on how to make modular environment, using batching to its most http://www.scottjonescg.co.uk/FYPResearch/Investigation_into_modular_design_within_computer_games_v1.0.pdf

while I used UDK as the example engine in it, the techniques and info is still relevant to unity
« Last Edit: February 20, 2013, 07:11:49 AM by Sjones »

cb

  • Junior Playmaker
  • **
  • Posts: 66
    • View Profile
Re: Running really badly.
« Reply #7 on: February 20, 2013, 07:51:16 AM »
Agreed, but for me the only reason a phone app should run so badly would be a LOT of objects moving onscreen, which can often be fixed by the Atlas map/Batching functions. If there's not a lot going on with moving objects then I'd say the FSM's are way off being run efficiently.