Intuitive Debugger: allow script changes to be interpreted DURING debugging

As a Roblox developer, it is currently impossible for a change made to the script to be interpreted IMMEDIATELY by the debugger, while running the game.

Currently, even if I make changes to the script, these will only be interpreted after stopping the game and running it again.

Many times, while debugging, we find ourselves in situations where we have to SIMULATE different scenarios:

  1. Manually change variable values and try them in the following lines of debugging;
  2. Skip some lines so that they are not executed;
  3. Change the instructions on a few lines to test the result.

If Roblox is able to address this issue, it would improve my development experience because currently, on longer debugging, if I spot any issues in the code, I am required to:

  1. Stop everything
  2. Open the script editor
  3. Go to the line where I identified the problem
  4. Make the change “blindly” (since I no longer have access to the values of the variables within the Watch window)
  5. Readjust the breakpoints
  6. Run the game again
  7. Go through all the steps again until you reach the required point
  8. Hope the change you made works
  9. If it doesn’t work, repeat the whole process until it does…
4 Likes

This isn’t possible with the current execution model that Luau uses. When a thread is spawned and running, its running off compiled bytecode that would be very dangerous to change mid-execution.

You cant even do this with more featured IDEs like Visual Studio, because again, you cant really change compiled source code mid-execution safely or reliably

1 Like

I thought so too, but before opening this request, I consulted @IcyTides and apparently this is possible in the current environment.

I wonder how this is accomplished then, my only guess is it recompiles the script (same thing that happens when you disable and re-enable a script)

My main question is preserving stack and thread info, but I guess I’m not the Luau engineer here

So, basically something like hot-reloading? I wanted this feature for a long time, and if it is possible then I’m all for it. This would be extremely helpful when dealing with UI created through libraries like Roact and Fusion, because when you want to make a very minor change to the UI in the code, you have to re-join the game every single time to see the result, which ends up wasting a lot of developer’s time that could’ve been used to progress with the development.

1 Like

Hmmmm. This would be cool but it sounds like a hacky thing to do. Tedious as it is, if you’re just wanting to catch and debug runtime errors then it would probably be best to reload the game each time.

A feature like this would be fairly hardware intensive.

A cousin alternative would be running individual scripts to allow for precise script debugging but that’s just an idea.