2

enter image description herehi i am developing my new game it is like infinite runner. I am using object pooling for instantiate objects. i have lots of character with animation and rag doll.

Physics are very big on my iPad 3 profiler. when i destroy characters everything is good working. Characters have animator,rag doll and simple waypoint.

How can i optimize that ?enter image description here

2 Answers2

0

You can do some things to improved your physic calculation time spent.

1.- The most important is avoid to use MeshCollider, this is much higher performance overhead. Use primitive colliders ever you can or combine few primitives.

2.- Adjust Fixed TimeSteep setting. You can reduce overhead reducing physic accuracy.

joreldraw
  • 1,736
  • 1
  • 14
  • 28
-1

Okay, first take into account the maximum number of characters on screen. As far as I can see you also wish to optimize this as much as possible, so I have a few tips.

First thing I would do is look at the triangl er count and get it as low as possible for each model without sacrificing the aesthetics.

Next I would set up an LOD system where as an object moves further away the detail decreases saving triangles. You should repeat tgis with textures animation and some of the ragdolls.

Once that is done. Look at the more expensive functions called in your code and see if you can make an alternative. Like you have done with object pooling.

Good luck.

  • i add my statistics. my game have low polly objects. Are statistics big ? – user3366575 May 16 '16 at 11:28
  • It seems an awful lot is used in physics... My first suggestion here is get rid of as many mesh colliders as possible, or make them convex, it is best to replace these with box colliders since they are lighter on physics. – Joseph Cooper May 19 '16 at 20:42
  • Next, start looking at how detailed your ragdolls are, how many colliders do you actually need and try and get rid of as many joints where possible, this relieves the physics slightly. – Joseph Cooper May 19 '16 at 20:42
  • But, personally I would look at the maximum High res models and ragdolls, i can hold in a scene, and then, work on optimizing them, and then when they are optimized for close distance, reduce the polygons and rag-doll colliders as they get further away, by using a pool of objects and ones being unused deactivated. These can then be swapped in at the correct distances, this is how a lot of large crowds are simulated in games like assassins creed unity (not the best example, but there is no denying, the crowd simulation is the best you will find of that size). – Joseph Cooper May 19 '16 at 20:43