Repository navigation
Engine, rendering, physics and CoreScripts fixes; game-client replication behind a session-kind gate - #35
Open
cl1ents wants to merge 35 commits into
Open
Engine, rendering, physics and CoreScripts fixes; game-client replication behind a session-kind gate#35cl1ents wants to merge 35 commits into
cl1ents wants to merge 35 commits into
Conversation
- 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.
…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.
…tyle step that scales
- Styles: selector tags with '-', pseudo-instance selectors ('::UIListLayout' and friends) making one modifier per element, rule data held strongly, equal priorities in sheet order: the settings menu's Leave / Respawn / Resume row draws and Resume closes the menu.
- Style matching skips scripts' subtrees and reruns only when the tree, tags, hover/press, rules or view change (every 2 s otherwise); sweeps twice a second. Control place with CoreScripts: input_step_client 1.59 -> 0.25 ms/frame, a 322 ms gui_input spike gone.
- AutomaticSize XY frames relayout at their settled width (ExpChat's translation notice 300x400 -> its text height).
- TextService:GetTextSize / GetTextBoundsAsync measure with rustudio's text layout; GetTextSizeOffsetAsync 0 (Medium, estimate).
- rbxthumb:// served from the thumbnails API (the People tab's headshot).
- Lua signals run handlers at their connector's identity.
- A CoreScript's BindCoreAction handler (the menu's RBXEscapeMainMenu) ran at the input thread's identity and failed reading GuiService.SelectedCoreObject, so Escape never opened the menu - bind records the binder's identity; run_actions calls each handler on a thread at that identity (a yielding handler sinks, estimate) - Test: bound_action_runs_at_its_binders_identity
…, thin outlines, menu buttons in front, one-line chat input - Styles leave alone what an instance set itself (Roblox styling guide, 'Modified properties'): Foundation icons keep their Builder Icons FontFace and TextSize, so microphone / arrow-medium-up draw as glyphs. - RobloxGui is ZIndexBehavior Sibling: the settings menu's Leave / Respawn / Resume row and the Help grid draw over the menu background. - Default chat PrefixText is <font color="#…">DisplayName:</font> (team colour, else computeNameColor); rustudio's own chat strips the tags. - RobloxEmoji's COLR glyphs (the verified badge U+E000) draw as their coloured layers (gui_color_glyphs.rs). - Text outlines fade with a rich run's transparency (ExpChat's invisible name copy) and share the stroke alpha across copies (mech GUI_TEXT_STROKE_OVERLAP, estimate). - Flex-grown row items that grow on Y are measured at their new width: the chat input stays one line while typing. - Rich text attributes allow spaces around '='; out-of-walk measurement applies icon ligatures. - Headless dev runs: offscreen clears applied texture deltas (epaint debug assert panicked on frame 1).
…eruns per StyleLink from the journal - Style rules match over one native read of each styled tree (gui_input.rs style_tree: instance, parent, ClassName, Name, tags) with IsA kept per class and only the elements holding a selector's first tag tried; sheets compile once per rerun, rule values resolve once per rule. - Matching reruns only for StyleLinks whose tree the DataModel journal shows changed (new doc::Reader::Styles; elements added/moved/removed, Name/Tags/Interactable writes), for all links on sheet/rule/query/view changes and hover/press/focus when a rule has a :state; no 2 s timer, no rerun for changes outside styled trees. TAG_REVISION (its only user) removed. - Place1 + CoreScripts, settings menu open (debug, CPU clock): a rerun 150-250 ms -> 8-20 ms; input_step_client 2.99 -> 0.38 ms/frame (menu), 4.88 -> 0.36 (chat typing), 1.63 -> 0.38 (idle).
…ets FontFace - AutomaticSize X objects measure their children with the room they can grow into: the Help tab's 'W/Up arrow' column wrapped a letter per line. - TextFits before the first layout measures TextBounds against the box: SettingsHub's version footer no longer turns TextScaled on and draws over itself. - Setting Font on a text object sets FontFace = Font.fromEnum(Font); Font.fromEnum maps like Roblox (BuilderSansMedium -> BuilderSans Medium, Gotham -> GothamSSm, Legacy -> LegacyArial). Settings rows drew in LegacyArial at 1.5x.
…nce's - A class neither the reflection database nor the API dump lists (PlaceSettings) had no IsA, FindFirstChild, …; the GUI step's IsA on it failed every frame - Every class is an Instance [Roblox docs: Instance]: an unknown class routes as Instance
- A Message in the Workspace or the LocalPlayer's PlayerGui with Text covers the view in (0.5, 0.5, 0.5, 0.5) with its text centred, Legacy 14, white, black stroke; a Hint draws a 20 px black bar at the top with its text (Studio 0.747 Message::renderFullScreen / Hint::render2d). - Kept from the document journal (Reader::LegacyMessages), drawn under the game's GUIs.
…ebuilt whole - register_collider puts a new collider into the broad phase's query tree immediately (Studio 0.747 ContactManager::onAssemblyAdded binds a new assembly at once; the floor rays in ControllerPartSensor::findFloorRaycast query it the same frame). Before, a regen's fresh ground was invisible to the Humanoid's floor rays for a frame and the character fell (studio solver). - build() stops its weld walk at anchored / external parts that are already fixed: place 2828's map is one 1603-part weld web, and a model welded to it rebuilt all of it. - pb_parts bench counter; tests part_added_under_a_standing_humanoid_holds_it_at_once, welding_to_an_anchored_web_rebuilds_only_its_edge; ENGINE-GAPS: Message/Hint done, MakeJoints no-op.
- scene.rs: a part's CFrame re-reads only motion dependants (Bones, fitted garments); R15 atlas siblings no longer redo every clothed body part per frame. Physics/replication props (NetworkIsSleeping, Velocity, CanCollide, ...) re-read nothing. Test: a_moving_body_part_leaves_its_siblings_alone. - asset_work.rs: shared asset worker pool + ticketed Jobs. MeshCache parses meshes and clothing meshes on workers with an upload budget (mech MESH_UPLOAD_BUDGET_*); TextureCache decodes every texture on workers and makes clothing / SurfaceAppearance composites there (CPU, stale slot shown while remade; only composites whose inputs re-downloaded are redone instead of all of them on any download); skin bases parse on workers (Studio's TextureManager2 / MeshManager2 do this on TaskScheduler::submitAsyncTask tasks). - skin.rs: has_bones indexes per part/model instead of walking the whole document on every rig change (10 ms per arriving dynamic head). - render.rs: moving shadow casters culled to each sun cascade's caster box.
…ive LocalPlayer and prune sweeps; gi_* step sections - GuiService:GetClosestDialogToPosition walked the Workspace with GetDescendants + IsA every call; MainBotChatScript2 (started unconditionally by StarterScript) asks every Heartbeat: milliseconds a frame in a large Workspace. Now the Workspace's Dialogs come from DialogIndex, kept from the document journal (doc::Reader::Dialogs). - gui_input local_player() reads Players.LocalPlayer natively (svc + pcall cost ~1 ms a step). - prune drops destroyed keys natively (drop_gone) instead of a pcall closure per key. - input_step_client split into bench sections gi_<phase>. - Test: closest_dialog_follows_added_and_destroyed_dialogs.
…ache, non-UTF-8 strings - Server chat step tracks TextSources by UserId, never touching a Player the host removed from the tree (attempt to use an Instance that no longer exists, every frame). - AvatarChatService answers a client without voice; GetEngineFeature(AvatarChatServiceEnabled) is true (CoreVoiceManager:680); VideoCaptureService:GetCameraDevices is empty. - AvatarEditorService:BustAvatarFetchCache makes the host fetch the avatar again for the next character. - String properties, Name, attributes and string arguments take any Lua bytes (non-UTF-8 bytes left out). - Tests for each.
…racter parts join the body - Physics::reconcile (a sync that marks everything) starts the Studio solver, the characters' handle-keyed state and the client link over with the new rapier world. A character body built first in the new world took the old world's first loose part's one-part mass record and was integrated at the wrong mass under a Humanoid force sized for its own. - ensure_hum_body takes every part of the character out of the loose simulation and redoes the rig's attached parts when the model changes. A part added to the character after its body was built (an AvatarSettings CollisionPart: Massless, colliding, welded to the root) stayed a fixed collider that the body's own copy of it pressed on, so the standing character slid 10+ studs along its facing. - Test: character_in_a_rebuilt_world_stands_still (an R15-like rig with Massless limbs, a heavy root and accessory Handles joined after the body was built).
- Shutdown (LocalUserSecurity, api-dump.json) sets World.shutdown_requested; the play step stops Play as the native menu's Leave does - Test: menu_leave_shutdown_asks_the_host_to_end_play (game identity refused, CoreScript allowed)
…ploads made off the main thread - render_thread.rs: Roblox's renderPrepare/renderPerform split (RenderView 0x1051eb0fc / 0x1051ef2ca): main records, rustudio-render finishes and submits in order; egui's paint (egui-wgpu prewarm hook), offscreen paint, read-backs and the next frame join it. RUSTUDIO_RENDER_THREAD=0 performs inline. - render() no longer encodes the post chain: world GUIs/effects record into the frame's post encoder and finish_frame draws bloom/blur/DoF/post once (finish_again's second post chain is gone); scene and post go out in one submit. - Light grid: the job writes GPU-ready bytes into a mapped staging buffer (lightgrid_gpu.rs); main only records copies (lt_grid_apply up to 17 ms -> ~0). A turned sun reuses the kept build (sun channel swept again) and the build takes the quantised sun, so a moving clock no longer forces 97 ms from-scratch builds. - Raycast query sync reads the journal in place (Document::reader_pos/mark_read) instead of copying the marks. - PROFILING.md: the render thread and its bench sections.
…h the server's - Compared in place before reading both parts' signatures (part_sig); a replicated server move needs nothing.
- epaint's glyph cache asserts on a 0 px scale factor (a debug-build crash in gui_walk layout) - layout and probe clamp each section's size to GUI_MIN_FONT_SIZE 0.01 (estimate: Roblox draws nothing); MECHANICS.md row
- The field is IncludeOffSale (create.roblox.com CatalogSearchParams), not IncludeOffSaleItems: a shop setting params.IncludeOffSale errored
…for draws, clip loads and the input-pose join - Joint graph: when joints are only added (a welded map streaming in), assemblies merge in place: the largest keeps its member order, new parts are keyed and slotted in; each part remembers the joint its order key came from. bfs_key memoizes a parent's child positions (was a scan of thousands of siblings per joint). Test welded map of 3000: joint_graph_update 3.8 s -> 0.3 s; seeded edit mix equals a full build every step. - Pose walk on entering Workspace skips unchanged leaf parts of unedited joints (was a walk of the whole assembly per weld). - Animation assets decode on the asset workers (__rs_anim_asset returns nil, true meanwhile); an Animator step parses new clips for at most ANIM_LOAD_BUDGET_MS, other tracks load next step (Roblox: Length 0 until loaded). - Viewport resolves changed parts' draws for at most DRAW_SYNC_BUDGET_MS a frame (full rebuilds and --fixed-dt unbudgeted). - play_worker: the input-pose join waits at most PLAY_INPUT_POSE_WAIT_MS, else the last frame shows. - No per-frame gpu_timing render-thread job when GPU timing is off. - Bench sub-sections (jg_*, sp_*, sd_*, anim_*), RUSTUDIO_LOAD_TRACE slow replication ops.
…d before exit - egui-wgpu's InstanceFlags::from_build_config turned on the Khronos validation layer in every debug-assertions build: every GPU call checked on the render thread - At exit the layer tore the device down while the render thread freed a buffer: SIGSEGV after a session ended (coredump stack) - Flags are now empty().with_env() (WGPU_VALIDATION=1 still enables); run_with waits for the render thread before exiting
…or passes - Physics: at most 12 world steps a frame, 4 while the throttle steps <=40% of frames, carry <= 3.99999 steps (Studio 0.746 World::updateStepsRequiredForCyclicExecutive, DFInt::MaxMissedWorldStepsRemembered; roblox-rs DESIGN.md for 0.255). - Replicated subtrees entering the client's Workspace are posed against the parts already there (EnterPose::Replicated): a welded map's arrival walked every part already there for each piece. - Instance collector passes stop after GC_PASS_MS (4 ms, estimate) per side and continue next frame. - Bench counters: ph_ticks, jp_walked, jg_removed, sj_*, pfc_*. - Tests: replicate chained_welded_map_poses_only_the_arriving_pieces, arriving_weld_poses_against_the_clients_part; throttle heavy_throttle_caps_a_frame_at_four_steps; physics_hitch_keeps_at_most_four_steps_of_debt.
…running every frame - A pass cut at GC_PASS_MS was rerun each frame (p9_collect every step). Passes keep GC_INTERVAL; each starts at the last one's stopping point (World::gc_cursor), so held templates no longer take every pass.
- client_flags: 'published client fast flags' (Roblox's public PCDesktopClient settings); the place filter test uses neutral place ids - GUI_TEXT_STROKE_OVERLAP and the MECHANICS text row cite screenshots of the Roblox client's chat
…e unchanged
- replicator::SessionKind { CloudEdit, GameClient }: Decoder::new() stays CloudEdit (Team Create), Decoder::game_client() is a player's session with a game server; the Decoder stamps its kind on the Schema it reads and the writer encodes by the schema's kind. Every Team Create call site keeps CloudEdit and writes and reads the same bytes as before.
- GameClient only: SET_GLOBALS is seven flags then the namespace (Studio 0.746 ClientReplicator::processPacketV2, 0x81: readBool x7, deserializeUnsignedVarint -> World::setLocalPeerId); container enums keep the enum their u16 index names (PropValue::EnumItem) and write the index back; CoordinateFrameCompressed (0x1b) / OptionalCoordinateFrameCompressed (0x33) are written; NewObject's first group holds getPropertyGroup's types (Studio 0.746); ChangeAttribute has no attribute version byte (Studio 0.748 ClientReplicator::readAttributeVersionInfo 0x106711410 reads it only under isCloudEdit()); NewObject ContentIds are prefixed (estimate).
- Ungated: model.rs maps EnumItem like Enum (only a game client decode makes one); a data message's decode error names the item kind, offset and first bytes (message text only).
- Tests: each gated behaviour decodes / encodes the old bytes under CloudEdit and the new ones under GameClient.
- local_place_content_is_not_loaded_while_scripts_run asked TextureCache::image once; since images decode on the asset workers (all sizes), the first ask returns None. The test asks again until the decode is in, then checks Play refuses the cached local file as before.
cl1ents
marked this pull request as ready for review
November 22, 2026 23:00
TouseefX
added a commit
to TouseefX/rustudio-android
that referenced
this pull request
Nov 23, 2026
|
Rippiz made his own one I don't think it's needed anymore |
Contributor
Author
afaik there's a few fixes in here that might be interesting but i'll wait on rip to close the PR lol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Engine, rendering, physics and CoreScripts fixes from playtesting places with Roblox's own CoreScripts running. Game-client replication fixes are included behind a session-kind gate, so Team Create's wire bytes don't change.
CoreScripts
bound_action_runs_at_its_binders_identity).DataModel:Shutdown(LocalUserSecurity, api-dump.json) ends the session. This is the CoreScripts menu's Leave. Test included.AvatarChatServiceEnabledis on (CoreVoiceManager:680).BustAvatarFetchCacherefetches the avatar.GUI
Message::renderFullScreen/Hint::render2d, with constants read from the binary.GUI_MIN_FONT_SIZE(estimate). epaint asserts on a 0 px scale.GetClosestDialogToPositionreads a journal-kept Dialog index.LocalPlayeris read natively. Newgi_*bench sections.Rendering and threading
RenderView::renderPrepare/renderPerform.TextureManager2/MeshManager2useTaskScheduler::submitAsyncTask.WGPU_VALIDATION=1still enables it). The render thread is drained before exit.Physics
World::updateStepsRequiredForCyclicExecutive(DFInt::MaxMissedWorldStepsRemembered): at most 12 steps, 4 when throttled to 40 % or less, and at most 3.99999 steps of time carried over.ContactManager::onAssemblyAdded,ControllerPartSensor::findFloorRaycast).reconcileresets the solver's handle-keyed records, and parts added to a character late join its body.follow_clientskips a client copy whose CFrame and Size match the server's.Engine API
CatalogSearchParams.IncludeOffSale(create.roblox.com).Replication (game client sessions, gated)
replicator::SessionKind { CloudEdit, GameClient }. Team Create stays on CloudEdit, and its wire bytes are unchanged.ClientReplicator::processPacketV2,0x81).readAttributeVersionInfo0x106711410,isCloudEdit()).0x1b/0x33compressed CFrames are written.getPropertyGroup(Studio 0.746).Docs
MECHANICS.md, ENGINE-GAPS.md, PROFILING.md (render thread) and TEAMCREATE.md (the session-kind wire differences).
Tests
script_profiler::tests::heap_is_polled_per_scriptfails only in the full parallel run; it passes on its own, on main too.