Here are a handful of bugs/unexpected behaviors that impair/frustrate me when I use Roblox Studio.
Undo recursively selects descendants of changed instances
First of all, undo can cause huge lag spikes because it recursively selects all of the descendants of the changed instances.
The lag is likely caused by the explorer unfolding, as well as core plugins that serialize the selection to a table using Selection:Get(), then iterate through the entire selection; You can find these plugins by enabling “Show Hidden Objects in Explorer” and selecting CSGDictionaryService
which throws an error:
There have been numerous bug reports and complaints related to this issue:
https://devforum.roblox.com/t/list-things-that-trigger-you-in-development/32594/77
First of all, core plugins should not get or iterate through the game’s selection until the developer activates the plugin; if the plugin’s behavior is often used by devs (like the UI editor), then it should at least be possible to disable the plugin. An additional Selection.Count
or Selection:Count()
API would solve this too, so plugins can instead ignore selections that are unreasonably large without initializing the table with Selection:Get()
.
This same attention to performance should be always be applied if plugins need to listen to events like DescendantAdded
and DescendantRemoving
on services; This can easily be done by only connecting to these events when needed, and only after the plugin is activated. Core plugins hopefully don’t do this in the first place.
Undo/redo will delete/recreate preview parts created by plugins
Undo currently deletes my non-Archivable parts that were created via plugin, which is very frustrating when I need to generate previews or visualizations based on other instances. Redo also tries to restore these non-Archivable parts that were deleted via plugin; I can circumvent this by calling :Destroy()
on the part, but redo will just spam the output instead:
This problem is magnified by the recursive-selection problem, where the lag can completely freeze studio in cases with thousands of parts.
Use cases affected by this problems
- Triangle terrain plugins will have their generated WedgeParts unexpectedly removed/recreated.
- Model instancing plugins will have thousands of parts selected when undoing which causes massive lag spikes. This lag can freeze studio resulting in lost work.
- Foliage editor plugins that display foliage animations will have the previews unexpectedly removed/recreated.
- Building plugins that create advanced visualizations using parts will have the visualization unexpectedly removed/recreated when undo/redoing.
My current use case
I’m currently developing a tree/foliage system that enables me to create extremely detailed models that are optimized using a per-branch LoD (level of detail) system. Studio freezes every time I use undo after previewing the full-LoD model. I often need to do this to compare changes I’ve made.
The final model won’t have nearly this many parts, but I need to know what the final model will look like before I go through the process of creating LoD’s. I’m developing this system to enable animal/pet interactivity for thousands of trees in my game Shard Seekers.
When I finally manage to deselect after a few minutes, studio will continue having lag spikes until I restart due to a LegacyLock
process:
These problems have caused me to seriously consider making my own studio tools with their own undo/redo system.