sandy234 Posted August 14, 2013 Share Posted August 14, 2013 Game seem to run fine on iphone5.But in My S3 theres a noticable dip in frame rate once every 15 secs or so.Havent checked on low end devices.Any1 had any luck with box2d game?? Quote Link to comment Share on other sites More sharing options...
Quetzacotl Posted August 14, 2013 Share Posted August 14, 2013 dip in frame rate might be caused by Garbage Collector. Check if you are not creating mass of local variables in function scope (you can do it using chrome dev tools - timeline memory, if graph is constantly increasing and every 15s dropping, then that is it). Quote Link to comment Share on other sites More sharing options...
sandy234 Posted August 14, 2013 Author Share Posted August 14, 2013 Game lags in mobile browsers and not desktop browsers. I checked timeline in desktop chrome and theres no graph Quote Link to comment Share on other sites More sharing options...
Quetzacotl Posted August 14, 2013 Share Posted August 14, 2013 Turn on recording (click black dot on bottom bar) then check graph. On desktop it might not lag because most probably desktop has much better cpu , on mobile it's different case. Quote Link to comment Share on other sites More sharing options...
sandy234 Posted August 14, 2013 Author Share Posted August 14, 2013 Heres what i got Quote Link to comment Share on other sites More sharing options...
Quetzacotl Posted August 14, 2013 Share Posted August 14, 2013 So as you can see, your memory usage is rapidly increasing (it might be memory leak). GC is also called quite often (too often in my opinion) and it takes some time. On desktop it might be unnoticable, but on mobile this is probably your fps drop rate issue. Usually if you have a problem with fps, then fps drop is constant, if your fps drops only once every 15s, then it's something that takes place every 15s. If you are not doing anything every 15s in your code, then it has to be GC. Quote Link to comment Share on other sites More sharing options...
sandy234 Posted August 14, 2013 Author Share Posted August 14, 2013 Its not always 15 secs, sometimes it happens early, its just random.So how do i fix this??Also is it possible to see framerate in mobile browsers?? Quote Link to comment Share on other sites More sharing options...
Murzy Posted August 22, 2013 Share Posted August 22, 2013 Clearly your game is eating a lot of memory and thats is causing carbage collection with is seen as framerate inconsistencies when playing the game on mobile devices where gc takes longer than on desktop browsers. It's hard to say without seeing what kind of game we are talking about, but one thing that might be causing something like this is if that you are creating a lot of the Box2D fixtures in real time and not clearing the fixture definitions after you are done with them. Also if you are using any of the more complicated functions like the data structures or such, there is a chance of user error not clearing them out after done with them. I wouldn't rule out the possibility True Valhalla pointed out either, GM:S is notorious for its bugs, which sometimes can be very annoying to us game developers. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.