Skip to content

Play: run Roblox's CoreScripts from Studio's data model patch (opt-in, draft) - #34

Closed
cl1ents wants to merge 9 commits into
rippelz:mainfrom
cl1ents:corescripts-1
Closed

cl1ents wants to merge 9 commits into
rippelz:mainfrom
cl1ents:corescripts-1

Conversation

@cl1ents

@cl1ents cl1ents commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Draft. When opted in, Play runs Roblox's real CoreScripts and CorePackages, taken from Studio's own data model patch. rustudio's native game menu and chat stay the default.

What works now

Tested on a TextChatService copy of the control place, with RUSTUDIO_CORE_SCRIPTS=1 and all of Roblox's live client flags loaded (25,850; no overrides). Screenshots were taken headless at 1280x720.

  • Startup is clean. StarterScript and every CoreScript start with no errors in Output. The only warning left is the TextService:GetTextSizeOffsetAsync stub.
  • The top bar draws. About 8 s into Play, today's "Chrome" top bar appears at the top left: the Roblox logo, the menu button and the chat button.
  • The chat window and the newer player list draw. ExpChat's chat window shows its translation notice and its "To chat click here or press Slash key" input bar. The newer player list, with its close button, shows at the top right.
  • The menu button works. Clicking it opens Chrome's menu: Switch avatar, Music, Report, Leaderboard, Emotes, Inventory and Respawn.
  • The chat works. Clicking the input bar, typing hello and pressing Enter shows Roblox_User_777: hello in the chat window.
  • The Roblox logo opens Roblox's settings menu. It has the People, Settings, Report and Help tabs, and the People tab lists the local player.
  • rustudio's own UI stays out of the way. Its native menu, chat, bubbles, hotbar and emote wheel are hidden while the opt-in is on, and Escape and the number keys go to the game.

With the flags at the CoreScripts' defaults instead (no cached copy and offline), the older top-bar variant draws.

Live client flags (client_flags.rs):

  • Fetched from Roblox's public PCDesktopClient settings only when the opt-in is on, kept for 24 h, and loaded from the kept copy when offline.
  • An override file is supported.
  • GetFast*, DefineFast* and settings() flag reads use the live values. Lookups also try the D-prefixed name and honour _PlaceFilter entries.
  • GetEngineFeature stays false, because no public source for engine features was found.

How it works

Added since the previous update:

  • AudioFocusService, SessionService and ExperienceService.

  • Player.ChatAvailabilityStatus, which ExpChat's isUserChatEnabled reads.

  • TelemetryService, as stubs.

  • LinkingService and HttpService:GetUserAgent.

  • Translator:RobloxOnlyTranslate.

  • GuiService:GetClosestDialogToPosition and GetClosestVisibleDialogToPosition.

  • GuiObject:Tween*Internal.

  • SetCore / GetCore handlers run at the identity of the script that registered them. A game LocalScript's SetCore therefore reaches a CoreScript's handler with the CoreScript's capabilities.

  • RunService:BindToRenderStep callbacks run at the identity of the script that bound them.

  • GuiState no longer errors on a focused TextBox. API dump 0.744 has no Focus item.

  • Loading the patch. crates/rustudio-core/src/core_scripts.rs reads ExtraContent/models/DataModelPatch/DataModelPatch.rbxm. The CDN package extracontent-models.zip contains this file too.

    • The scripts' sources are a binary property type that rbx_binary skips (0x1d). They hold Luau bytecode version 9, which the vendored Luau 0.745 loads unchanged.
  • Placement in the client DataModel:

    • CorePackages gets its Packages and Workspace.
    • CoreGui.RobloxGui, a ScreenGui, gets Modules.
    • The CoreScriptLocalization tables go under CoreGui.
    • StarterScript runs under CoreGui at identity 4, with chunk name =StarterScript.
    • ScriptContext:AddCoreScriptLocal starts CoreScripts/<Name> scripts.
  • Engine members added. All are in the API dump. Where a Play session has no backend, the member is a stub, and the code says so.

    • DataModel fast flags, and settings() flags read by CoreScripts.
    • GuiService:
      • SetTopbarInset / TopbarInset
      • SetMenuIsOpen, which drives MenuIsOpen, MenuOpened and MenuClosed
      • the scale, safe-zone and error getters
      • center dialogs and keys
      • GetNotificationTypeList
    • StarterGui:RegisterSetCore / RegisterGetCore, which SetCore / GetCore now call.
    • ContextActionService core actions, which run ahead of game actions.
    • Services the CoreScripts use internally:
      • MessageBusService
      • MemStorageService
      • LocalStorageService / AppStorageService
      • IXPService: every layer reports loaded, with no variables.
      • HttpService:RequestInternal: requests to roblox.com APIs go through rustudio's login session.
    • Members the CoreScripts read on these classes: RunService, UserInputService, Player, PlayerScripts, UserGameSettings, RenderSettings, VRService, AvatarChatService, ThirdPartyUserService.
    • Also:
      • HumanoidDescription.NumberEmotesLoaded
      • InsertService:LoadLocalAsset
      • UDim2:lerp
      • LocalizationTable:SetEntries with entries that have no Source
    • Stubs (no backend): analytics, ads, notifications, achievements and the capture gallery.
  • Rendering:

    • CoreGui ScreenGuis draw above PlayerGui, including ScreenGuis nested inside Folders.
    • Icon-font GSUB ligatures are supported (gui_ligatures.rs), so a name such as speech-bubble-align-center becomes its glyph.
    • rbxasset:// paths also resolve into Studio's ExtraContent.

