Table-like Debugging Tools

Hello!

New user here and completely new to Defold but pretty pumped to be here. I have only recently come across Defold when looking for OpenSource game engines. Experienced in Unreal and Unity professionally but now diving into alternatives for my personal projects.

Since coming across Lua, I realized it is a perfect language for the project I want to build - so you can imagine how excited I was finding out about Defold which works in Lua by default :slight_smile:

Now - My question before I keep rambling… One of the great tools I found when debugging Lua code in other game engine (as extensions) was a visible table-like debugger so I can see what the content of variables were, including local and globals, at specific breakpoints without having to print them.

I don’t seem to find any similar functionality in Defold. Is that right or am I missing something?

The closest thing I came across was this VSCode Extension which seems to have something like that - in the left side of the image

I’d rather work directly in the Defold engine, however if no option exists I could explore using VSCode too as there are parts of my project which will run isolated from the engine (server code) anyway.

Create a breakpoint somewhere and then click Debug > Start/Attach to activate debugging:

Thanks for the reply @Potota !

That’s neat - However it seems like it’s only giving us the local scope of that breakpoint in the Variables group from the Properties pane.

If for example I had the game state as a global table, it would be pretty cool to have that table be visible in that Variables pane in a similar fashion

If you store that state table in a module, you can require it in a script and have it show up in the debugging pane - like drivers is in the above screenshot. As a workaround, you should be able to use the Evaluate Lua box in the console there to see what’s in a global.

1 Like

I think I could work with that :thinking:

I’ll do some more exploration and figuring out what my workflow will be like but really excited to dig in!
Thanks mate

1 Like