Hello everyone!
The issue
I am currently working on a project with a source code that isn’t mine, although it is very poorly documented and the execution flow is jumping from everywhere. Not mentionning the modules being loaded dynamically preventing types to be inferred correctly!
So I have thought of tracking values, like lists of players and their data associated with it and see what those values does by playtesting. And I told to myself “Why not create a debug library to track values in real time while playtesting and open-source it ?”, but is it needed, will it be useful ?
What I’m thinking of and what I have tried
Before, I have made a personal component/service framework that have a feature to spy the properties using Iris Library inspired by UnityExplorer. Even if it only supports Services/Components.
Currently, I’m thinking that the perfect API to use a hypothetical “Spy Module” could be used like this:
local counter = 0
task.spawn(function()
while task.wait(1) do
counter += 1
end
end)
-- First parameter is subcategory Script.foo that can be accessed in a folder-like structure
-- Second parameter is function that is called 30 times per second to update the value
-- Don't care really much about performance as it's meant for debugging purposes, should be easy to disable with an attribute
local unsubscribe = spy({script.Name, "counter"}, function() return counter end)
-- Stop spying that value, useful for values in scopes
-- and tracking how much threads a script currently has
task.delay(10, function()
unsubscribe()
end)
Why not using X ?
The Roblox’s spy works only when the game is paused via the debugger, and it wouldn’t be very efficient to track multiples values being changed rapidly over seconds or minutes of gameplay.
Constantly printing the values would quickly clog the output and lag Roblox Studio, especially if the print is called thousand of times. Plus, once I have finished with it, I have to remove the line with the print.
Has anyone made an open-source value/table spying library that would fit the description ? WIll you be interested if I create one ?
- I am interested by a value spy library
- Nice to have, wouldn’t use it
- It is useless
- I already use one
- Wrong devforum category
0 voters