selvam Posted September 20, 2016 Share Posted September 20, 2016 Hi Guys, Currently we are developing slot games by using Phaser framework, it is a good one for developing games for both mobile and web. But we are facing some problem with samsung devices and some android device that is game get low FPS (<10), so we could not run the game on mobile with good performance. Here we used game total assets size is around 12 MB. Even we had test with sample project with 1MB assets this project we add only one button and only one sprite animation on the stage, this project also get low fps like less than 10. where is the problem can you guys please share your suggestion. It will be very useful to us to continue the project to develop the game asap. Now we are very struggling with low fps, could you guys please suggest us where is the mistake. Note: Tested sample class attached here please have a look on it and suggest us. Thanks in advance. index.html Link to comment Share on other sites More sharing options...
tips4design Posted September 20, 2016 Share Posted September 20, 2016 My guess is that you get low FPS because you are using text (game.add.text). Try using bitmapText instead. Link to comment Share on other sites More sharing options...
selvam Posted September 20, 2016 Author Share Posted September 20, 2016 Thanks for your quick suggestion. we will try it and let you know. Link to comment Share on other sites More sharing options...
selvam Posted September 21, 2016 Author Share Posted September 21, 2016 Hi, I was tried with bitmapText that also gave low fps, but when i switched to Phaser.AUTO render mode instead of Phaser.CANVAS in gives more than 50 fps but Phaser.AUTO does not support some devices, how to handle this situation. Guys could please share your ideas it will really help to us. Link to comment Share on other sites More sharing options...
themoonrat Posted September 21, 2016 Share Posted September 21, 2016 Your code should be prepared to use Auto by default, but maintain in your code a list of devices you force to use Canvas. These could be detected via user agent, browser api availability, screen size, dpi, os, etc etc. No other way around that, really. Link to comment Share on other sites More sharing options...
selvam Posted September 21, 2016 Author Share Posted September 21, 2016 Thanks you much. I have one more doubt that is i want detect device details like that device will use canvas or webGL before creating Phaser right. I think based on the device support only we need to create Phaser instance with render mode Phaser.AUTO or Phaser.CANVAS this thought is correct or not. thanks, Link to comment Share on other sites More sharing options...
tips4design Posted September 21, 2016 Share Posted September 21, 2016 Just use Phaser.AUTO, that's why it's called auto. It detects whether the devices supports WebGL or not and sets the renderer to be Canvas or WebGL. Does your game run at 60FPS constant on desktop? Link to comment Share on other sites More sharing options...
selvam Posted September 21, 2016 Author Share Posted September 21, 2016 thanks for you sharing. Now i set Phaser.AUTO render mode game is working fine. In desktop game run at 30-35 FPS only. (total game assets 7 MB). How can get 60 FPS on desktop could please suggest me. One more clarification that is when game run on mobile at webGL mode all the click events not working there is any property need to enable? sorry guys here i have one more clarification regarding unload assets, how we unload the assets when user get bonus game from maingame here we could unload the maingame assets. currently i used game.cache.removeImage(id) it is useful to reduce memory? thanks. Link to comment Share on other sites More sharing options...
themoonrat Posted September 21, 2016 Share Posted September 21, 2016 @tips4design - I've found occasions where certain mobile devices report as supporting WebGL, but actually have a buggy implementation so need to be forced to use Canvas @selvam Using WebGL mode should not effect events. Increasing FPS is not something that can be helped without seeing the game code. Do a search on the forum and you'll find plenty of others who've asked more general tips on how to improve FPS; take a look and see what helps Link to comment Share on other sites More sharing options...
selvam Posted September 21, 2016 Author Share Posted September 21, 2016 thanks for the reply yes in webGL mode browser throw a alert popup with the message of Rats! WebGL hit a snag. And mask also not working in WebGL mode what will be the problem. could you give an idea. thanks. Link to comment Share on other sites More sharing options...
tips4design Posted September 21, 2016 Share Posted September 21, 2016 Your game should run at 60FPS on desktop devices if you want to run good on mobile devices. You can look on youtube talks about JavaScript performance. Link to comment Share on other sites More sharing options...
selvam Posted September 21, 2016 Author Share Posted September 21, 2016 ok thanks for you advice. Could you explain why phaser mask not working in webGL mode. thanks. Link to comment Share on other sites More sharing options...
Recommended Posts