Home Forums Programming Lua Debugging in Visual Studio?

Viewing 11 reply threads
  • Author
    • #6402

      Hi all,

      Working more and more with Lua under C++, and am looking at ways to improve the toolchain.

      I’ve got VSLuaLangPack up and running which helps, but I’m really looking for something that allows script debugging, breakpoints, and possibly call stack viewing.

      I’ve found VSLua, it is pretty good,

      but just wondering if anyone out there has come across an open-source app, and/or more featured, etc.

      Lua 5.1.2 is the current version, if relevant.


    • #41230

      Hi jediboy,

      Check out Decoda. http://www.unknownworlds.com/decoda

      It’s pretty handy I have to say, and I think it’s probably the way to go.

      I used VSLua for a while too, it’s great that it’s integrated into the vs ide.

      Of course, you could just write your own debugger with lua’s debug interface ;)


    • #44399

      Got put on to this a while back and have been pleasantly surprised by it.

      Tilde: http://luaforge.net/projects/tilde/

      Its free, open-source, and fairly battle-tested.

      I’ve only recently been put on to a few other debuggers including:

      Zeus: http://www.zeusedit.com/


      LuaDebugger: http://code.google.com/p/lua-debugger/

      My votes is still with Tilde, at least for now.


    • #44400

      …and I’ve had a few PM’s about Lua and relevant tutorial links, and so I’d recommend the following:

      Lua tutorials wiki: http://lua-users.org/wiki/TutorialDirectory

      Its the first hit in google, and really for any students out there looking to get their head around what Lua is, its syntax, the virtual machine, and so forth its the best place to start. work through those and your good to go.

      After that, its a case of where to use Lua in a game context, and again my recommendation is to check out this:

      LuaBind: http://www.nuclex.org/articles/quick-introduction-to-luabind

      This will show you how to "bind" your lua scripts to C++ code. There are other "binders" or wrappers out there, but I’ve used this one without any issues so it gets my vote. Note the fact that LuaBind uses Boost, which increases the build time a bit.

      Anyway, as for usage, I tend to use Lua for state machine behaviours, so in my C++ code, where the game, a bot, a menu or whatever changes from one state (patrolling) to another (shooting) C++ changes state, but the contents of the Lua script associated with that state gets executed. Essentially, your decoupling your behaviour from your object’s state.

      There’s plenty of arguments about whether this is the correct approach or not. Arguments in favour of farming out the "game play behaviour" to essentially a text file are that it is easier to edit, debug (sort of) and tweek by game designers and level editors.

      Arguments against would be that hitting the Lua VM is slower than C++ code and therefore a bit of a bottleneck. fair point. IMO its all about balance and pro’s and con’s. No hard and fast rules.

      I’ve also heard people propose to have a Lua VM running on a per-core basis, to see if that improves performance. E.g. have a core/SPU (whatever) run your physics, and have a Lua VM up and running on that core running physics-related Lua scripts. I’m pretty sure this is possible, but as for it being optimal or not, I have no idea. I do know that Lua supports threads (Coroutines: http://lua-users.org/wiki/CoroutinesTutorial) and I think its intended to use the VM in that manner.

      Anyway, I hope this gets people started and clarifies some of the points I made in PM’s.

      Again, Lua’s been ported to just about every platform, so once you know the syntax, you could for example get a "Guess My Number" or "Hangman" game up and running in minutes on the

      PSP: http://en.wikipedia.org/wiki/Lua_Player
      DS: http://microlua.risike.com/
      Wii: http://code.google.com/p/luaplayerwii/

      and so on.

      Right, that should do it for now.


    • #44401

      It’s interesting to see so many Irish coders using Lua – I had to learn Lua for making those 2 iPhone apps, as that’s the scripting language that Shiva uses ( http://www.stonetrip.com ).

      I’m now evaluating Unity 3D to test speed differences / workflow etc relating to iPhone development. Shiva is very powerful, but it’s always worth checking out alternative technologies etc.


    • #44404

      I’ve heard that Decoda works well. PC, XBox360 & PS3 only though. We’re using a lot of LUA code for games development on iPhone – it’s a great language.

      Anyone know of good tools for debugging LUA on iPhone?

    • #44405

      Ya we use lua for scripting and our reflection system.

    • #44409

      Yup Lua here too, mainly for mission scripting. We wrote our own debugger though.

    • #44411

      Yup Lua here too, mainly for mission scripting. We wrote our own debugger though.[/quote:706c9d3efc]

      Makes sense the ones on the web are bs to be honest for commerical products.

    • #44572

      I was on my way to check out the new version of LuaEdit out (2010) here: http://luaforge.net/frs/?group_id=84&release_id=1463

      And also the latest version of Decoda, from here: http://www.unknownworlds.com/decoda/consoles/

      Just noticed that its the gang at Kore.net who supply the PS3/360 versions of Decoda. Cool.

      Any locals involved?


    • #46935

      I’ve just written a lua debugger : GRLD.

      It has a graphical interface, and can work remotely through a network connection. Source code is available, and it’s free of charge for non-commercial use.

    • #46958

      cool. look forward to checking it out.

Viewing 11 reply threads
  • The forum ‘Programming’ is closed to new topics and replies.