-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SC Lua debugger #3938
SC Lua debugger #3938
Conversation
Very exciting 😄 ! |
This is really cool! I wonder if we could eventually debug via vscode. I'll have to take a look at this once it's merged in and see what we can do. |
I've been thinking about whether we should make this available on other game types too, such as FAF and FAF Develop. The pull requests limits it to a development environment. Is there a specific reason for that? |
Was not sure about that. But yea, why not. It's only matter of adding the mount command to inits. |
Can you enable the debugger in a multiplayer game, slowing down the game by introducing a breakpoint? |
It is not that simple I think - the |
When I was fixing this debugger in 2020, I seem to no need to mount |
Oh yea, forgot that this dir does not exist in the Steam version of the game...
This step was the first I tried, but no, it won't work that way. |
Of course, you can enable Log during game, debugger, set breakpoints... when client is windowed, you can freeze game by invoking window menu (minimize, maximize, etc.), press alt + space, use traffic shaping.... etc |
I think it should only work in FAF Develop. |
I wrote it wrong - all the actions described above can be performed independently of the debugger is opened or not (except breakpoints). And the debugger is already there, invoked by ie. a hotkey. Unless we are able to deliberately disable it (via exe patch) it can't be isolated just for FAF Develop |
The debugger is in the game, but without the icons it is near impossible to use. I agree with KionX - we should not mount* these files in the regular branch. |
In my opinion, the debugger is harmless without breakpoints. |
Not sure I really see a use case for having the debugger for non dev environment. Like is this so you could debug a bug that came up while one of us is playing some random game? or something else? Only a dev is really going to know how to use it anyway. I guess it would be nice for mod makers so they don't have to have a dev environment setup but they can still debug their code? |
That would be the only use case, yes. |
Is it possible to debug replays from release? |
This is still not an accurate description of the situation - you can set breakpoints, even if you don't see them in the GUI. |
Yeah. But it's still better not to help do it. |
And is a good one I'd say - we can have better and more stable mods thanks to debugger |
If there is anyone, who wants to harm the game to the others, there is nothing we can do to prevent that, he will always find the way. Its all about his bad motivation. Packet alteration, native debugger, you name it. This debugger is there already. As I said, without patching exe it can't disabled. GPG put it there and its been there since 2014. I'd no worry about it. Really |
Offtopic |
@Garanas could you please delete this? I no longer wish this PR to be merged. |
After discussing it in private - at no point should the debugger become inaccessible to prevent abuse. It is has been in the game for years and that has worked out just fine. It is simply put too valuable to make inaccessible. @Ejsstiil can you cull out the introduced files that are not used by the debugger? Once that is done, I'll happily merge this in. |
Introduces a fix to the Lua debugger that allows you to use it if you have setup your development environment. Allows for extensive debugging, including being able to see the stacktrace, locals and globals at any point of execution.
This PR re-introduces the in-game Lua debugger!
Even when this feature was always in the game, it was broken due to the missing graphics,
like buton icons, but most importantly - missing breakpoint markers. This lead to the never-ending
spam of error message due that fact and even when you managed to dismiss all that spam, the breakpoint markers were still invisible to the user. And error spam often start occurring again.
Other than that, the default position and dimensions of the Debugger window was squeezed to its minimum,
and all internal elements had sizes close to zero.
Fixed:
init_dev.lua
To invoke the Lua debugger, you can use:
Controls:
Tips: