I am currently working on my first serious title as a hobbyist and have encountered a problem. When building for mobile physics suddenly take a huge amount of drawcalls and makes the game neigh impossible to play.
Does it have a lot of static objects? Once I’ve encountered issue of them not properly static batching when loading scene (I used additive loading though).
The thing I don’t understand logically is why the profiler looks so different on mobile and pc platform and that basic physics takes up such a disproportionate amount of calculations
It’s general performance(what you see as 0.5% on PC can be 2% on mobile) and architecture(1 CPU instruction on PC can be 5 on mobile) differences. So they tend to stack up.
Hmmm… Maybe ferr2d creates too much colliders if scene reloads? Like instead of creating only one collider it doubles, triples them, doesn’t merge when needed, etc… Can you check if it’s terrain that’s causing it or not? (Replace it with one box collider just for testing for example)
I did that and it did indeed fix the problem, but I basically need the plugin for my gameplay to work.
But the drawcalls on mobile are not merely mulitplied a few times but is increased ~200 times. That seems ridiculous to me, there is not some known setting or bug that destroys mobile physics?
Those are not DrawCalls. Those are Physics.Simulation/Physics.Processing/Physics.FixedUpdate calls. They are passed to each GameObject. So your scene magically gets a ton lot of GameObjects that it shouldn’t have. And as it doesn’t happen without terrain, it’s ferr2d issue.
Maybe it creates each triangle as separate gameobject in some specific case or some other bug happens. I’ll leave this topic as issue is within ferr2d and as I don’t have ferr2d I can’t help much.
Thank you very much for your insights, I’ve contacted the developer and hope for a solution Do you know if there is any way to debug from mobile so I could check the amount of physics GameObbject?