Debuging for html5 games

I just noticed that the DEBUGGER window is missing when you are on HTML5 mode.
One can not debug the game when building it for web!

Is there a particular reason for that- like it’s not yet implemented for the linux version?

The debugger is not available for HTML5 games as it requires a tight integration with the game, and for now there is not really any simple way to communicate with the web page being run in the browser (The web page in the browser and Game Develop are two totally different program).

The scirra guys have solved it by implementing an HTML5 debugger that runs together with the game, when in debug mode.
This makes the game loose some fps, but it allows the developer to keep track of what’s going on under the hood with variables.

I don’t mind if I could switch to native mode to debug it and then to html5 to export. But it seems like (and i dont know if this is another limiation with the linux version), I can not switch to play the game in native mode, when it is a html5 game. :slight_smile:

So no way to debug at all when building a html5 game

Of course you can. Do not underestimate GD :smiley: Just activate both platforms for the project (double click on Extension in the project manager), reopen the scene editor and you’ll be able to choose the platform for the preview!

oooh :smiley: Thank you. I wasnt sure why it wont let me switch to native mode. I had to enable the native extension first.

I guess that in this case it would be nice to keep the debugger icon when your game is in html5 mode and when you want to debug it,
So clicking on the debug button in html5 can start the game in native mode and open the debug window (if not opened).

It is a bit more complicated, platforms are designed to be independent (even if they are compatible, they are truly two different things. We could even imagine create an entirely new platform for GD) so for now I prefer not to add the debugger option for HTML5 games as long as there is not a debugger designed for this specific platform. :slight_smile:

1 Like

While not exactly a solution for missing a debugger, this might help you out: I find debugging in game develop is much reduced just by adding clear comments about what each block of 2-10 events is supposed to be doing and putting a bright red block next to things I suspect when I’m writing them are likely to have problems (i.e. Stuff I haven’t really done before or stuff written when I’m super tired or clearly not concentrating well).

Doing this, I’m not finding debugging in GD very difficult compared to when you have to debug thousands of lines of lower level code, when a debugger really becomes necessary.

Yeah, comments are a nice thing to have. I usually put stuff in groups in construct2- that helps and kind of miss it here.

I guess for debugging- when you write a more complex logic- for an AI for example- it is useful to keep track of what is going on with the variables.

Yeah I could just make a lot of text objects and manually set them to show variable stats- but that creates so much extra work. Its like writing your own debugger