Jump to content

Box 2D Game lags


sandy234
 Share

Recommended Posts

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).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...