Guidelines for mobile development

Hello! been having a great experience with playcanvas thus far, and have managed to get some nice work done on a few games.

I’ve just recently tried the games on mobile (iPhone 5c, iOS 8.3, Safari) and see that they don’t work- they basically just stop dead after appearing to render maybe 1 frame with the camera in a bizarre location. I don’t see any errors in the console, so I’m not sure about the issue.

In general at this point I’m just looking for some guidelines for mobile development - besides using touches and swipes, where can I find out about optimizations, orientation changes or forcing a specific orientation, and any other pitfalls that may come up- for example how does playcanvas determine the width/height of the canvas on a mobile device? While checking the games on the ‘explore’ page I notice that only about 50% work, so I realize mobile-first is not a primary strategy for development, but my games need to work reasonably well in mobile browsers.

It seems my plan now will be to start from a clean scene and build it up, checking how it does on mobile with each iteration to see if I can find the issue. Thanks in advance for any help!

Great topic for a thread! I have a few things to saw on the matter:

  • Optimization/tips’n’tricks sounds like an excellent idea for a User Manual page.
  • From the top of my head, I recommend keeping draw call count relatively low, avoid using the physics engine to simulate many rigid bodies, keep dynamic light count relatively low, avoid allocating things like pc.Vec3/pc.Quat/etc on a per-frame basis, use the Dev Tools profiler to see where time is being spent, use WebGL Inspector to see how WebGL is being fed commands (kinda advanced if you’re not a WebGL expert but useful anyway).
  • Definitely do what you suggest and build up your scene regularly checking on mobile. Did you know you can copy the launch URL for your game to your mobile device and the device is connected to the Editor to accept live update? It’s really cool!
1 Like