xerver

Phaser Debug Module

Recommended Posts

Many of you have heard about this, but I wanted to make a post announcing the module.

 

I have created a debug module to help diagnose different CPU related problems you may encounter in your game. The plugin is pretty simple right now but I hope it can grow to be feature-rich as needs evolve. Here is a screenshot of the performance panel:

 

phaser-debug.png

 
 

You can find the module on GitHub: https://github.com/englercj/phaser-debug

 

If you have problems or questions please read the Contributing Guide and post issues on the tracker. Thanks all, happy debugging!

Share this post


Link to post
Share on other sites

Great stuff and very interesting - this could be very useful, especially the SceneTree (which would be helped if it would display the key names).

 

For me it didn't show initially, I've got a complex page setup with the phaser app running in div buried many levels deep, although displayed fullscreen.

 

I had to edit it to make it add the 'pdebug' div to the element of my choice rather than the default document.body, maybe this flexibility could be added.

Share this post


Link to post
Share on other sites

Great stuff and very interesting - this could be very useful, especially the SceneTree (which would be helped if it would display the key names).

 

For me it didn't show initially, I've got a complex page setup with the phaser app running in div buried many levels deep, although displayed fullscreen.

 

I had to edit it to make it add the 'pdebug' div to the element of my choice rather than the default document.body, maybe this flexibility could be added.

Post feature requests and issues on the github page, or I will never actually get around to working on it.

Share this post


Link to post
Share on other sites

Hi Xerver, 

 

Thanks for the excellent module.My game feels laggy and I have decided to go with your module to dig around what the problem might be. To my surprise it showed me that it constantly runs on 60 frames, although it lags and has those nasty hiccups. I am not really sure how to interpret the results that I get. More specifically, what is 2ms and 21 draws? Shouldn't be like the draws be equal to the frames per second? The bottom diagram is also a bit strange for me, how should I read it? Thanks once again.

 

Lag_Debug.png

Share this post


Link to post
Share on other sites

2ms is the time it takes to execute one frame tick, it is the amount of time it takes game.tick() to run.

 

60fps is calculated based on the time it takes for the game to go from the start of one game.tick() to the start of the next game.tick().

 

21draws is the number of WebGL draw calls that are made each frame (each filter pass is a draw, each flush of a webgl batch is a draw, etc).

 

If you are seeing jumping and lagging it doesn't seem related to CPU, I would need to see a live running example to know better though. Have you tried profiling your memory? Sounds like you are getting hit by GC spikes which will "pause" all the running JS and act like you are descibing.

Share this post


Link to post
Share on other sites

Hi 

 

Thanks for this module, I'm using it a lot, especially for the draw calls.

 

Regarding these, I noticed that Object not displayed in the camera are still increasing the number of draw calls. Isn't that weird? I know this might be a Phaser issue, but did you also noticed that? I managed to decrease them by setting the alpha of "unseen" object to 0, but I wanted your advice on this ( as I have to constantly check if a sprite is in the camera or not == more CPU usage )

 

Also, I get (N/A) draws when playing in the browser from my tablet.

 

Cheers

Share this post


Link to post
Share on other sites

This is still working. Make sure you give .pdebug a high z-index otherwise it won't appear (if your canvas is using CSS z-index) 

 

I can't see how this module is much us though as all it shows is very general info. It doesn't break performance down into something more granular, such as which functions are using resources. I think your typical JS profiler tells more than this.   

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.