How does "Subway Surfers" run so smooth.

Hey, I’ve tried my game on older devices and it runs BAD (on average 22fps), on recent devices it is running very good (60fps, which unity caps it at). On the older device I tried installing subway surfers, it ran very well. My game is also an endless runner, with way less features, I don’t get why my game isn’t running that well. I’ve tried about anything to optimize it(Reducing quality settings, use unlit shaders disabled lights, …) But it has only gained me 10 fps( which brought me to the 22 fps average that i was talking about earlier.) How did they optimize Subway Surfers so good? What more can I try to optimize it?
Also when updating to 2020.2 I did something or the engine did something to UP the file size 20 MB, how can I see what is taking that size up?
Normally it was 22mb but after that engine update it is 47mb

Thanks and Happy Holidays,
Jiry

The developers of Subway Surfers most likely used Unity’s Profiler to seek out and optimize performance bottlenecks.

4 Likes

They are asking less of the hardware than your game is. As @PraetorBlue stated, use the Profiler on the poorly performing hardware to determine what in your game is taking so long to process. Then target your optimizations at those specific issues. Maybe you are rendering too many or too complex of models, maybe your textures are too demanding, maybe it isn’t rendering at all but instead you are running C# code every frame which you could get away with running far less often, or would benefit from being rewritten in a way which is less wasteful. No idea, but the Profiler knows.

As far as file size, an APK file is really just a glorified ZIP file. You can open it up and take a look, compare it to an earlier APK file, and see what got so much bigger.

1 Like

It probably used Unity 4 and not anything more recent :stuck_out_tongue:

1 Like

Eh, I think they would have been booted from the store for lack of 64 bit support if that was the case. (assuming you were being serious :stuck_out_tongue: )

2 Likes

It’s entirely possible if you license the source code. Last time I checked, Call of Duty mobile was using Unity 5.6.

Anyway, you can find the APK with a quick Google search, open it (it’s just a zip file) and check which Unity version they used in the assets\bin\Data\Resources\unity_builtin_extra file: 2019.4.11f1

Now, to how they made the game run so well: it uses only custom unlit materials (single texture plus vertex colors), probably on legacy render pipeline. There’s no post-processing, no HDR, no per pixel (or even per vertex) lights and texture atlases everywhere to keep the draw call well under 100 per frame. The number of triangles is also very small too.

Remember, it was released 8 years ago and it looks almost the same, graphically, as it did back then.

2 Likes

It is also possible Unity themselves would backport 64 bit mobile support to 5.6 for a deep pockets customer. Unity’s support implications would be limited to a rather small number of projects, so isn’t as risky as a public Unity release.

1 Like

One of the perks of enterprise-tier custom licenses is direct access to Unity engineers. They would even visit on site sometimes (before 2020, that is).

Anyway, years ago I actually did some GPU capturing of Subway Surfers to look at how it was doing things. I don’t exactly remember if I used RenderDoc for Android or if it was using a device-specific GPU debugger (Mali or Adreno, probably). You can do it to pretty much any Android game, just like you can do it on many PC games, to take a peek at how it’s doing things graphically.

2 Likes

Upon checking the file sizes between versions I came to the conclusion that: game/lib/arm64-v8a/libunity.so got remarkably bigger in size (It got 18.7MB bigger). This all happened (I think) when switching to unity 2020.2

source on codm using unity 5.6?

He probably opened the apk as a zip file and looked here: assets\bin\Data\Resources\unity_builtin_extra file: 2019.4.11f1
Anybody have any idea why game/lib/arm64-v8a/libunity.so got remarkably bigger in size (It got 18.7MB bigger). This all happened (I think) when switching to unity 2020.2

The APK itself. Unity 5.6.4p4 to be exact.

Ah interesting! thanks

If you want a smooth experience on mobile on lower end devices, it means abandoning most of Unity features. No Standard shader, no shadows, no lighting at all, no Cinemachine, no ugui.

Basically what @Neto_Kokku said

Then smoothness is doable even in Unity 2020.2.

And it’s not that hard to do actually.

The hard part is if you want your game to look more modern and run decently, which means you must also drop all Unity features and reimplement them yourself, which we’re sort of doing, but it’s not something that I would suggest anyone does too much (having to work around Unity is very tiring).

Yeah we are doing the same. Redoing lots of unity features because we need things that are performant and have modern features. :confused: We aren’t even targeting low end devices either. Just medium-high end mobile devices. I was just doing some performance testing today and found out just adding grass to the terrain took up 73 MB of memory! So I need to make a custom terrain detail mesh manager now as well.