Debugger ... Maybe ?

Discussion and feedback on Construct 2

Post » Wed Jan 02, 2013 10:49 pm

Hey guys , I'm just shooting this idea to plugin makers and devs !

C2 need an inpreview debugger ... that shows a message at the right of the screen whenever an event is executed , that would HUGELY help finding problems in the code !

Post below if you think that's a good idea !

Cheers !
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Wed Jan 02, 2013 10:57 pm

Well, Ashley has said on several occasions that a debugger is on the to-do list. (it was also one of the options in the new feature vote a while back)

There are many threads on the subject already, and as newt pointed out in one of them:
[quote=newt]Not sure how a debugger would work since even the preview runs off of another program... your browser.
However the text object can be used with events fairly efficiently.[/quote]Nimtrix2013-01-02 23:02:45
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Wed Jan 02, 2013 11:03 pm

But having one by default would be as a gigantic help ! Better if a message would pop up for every action you would do !

For example :
In Event Sheet : Add 1 to Example
Ingame : Added 1 to Example (10) <-- Variable Total Value

That would be awesome !

What do you think of that @Ashley ?
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Thu Jan 03, 2013 1:56 am

While a debugger would be helpful - perhaps running on an extra layer that gets put on top at preview - messages for every single thing that happens would be unusable past anything but the simplest of games. There would be way, way too many mesages for a single frame, not to mention at 60fps.

If you want to check if events are running, I generally have a ui element or something like it that has no other code rotate. It's a quick and easy debugging trick that works great.

You could also make your own 'debugger messages' by putting a text object on a layer and appending the text via an action.Arima2013-01-03 01:58:34
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Thu Jan 03, 2013 2:10 am

maybe open a cmd *the debugger* and post the messages there ?
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Thu Jan 03, 2013 3:52 am

[QUOTE=Arima]...You could also make your own 'debugger messages' by putting a text object on a layer and appending the text via an action.[/QUOTE]
Yes, I typically add a 'DEBUGText' Text object and output to it what state messages I need. Not exactly a debugger, but usually quite adequate.

[QUOTE=Arima]... messages for every single thing that happens would be unusable past anything but the simplest of games.[/QUOTE]
Agreed.

And see this article: Debuggers are for Losers. To quote: "... most of the time the debugger is not the best tool to find and remove defects."
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Thu Jan 03, 2013 5:19 am

I would pay another $100 for a debugger...yet since the preview mode runs outside of C2 in the browser I can't see any way of getting it to work without having something like Glimpse running (I'm linking to YouTube as his site seems to be down).

Maybe we don't need a full blown debugger with the ability to step through code (inside C2 I mean). Maybe we could get an extension to preview.js that has clearer list of all the objects and their values, as well as a simpler overview of where the program is currently pointing. I could live with not being able to step through my code if I could just add "runtime.sprite.player[0].X" to the Chrome watch window and see what the current value is. I'm sure something like that is possible now, but you have to wade through some pretty large objects to do it. The irony is we all keep asking for a debugger - we already have a debugger in our browsers, we just need a easier way to make sense of the data. Maybe that is a more realistic goal?

[QUOTE=Arima]You could also make your own 'debugger messages' by putting a text object on a layer and appending the text via an action.[/QUOTE]

For those who might not have seen it yet, I highly recommend using the Chrome logger by wgfunstorm. It lets you spit out data and even arrays into the chrome console tab. Immensely helpful. (Note: I'm linking to the version I added array logging to - The regular version wgfunstorm is missing some files in the zip and he hasn't been on in a while to fix it).boolean2013-01-03 14:48:36
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Fri Feb 01, 2013 7:16 pm

I'm in desperate need of a debugger in C2. I'm spending hours and hours staring at lines of code and realising that I don't understand how C2 is interpreting them, since they 'should' work. I need a line-by-line stepper to see what's going on since this is now taking up most of my time. I'm resorting to sounds (a beep next to the actions so I can hear if they're even being reached) and text object to output numbers, but I'm still having real difficulties. But I guess if it's not feasible in C2... well it's making me think I need to find a different language, which is a shame because C2 is amazing in every other respect.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Fri Feb 01, 2013 8:07 pm

Doesn't chrome offer step by step debugging in the developer console for any js running in the page? Wouldn't this give some of the at functionality?
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Fri Feb 01, 2013 10:39 pm

@farflamex , that's what I wanted to do
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests