For the past few weeks I’ve been trying to optimize my game but I’m not making much progress. Everything seems fine when I run it on network preview, and the game runs smoothly, but no matter what I do, the APK export is choppy and is running in 30 FPS less than with the network preview.
I made sure to optimize the code as much as possible and running a profiler shows that total time spent on events is between 8 and 9ms (this is on PC).
I’m not using layer effects, but I do have an “Outline” effect on some objects that is turned off at the start of the game and is activated only at certain times.
I’m not using any huge sprites but I do have around 400 objects on the scene, however I made sure they are accounted for only when they are actually in the layer camera’s view with the “IsOnScreen” extension.
The only thing that gets FPS up is straight up deleting 70% of the objects, but that still doesn’t explain why APK and network preview differ so much in performance.
Hi Wav,
Sounds like a browser issue. What browser do you use for the network preview?
For exported APK, I assume it;s using Android System Webview to power the game, rather than bundling Electron* (could be wrong here) for every APK. I don’t know if updating/downgrading Android System Webview would improve things.
I’m a little bit confused about what you said. Why do you think it is a browser issue?
The game runs good when I run it on network preview, I am using Chrome on my phone. The problem comes up in the exported app. And if I understand correctly, exporting APK for Android/iOS uses Cordova, not Electron.
Actually, yeah I may have used the wrong term.
Chrome is handling the game corectly, but what Cordova uses to export it into an .apk may not be perfect.
I’m guessing Corvoda relies on Android System WebView to function properly - but I never looked into it.
I mentioned it in a topic but no one cared haha (Performance difference between preview via WIFI/LAN and Android APK). My game (which is not very demanding on resources) has noticeable frame jumps or stutters even after deleting all the things that involve consumption on “big” event resources. When moving the camera, you can notice those jumps and that lack of fluidity (even though it works at 59 FPS). This has also been talked here Android Performance Issue even with 2 Simple Small Physics Objects . It is likely due to how Electron generates the build, but there was no official response to clear up the doubts.
If it is due to Electron, there is nothing to do, unless Gdevelop uses another way to make the builds. As I mentioned, I would like to have an official answer to this because it significantly affects my game.
I actually saw your post when I first started troubleshooting but I still wasn’t sure if I did something wrong or if the export is faulty. It’s such a shame that Cordova is messing up many projects.
I actually had the same exact issue with the camera and I had to enable smooth camera extension in order to avoid stuttering.
Additionally, I have FPS counter which shows around 35fps, however it looks choppy and it’s hard to believe the counter is showing correct values.
Not really sure how to proceed with this issue, since it seems it’s not GDevelop’s fault, but Cordova’s.
Have you solved that problem with the “smooth camera” extension?
I have tested my game on very old cell phones and it seems that the counter value is not entirely reliable. In any case, the one I have is a simple one by counting frames every second (it is not the extension). I try to use as few extensions as possible.
At least an answer would be nice to know if it really is something that we cannot solve.