I noticed within the editor that I can turn the debug options on and see things like frame rate and time for the CPU among other things. We are trying to support as many phones as we can for our projects because at the end of the game we are planning on giving prizes away with links to other pages. As such, it wouldn’t be quite right for someone with a bad phone to open up the game and be unable to play and thus unable to access the prizes. Is there anyway within PlayCanvas to either detect the frame rate/CPU load and decide that the phone wont have a good experience or detect a crash or a freeze and default to something else? Let me know if anyone has a solution to this. We would love to (and I know this is asking a lot) be able to detect this all the way down to an iPhone 5 (or at least a 6) just to be able to serve a “sorry your device isn’t supported” with a link rather than the PlayCanvas app.
Hey @Jake_Johnson, try the mini_stats feature when launching, this shows some important data like Draw Calls, and CPU/GPU usage in real time. We’ve been using the same to test our own mobile game for compatibility, and it works really well. Check out the official docs here.
Some of the profiler stats are available under the this.app.stats namespace as well. I am not sure if all of them are listed when running a production build of the engine, but give it a try:
Wait so there is a way to read the device version through javascript? Because if that is the case then you could just have a switch where if the game isn’t in the list of supported devices then you could just handout a coupon.
Also, is the frame rate able to be read during the loading screen is that what you are saying?
Okay so that UAParser library seems pretty solid for this use case. After looking through the startup file though, would it work to just include something else on the try and catch block? I noticed it already notifies the user if there is a context creation error. Are the errors that are thrown in that block reliable? Could you just include “hey go claim your prize here” on an html button instead of sending an error? Just curious if anyone has ever done something like this before where if PlayCanvas fails there is a backup.
It’s more if the app does more than what the hardware is capable of (eg running out of memory). At that point, it’s too late, the whole page crashes and doesn’t render any DOM.
You may want to have a custom front page to handle the UA before starting the PlayCanvas app.