• We are looking for a content creator to help market our assets and a future unannounced project. More details are on this page.

Optimising UCC for mobile

ayush

New member
Hello
I am using UCC for more than 6-8 months now and most of my game is build on that and its quit a big open world 5v5 game, So obviously need heavy optimization as its mobile game, I know most of the unity optimzation but I think i need to optimise UCC seperately too. So my question in what all ways i can optimise UCC components, animators etc for Mobile game ??
Thank you
 

Justin

Administrator
Staff member
I recommend profiling your game to see what is causing the bottleneck, from there you'll have a better idea of what to optimize :) If the animator is an issue then you can reduce the number of states/layers within the layers. This page also has some tips, though it is geared towards AI agents:

 

fdmaker

New member
I do mobile vr and android and am bit of an optimization nerd.... The one MAJOR mobile optimization is to use some sort of mesh combiner and atlaser on your levels.... Took me down from like 200 draw calls to like 25. It can also mesh combine skinned meshes (enemies) Its often overlooked and some rely on Unity's built batcher and you shouldn't.... I use meshbaker and highly recommend.

I'm still new to UFC, so I'm not entirely sure where prefmon is on that yet. I see there is an object pooler, this is always good, have you set that up?

I seem to get good framerate and prefmon on the demo scenes on the mobile headset, out of box (once I do the checklist of Unity Optimizations for mobil like, lighting, physics, timing, culling, etc) on the demo scene.

Cheers mate

Edit': In case you can't link through for some reason... from the docs.

Performance​

If you are noticing performance bottlenecks within Animators.OnAnimatorsAnimatorMove there are a few different things that you can try to reduce the performance cost:

  • Change the Update Location on the Ultimate Character Locomotion to Update instead of FixedUpdate.
  • If you are using a pathfinding agent you can disable the Detect Horizontal Collisions and Detect Vertical Collisions toggle on the Ultimate Character Locomotion component.
  • Disable CharacterIK for your AI agents.
  • Use instancing on your character. Our community has had success with GPU Instancer and Mesh Animator.
 

ayush

New member
Hey fdmaker thanks for the reply, I am already using Mesh combiner and also Mantis Lod my issue is that on combining mesh, tries and vertis increases which can also cause issue, on the other hand i have not combined my character mesh which i will try, also if we combine most of environment assets into single mesh I dont think occlusion culling will work properly ?
Everything is quite simple still GPU usage goes High on mobile
 

fdmaker

New member
also if we combine most of environment assets into single mesh I dont think occlusion culling will work properly ?
Hi again.

Interesting point and one I can speak too specifically, as I tested this exact use case out for my mobile vr game when i was learning meshbaker and how unitys culling and static batching all played well together.

What I found was for an s7 class machine (what the go and quest are designed around) was that draw calls were more important then texture bandwidth or even vert calls... but there are limits. In fact the hard limit is: 100,000 verts and 100 draw calls...

What I found for my level design was not to build out the entire level as one big mesh object, but instead was to use mesh baker to built out areas of the level, or "rooms" of my level with each level making up of 12-20 of these "rooms" stung together and set ass static. (for culling) In my case rooms were actual rooms of a dungeon, but the idea could be used for subareas of an outside terrain, or a space game, or any type of 3d level...

These rooms were just complied prefab objects of tables, walls, stairs, bookcases and the like, all mesh combined into one mesh object with a corresponding texture atlas.

Each "room" would be about 20-40k verts with a 4012x4012 texture atlas and would be two draw calls. One for the geometry and one for the texture call.

The camera would have culling on, so only two or three of these rooms would be visible at any one time, resulting in maybe 10-15 draw calls in total. This DRAMATICALY sped up performance for me. where as before ,just using unity static batching, I was getting 150-200-ish draw calls and fps were 25-30, but using this level building technique, I got 72 fps native and could sustain 90fps if I overclocked the device.

Add a few dynamic objects and enemies and a UI and you can get to 30-50 draw calls witch should be well within the prefmon budget of older 2-3 generation legacy mobile systems and absolutly within modern smobile standards.

I was doing this for mobile vr, so had to design for 360 degree, but if you are flat mobile, you can stream line this process a tad more for 2d.

Anyway, cheers mate!
 
Top