Decal Performance 2 - #5393
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesDecal chunk synchronization
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant DecalSystem
participant UpdatePlayer
participant SendChunkUpdates
participant DecalChunkUpdateEvent
participant ClientDecalSystem
DecalSystem->>UpdatePlayer: record decal deltas and select visible chunks
UpdatePlayer->>SendChunkUpdates: pass fullChunks and diffChunks
SendChunkUpdates->>DecalChunkUpdateEvent: serialize snapshots and chunk diffs
DecalChunkUpdateEvent->>ClientDecalSystem: deliver decal update event
ClientDecalSystem->>ClientDecalSystem: merge removals and upserted decals
Possibly related PRs
🚥 Pre-merge checks | ✅ 5 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Content.Client/Decals/DecalSystem.cs`:
- Around line 174-180: Update the removal loop in the diff merge path to invoke
OnDecalRemoved before removing the corresponding entry from chunk.Decals,
preserving the hook’s requirement that the decal still exists. Keep
gridComp.DecalIndex.Remove(removedId) after the hook and ensure each removal is
processed only when the decal is present.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: b954997a-5cd6-4ec1-94ea-558c9c2e6450
📒 Files selected for processing (3)
Content.Client/Decals/DecalSystem.csContent.Server/Decals/DecalSystem.csContent.Shared/Decals/DecalChunkUpdateEvent.cs
a4b625c
## Short description <!-- What do you propose to change with your PR? --> Decals were still lagging on creation due to them dirtying the whole chunk if anything was added, So I made them delta the changes and only sync the diff to clients unless they are only getting it for the first time they they get the whole chunk. ## Why we need to add this <!-- What is the reason for adding these changes? Please post links to Discussions as well as Bug Reports here. Please describe how this will change the game balance. --> Perf fix ## Media (Video/Screenshots) <!-- If your PR contains in-game changes you must provide screenshots/videos of the changes. --> <img width="456" height="298" alt="image" src="https://github.com/user-attachments/assets/1e858476-f3d2-4420-9aae-778f1750ab17" /> <img width="1228" height="841" alt="image" src="https://github.com/user-attachments/assets/6980aab6-96cc-452a-a6e6-8220bd49f65a" /> [](https://mermaid.live/edit#pako:eNp9U8tO6zAQ_RXLi7sqqOmDJF6wKeyREJurbEw8bS0cO_gRUar--x3HNORWab2I7Jkzc848cqS1EUAZdfAZQNfwJPnO8qaylSZ4ePBGh-Yd7NnScutlLVuuPXkF24El3JEnqLl6PTgPzRTwrRXcw4vih2uJtNjsg_5IQDeF6SlGoOcOtJ8CbpRET1SVbhfaziFJ_N3j41gcIxZqYwURMQi_ymOeP8SBgtqTTjr5roDUUcagktdedphissyxDckuK2Uo3TmyDSrVFsmE3G43_zEIuMkxOK_18dKOQibbybBQK7mS30Cc5q3bGx8V9fX2uqYkXWMdADdHN-lEgWl4LM5Axi1LEwk9hsA4w0jKTaYBlVKfzek1YmzA7gAXoTEdV7H80GJbPPxsxVQLfjPSGd1ZKSjzNsCMYq6Gxyc9xqCK-j00UFGGV8HtR0UrfcIY3Ny_xjTnMGvCbk_ZFtnwlYr--TUHq8W2g92YoD1li2LdJ6HsSL8ou1su75fZwyov8kW5WBVz9B4oy-br-yJflXmeZVmB_tOMfve0c7Sv53iK1aJcrsuyOP0Dx35svA) ## Checks <!-- check boxes for faster reviewing of your PR --> - [X] I do not require assistance to complete the PR. - [X] Before posting/requesting review of a PR, I have verified that the changes work. - [X] I have added screenshots/videos of the changes, or this PR does not change in-game mechanics. - [X] I affirm that my changes are licensed under the [MIT License](https://github.com/ss14Starlight/space-station-14/blob/Starlight/LICENSE.TXT) and grant permission for use in this repository under its conditions. **Changelog** <!-- If you want the players to know about changes made in this PR, specify them using the template outside the comment. Short and informative. :cl: STARLIGHT TEAM - add: Added Starlight. - remove: Removed SS13. - tweak: Changed SS14. - fix: Fixed Rinary. --> :cl: CrazyPhantom - fix: Fixed decal performance issue on decal creation.
Short description
Decals were still lagging on creation due to them dirtying the whole chunk if anything was added, So I made them delta the changes and only sync the diff to clients unless they are only getting it for the first time they they get the whole chunk.
Why we need to add this
Perf fix
Media (Video/Screenshots)
Checks
Changelog
🆑 CrazyPhantom