I’ve been trying hard to optimize my game for weeks and on PC it runs really smooth.
On my Samsung A51 it is very laggy, though, despite the game being a really simple 2d multiplayer.
It’s a 2D multiplayer minigame:
lights with Smart Lighting 2D, 6 lights in the scene + players and a few barrels as light colliders
Photon Bolt as networking engine
about 10 player instances in a game with custom Animators
players grow as they level up in the arena and the ortographic size of camera increases.
6 instances of simple fire particle effects (two layers, I gave up on smoke) in the scene
players see always only one light and one particle effect
I tried to reduce the amount of Animators in my game and my only sin I’m aware of is that I have a UI canvas in world space for each player.
I’m updating Animators of other players only when they are close to the player and I deactivate UI Canvas of such players as well when too far.
What I tried and didn’t work:
enabling Multithreaded rendering
dynamic resolution
reducing DPI (I’m already at 300 and going lower didn’t help at all)
I’m starting to lose my mind. Any ideas? This is a screen from my phone remote profiling without multi-thread rendering.
Are those UI bars above characters on a Canvas? Canvas bars that move per frame are not very performant. Switch them to just being Sprite Renderers, that should save a lot, and that’ll work with the top-down kind of game you have.
However, still the great problem is the rendering, and the Frame Debugger’s output does not look bad.
So clearly most of the problem is with your Smart Lighting settings, so go check out their Discord and see if you can get more particular help there. I’m not familiar with Smart Lighting on mobile so you may be up against a wall and need carefully constructed scenes.
Yes. But they have functionality like fills (radial and horizontal), two TextMeshPro texts and those scale as player’s prefab scale (quite often). If this is the culprit, I might do as you say.
I also considered doing that outside of word space, but it introduced other problems.
Yep, I’ll have a call with the Smart Lighting guy. Thanks!
Assuming you’re using URP, Drop the render scale to 0.5. It’s usually not necessary to use the full resolution on these little high res screens phones have. Should render 4x faster and still look almost the same
Have you find a solution? My 2D game is also lagging a lot on a Galaxy S25 Ultra brand new! Maybe something buggy in Unity? The game runs fine on iPhones, macOS and Windows builds
I suggest to make a new post with all the details (feel free to ping me, I do a lot of optimization).
Likely there is some settings enabled for Android and not the rest, or a setting which performs worse on Android GPUs is enabled.
Despite my best effort, it’s still not completely smooth. It is much better, though, as I started culling the players on the network side. Also I reduced resolution of the light and reworked UI completely.