What doesn't work yet (next blocker)

  • VoiceChatCore.CoreVoiceManager:680 indexes nil with GetClientFeaturesAsync. This shows in Output when the settings menu opens; voice isn't part of Play.
  • The top bar mounts about 8 s after Play starts, so a click earlier than that lands on nothing.
  • The rest is listed in docs/ENGINE-GAPS.md.

Evidence for the layout

  • The patch's own tree:
    • PatchRoot/{CoreScripts, DataModelInstances/{CoreGui/RobloxGui/Modules, CorePackages/{Packages, Workspace}}, PlayerScripts}
    • 4082 Folders, 47181 ModuleScripts, 2 LocalizationTables, 5 StringValues.
    • The entry scripts are ModuleScripts named StarterScript, LoadingScript, Connection, CoreScripts/<Name> and ServerCoreScripts/<Name>.
  • Studio's text StarterScript.lua (ExtraContent/scripts/CoreScripts):
    • It waits for CoreGui.RobloxGui and then RobloxGui.Modules.
    • It calls AddCoreScriptLocal("CoreScripts/...", RobloxGui), and passes script.Parent as the parent for several other CoreScripts.
    • It requires modules from CorePackages.Packages.… and CorePackages.Workspace.Packages.….
    • CoreScripts read RobloxGui.AbsoluteSize, so RobloxGui is a ScreenGui.
  • Error reports from real clients (https://devforum.roblox.com/t/2659679 and https://devforum.roblox.com/t/2584693):
    • Scripts appear under the names CoreGui.RobloxGui.Modules.…, CoreGui.RobloxGui.CoreScripts/<Name>, CorePackages.Packages._Index.… and CorePackages.Workspace.Packages._Workspace.….
    • The engine's own scripts appear under bare names: Script 'StarterScript', 'LoadingScript', 'Connection'.
    • One error reads CoreScriptLocalization is not a valid member of CoreGui.

How to try it

RUSTUDIO_CORE_SCRIPTS=1 rustudio place.rbxl --play-only --headless --window 1280x720 \
  --shots 10 --screenshot shot.png --log out.txt

You can also turn it on in Studio Settings > rustudio > Play > "Roblox's CoreScripts (experimental)".

Tests

  • rustudio-core:
    • patch decoding and placement, on a synthetic patch;
    • the real Studio patch, skipped when no Studio install is present.
  • rustudio-engine:
    • The StarterScript path at identity 4. It covers fast flags, SetCore registration, MessageBusService, MemStorageService, UDim2:lerp, AddCoreScriptLocal and a CorePackages require.
    • Ligature substitution, plus Builder Icons' ligature table read from the Studio install.

@rippelz

rippelz commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Working on this RN!! thank you

- core_scripts.rs reads DataModelPatch.rbxm (ProtectedString bytecode sources), puts CorePackages and CoreGui.RobloxGui.Modules in the client DataModel and keeps PatchRoot.CoreScripts by name.
- StarterScript starts at the CoreScript identity; ScriptContext:AddCoreScriptLocal starts CoreScripts/<Name> under its parent.
- CoreScript-only members: DefineFast*/GetFast*/GetEngineFeature/SetFlagVersion/GetPlaySessionId, UserInputService:GetPlatform, GuiService:GetNotificationTypeList, MessageBusService, LocalStorageService.
- Opt-in: RUSTUDIO_CORE_SCRIPTS=1 or Studio Settings > rustudio > Play. First blocker (GuiService:GetResolutionScale) in docs/ENGINE-GAPS.md.
- Drop the quoted strings from Studio's executable; the patch's own tree, Studio's StarterScript.lua and the devforum error reports stay as the evidence.
…app services they call

- GuiService: SetTopbarInset/TopbarInset, SetMenuIsOpen behind MenuIsOpen/MenuOpened/MenuClosed, desktop scale and safe-zone answers, connection-error getters, center dialogs.
- StarterGui:RegisterSetCore/RegisterGetCore behind SetCore/GetCore, with Roblox's 'has not been registered' error once any is registered.
- ContextActionService core actions ahead of game actions; RunService/UserInputService/Player/RbxAnalyticsService/IXPService members; settings() flags for CoreScripts.
- LocalizationTable:SetEntries takes entries without Source (UIBlox's Translator).
- Play draws the client's CoreGui ScreenGuis above PlayerGui while CoreScripts are on.
@cl1ents

cl1ents commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

still a draft because I need to do some checks on my end

…odules load against

- MessageBus-style app services in Luau: MemStorageService, IXPService (no experiments: layers loaded, no variables), HttpService:RequestInternal through the login session for roblox.com APIs.
- Stubs with no backend in Play, noted as such: RbxAnalyticsService, EventIngestService, NotificationService, AdService, AchievementService, CaptureService gallery calls.
- Desktop answers: ThirdPartyUserService, VRService:IsVRAppBuild, AvatarChatService features, RunService version/focus members, UserInputService device type/level, RenderSettings:GetMaxQualityLevel, RunService.ClientGitHash.
- Player block list / friend status, PlayerScripts GetRegistered*Modes, HumanoidDescription.NumberEmotesLoaded, InsertService:LoadLocalAsset, UDim2:lerp, Animator:GetPlayingAnimationTracksCoreScript.
- UserGameSettings: the CoreScript-only settings at fresh-install values; settings() flags for CoreScripts (InGameGlobalGuiInset = the top bar height).
- API-dump callbacks (GuiService.SendCoreUiNotification) and unwired events connect for threads allowed to; CoreScripts may write properties rbx-dom marks read-only but the dump doesn't; their identity has PluginOrOpenCloud (RunService:IsEdit).
- StarterScript runs under CoreGui (it passes script.Parent to AddCoreScriptLocal).
…ligatures, ExtraContent assets)

- Play draws ScreenGuis the CoreScripts mount in CoreGui Folders (CoreGui.TopBarApp).
- Text in a face with GSUB ligatures (Builder Icons) has its icon names replaced by the ligature glyph's codepoint before layout (gui_ligatures.rs).
- rbxasset:// also resolves into Studio's ExtraContent (LuaPackages' icon font, models/ServerCoreScripts.rbxm).
- Tests: the StarterScript path at identity 4 (flags, SetCore registration, MessageBus, MemStorage, UDim2:lerp, AddCoreScriptLocal, CorePackages require); ligature substitution and Builder Icons' table.
- client_flags.rs: Roblox's public PCDesktopClient settings, fetched only with CoreScripts on, kept a day, offline falls back to the kept copy, then to the scripts' defaults; an override file for tests.
- GetFast*/DefineFast*/settings() flags read them (D-prefixed names, _PlaceFilter for the current place); engine features stay false (no public source).
- LinkingService (no deep links in Play), HttpService:GetUserAgent: reached by the live-flag paths.
- docs/ENGINE-GAPS.md: what closed, the live-flag first blockers.
…'s CoreScripts run

- Escape and the number keys go to the game then, for the CoreScripts' own menu and backpack.
… Player chat status (live-flag top bar draws)

- AudioFocusService: registered contexts and focus by priority; SessionService: the app's session tree, metadata and context focus; ExperienceService: in its experience, join/leave callbacks on real connections, no launches.
- Player.ChatAvailabilityStatus 'AllUsers' (ExpChat's isUserChatEnabled), OsPlatform / PlatformName / VRDevice / UnfilteredChat (estimates).
- With all live flags the Chrome top bar (logo, menu, chat) and ExpChat's window draw.
- SetCore / GetCore handlers run at their registrant's identity; RunService render-step binds at their binder's (a CoreScript bind keeps its capabilities).
- TelemetryService (stubs), Translator:RobloxOnlyTranslate, GuiService:GetClosest(Visible)DialogToPosition, GuiObject:Tween*Internal.
- GuiObject.GuiState no longer errors on a focused TextBox (API dump 0.744 has no Focus).
- With all live flags the Chrome top bar's menu button opens its menu, typed chat shows in ExpChat's window, and the Roblox logo opens the settings hub; docs/ENGINE-GAPS.md updated.
@cl1ents cl1ents closed this Nov 22, 2026
@cl1ents
cl1ents deleted the corescripts-1 branch November 22, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants