Debugging phaser on node #117
Replies: 2 comments
-
I just debug it locally using my ide (Webstorm, but I suppose that other IDEs can debug node as well with the right configuration and/or plugins). Just run it as an app, normally, with a preconfigured process attachment. Just like you would debug any console application. About the idea of using Electron or any visual way to help you debug, why not? I would just avoid coding in a way that could cause overheat in your headless mode. |
Beta Was this translation helpful? Give feedback.
-
Yes exactly 😎 |
Beta Was this translation helpful? Give feedback.
-
First off, I just wanted to say massive thanks. Very glad after taking some time off my project, to come back and see that it's now compatible with the latest node (I was worried I would be pinned to an old version).
I wanted to ask a question around debugging on node, from my investigation (and with help from your https://github.com/yandeu/phaser3-multiplayer-with-physics repo), I've summarised debugging the server via a browser as follows
It is possible to start a scene, against our server in two ways --
Using node-canvas
Writing a HTML file, and have the server (when a defined route is hit) load a scene from code we defined in /server
This limits how useful this is for debugging on any complex projects, as we'll need to add special debug code all over, to mimic the network requests our scene running on the server would typically receive, also define keyboard handlers etc. On any non-trivial project this would be extremely painful - and still wouldn't be what we really want (which is to easily debug our networked code, is doing what we expect - E.G cleaning up sprites, removing physics colliders etc)
My question is, do we think there will ever be a better way to debug how our server is running, other than debug logs?
EDIT
I should have looked harder.. I can see you already have a repo which addresses exactly this - https://github.com/geckosio/phaser3-multiplayer-example-electron/blob/master/package.json
Is the idea there, we run it in electron only for development, and then we'll switch to HEADLESS for prod? I'd imagine running under node-canvas, is more performant than running under electron with
show: false
?Beta Was this translation helpful? Give feedback.
All reactions