Josh Posted May 6, 2011 Share Posted May 6, 2011 I thought some of the Lua enthusiasts might want to play with this. When you run "Debugger.exe" it will launch "LE3.exe", which will load and run the "test.lua" program. The program will stop on a call to DebugStop() or RuntimeError() and display the entire contents of the program in the debugger. The programs connect on port 1234, so make sure they aren't blocked from communicating. You can modify the lua code and run it again to see the results. It's pretty interesting to see what all the built-in tables for the different lua libraries look like. luadebugger.rar Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted May 7, 2011 Share Posted May 7, 2011 Any chance you'll be allowing us to step through Lua code? Quote Link to comment Share on other sites More sharing options...
Josh Posted May 7, 2011 Author Share Posted May 7, 2011 I don't know if there is any way to do that. Can you make Lua call a function for every line of code it executes? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted May 7, 2011 Author Share Posted May 7, 2011 It looks like this might do it: http://pgl.yoyo.org/luai/i/lua_sethook Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted May 7, 2011 Share Posted May 7, 2011 That would be amazing to have that. I step through code all the time with VS. Stepping through code is almost a must these days it seems. Quote Link to comment Share on other sites More sharing options...
Josh Posted May 7, 2011 Author Share Posted May 7, 2011 Well, I think it will work. I love Lua because you can use it without installing any third party compilers and SDKs. It would nice to have the tools good enough that it feels like a lightweight version of VS. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted May 7, 2011 Author Share Posted May 7, 2011 I've got it stepping through code now. I had to run the debugger in a separate thread from the GUI script program, so it will continually update and keep the network connection alive. It was kind of difficult, but it seems to work well. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted May 7, 2011 Share Posted May 7, 2011 Exciting. Is that in an update we can test? Would love to see this in action. Quote Link to comment Share on other sites More sharing options...
EdzUp(GD) Posted May 7, 2011 Share Posted May 7, 2011 excellent stuff Quote Link to comment Share on other sites More sharing options...
Josh Posted May 7, 2011 Author Share Posted May 7, 2011 It's not ready yet. You have to open a file and do things in a certain order, or it will crash. Just due to unfinished parts. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted May 8, 2011 Author Share Posted May 8, 2011 Awesome, I can make it step a line of code, step in to the next function call, or step out to when the function returns. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted May 8, 2011 Share Posted May 8, 2011 Very exciting. Do you think that you would be able to actually see the result in the editor once it's all put together? Quote Link to comment Share on other sites More sharing options...
Josh Posted May 8, 2011 Author Share Posted May 8, 2011 What do you mean? This is what it looks like right now: Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted May 8, 2011 Share Posted May 8, 2011 Sorry, I meant the level editor. Assuming lua is working sort of the same as it does now, when you run the game it executes lua scripts. If we could place break points and step through the main lua script and the attached scripts that we can do in LE3 and see that result in the level editor that would be cool. Quote Link to comment Share on other sites More sharing options...
Josh Posted May 8, 2011 Author Share Posted May 8, 2011 I'm planning to make the editor launch an external process. The whole editing a live script session thing doesn't work out very well in rl. It'll still be seamless but I think the needs to be a division between the editor and the live game. Besides, this allows c++ programs and lua programs to be run with the same method, so there isn't a branch in the user experience depending on language. The level editor will have options to run and publish games, with a much better defined workflow. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Canardia Posted May 8, 2011 Share Posted May 8, 2011 The Editor should not load a static map with all assets at once, but from a sqlite database only the models which are in range (visual range + some custom additional range to prevent view popping). If it loads a static sbx, we have the same problem as today: how can we save gamestates without loading the whole map first and then moving/removing what is not there anymore? Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Josh Posted May 8, 2011 Author Share Posted May 8, 2011 It appears the BlitzMax multithread GC is badly slowing down the syntax highlighting. I also noticed the debug output update was slow when stepping, but thought it was due to the C++ program retrieving the Lua stack. I'm going to try building a single-threaded version of the script editor and see how different the speed is. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Canardia Posted May 8, 2011 Share Posted May 8, 2011 Just get rid of BlitzMax finally, it's kinda dead since Monkey replaced it Editor can be easily written with the engine itself. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Rick Posted May 9, 2011 Share Posted May 9, 2011 You're delusional Lum! Quote Link to comment Share on other sites More sharing options...
Josh Posted May 9, 2011 Author Share Posted May 9, 2011 Whoops, that was my fault. The syntax highlighter had some bad code that was updating every line each time a character was pressed. Looks like it will be my first BMX multithreaded app. Nice to make use of that. It was always too slow for any intensive applications. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AggrorJorn Posted May 18, 2011 Share Posted May 18, 2011 excellent news this. Lua without a decent debugger was quite painfull sometimes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.