Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: avatar turning with compression, no floaty avatars #2033

Merged
merged 12 commits into from
Sep 12, 2024

Conversation

NickKhalow
Copy link
Collaborator

@NickKhalow NickKhalow commented Sep 12, 2024

What does this PR change?

Fixed FloatQuantizer for approx zero values.

What's the issue was: the issue was in the way how Encoder compresses velocity. Previously it worked like: Encoder takes velocity and clamps it between range (for example -40 and 40) but Quantizer has a precision loss in the compression. When the value is '0' it cannot be encoded as '0', the compression step won't allow it (for example step is 0.33). And it encoded it as 0.33 instead of 0 what caused a constant movement of the avatar in the one direction by 3 axis. And it's the reason why avatars floated in the sky: the value was always positive and unprecised.
It's solved by the setting range from 0 to MaxValue and using one bit as a negative sign, [0; 40] in this example. So when value is actually 0 it's encoded as 0 because it's the closest value. And Encoder uses a sign bit to support negative vectors.

How to test the changes?

  1. Launch the explorer
  2. Test with multiple players (3-5) to be ensure that the floaty issue is gone and avatar turning works fine

Our Code Review Standards

https://github.com/decentraland/unity-renderer/blob/master/docs/code-review-standards.md

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced network movement data representation with improved compression algorithms.
    • Introduced a new velocityTier field for better categorization of movement data.
  • Improvements

    • Refactored compression and decompression methods for clarity and efficiency.
    • Updated NetworkMovementMessage struct for optimized memory usage.
    • Simplified message handling in MultiplayerMovementMessageBus.
  • Bug Fixes

    • Improved handling of small velocity magnitudes to prevent unnecessary data transmission.
  • Documentation

    • Added metadata files for better asset management and version control.
  • Tests

    • Expanded test coverage for float compression and decompression logic.

@NickKhalow NickKhalow self-assigned this Sep 12, 2024
Copy link

coderabbitai bot commented Sep 12, 2024

Walkthrough

The pull request introduces several modifications across multiple files related to the multiplayer movement system. Key changes include renaming parameters for clarity, refactoring compression and decompression logic, and enhancing data structures to optimize memory usage. The MultiplayerMovementMessageBus class has been streamlined to focus solely on compressed messages, and new methods have been added to improve velocity tier calculations. Additionally, nullable reference types have been enabled throughout the project to enhance type safety.

Changes

File Change Summary
Explorer/Assets/DCL/Multiplayer/Movement/Encoder/FloatQuantizer.cs Renamed bits parameter to sizeInBits in Compress and Decompress methods; updated calculations for maxStep accordingly.
Explorer/Assets/DCL/Multiplayer/Movement/Encoder/NetworkMessageEncoder.cs Updated Compress method to use velocityTier; refactored CompressMovementData and added methods for velocity compression. Adjusted Decompress method to align with new logic.
Explorer/Assets/DCL/Multiplayer/Movement/NetworkMovementMessage.cs Introduced velocityTier field; updated constructor, ToString, GetHashCode, and Equals methods to accommodate the new field.
Explorer/Assets/DCL/Multiplayer/Movement/Settings/MessageEncodingSettings.cs Changed public fields to private with SerializeField attribute; added public properties for read-only access.
Explorer/Assets/DCL/Multiplayer/Movement/Systems/MultiplayerMovementMessageBus.cs Removed Scheme enum and associated logic; refactored WriteAndSend method to exclusively handle compressed messages.
Explorer/Assets/DCL/Multiplayer/Movement/Systems/PlayerMovementNetSendSystem.cs Encapsulated velocity tier calculation into VelocityTierFromSpeed method; updated variable naming to velocityTier.
Explorer/Assets/DCL/Multiplayer/Movement/Tests/MovementMessageCompressionTests.cs Renamed properties in settings object for clarity; added FloatCompressDecompressTestCases method for testing float compression across various scenarios.
Explorer/Assets/DCL/Multiplayer/Movement/csc.rsp Added file to enable nullable reference types with -nullable:enable.
Explorer/Assets/DCL/Multiplayer/Movement/csc.rsp.meta Introduced metadata file with format version, GUID, and timestamp.
Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs Modified instantiation of MultiplayerMovementMessageBus to remove explicit Uncompressed scheme parameter.

Possibly related PRs

  • Fix: uncompressed scheme #1990: This PR involves changes to the MultiplayerMovementMessageBus class, particularly regarding message handling and compression schemes, which relates to the handling of the sizeInBits parameter in the current PR.

Suggested labels

no QA needed

Poem

🐰 In the meadow where bunnies play,
Changes hop in, brightening the day.
With clearer names and logic refined,
Our code now dances, perfectly aligned.
Compression's a breeze, like a soft, gentle sigh,
Thanks to the tweaks, we soar high in the sky! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Sep 12, 2024

badge

Windows and Mac build successfull in Unity Cloud! You can find a link to the downloadable artifact below.

Name Link
Commit 5f74fd1
Logs https://github.com/decentraland/unity-explorer/actions/runs/10828922318
Download Windows https://github.com/decentraland/unity-explorer/suites/28300413333/artifacts/
Download Mac https://github.com/decentraland/unity-explorer/suites/28300413333/artifacts/1924901524
Built on 2024-09-12T13:29:24Z

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (2)
Explorer/Assets/DCL/Multiplayer/Movement/Systems/csc.rsp (1)

1-1: Consider enabling nullable only for new code to avoid overwhelming warnings.

Enabling nullable reference types is a good practice as it helps prevent null reference exceptions and improves code quality. However, enabling this option for the entire project might lead to many warnings in existing code that hasn't been updated to use nullable reference types.

Consider using #nullable enable and #nullable disable directives to enable nullable reference types only for new code. This way, you can gradually update the existing codebase to use nullable reference types without being overwhelmed by warnings.

Explorer/Assets/DCL/Multiplayer/Movement/Encoder/NetworkMessageEncoder.cs (1)

97-132: LGTM!

The redefined CompressMovementData method enhances the clarity and maintainability of the code while ensuring that velocity data is accurately represented. The safety check for small velocity magnitudes and the refactored velocity compression logic are great improvements.

Consider avoiding the allocation of a new Vector2 object on lines 103-106 by using the x and z components of the position vector directly:

-var relativePosition = new Vector2(
-    position.x - (parcel.x * ParcelMathHelper.PARCEL_SIZE),
-    position.z - (parcel.y * ParcelMathHelper.PARCEL_SIZE) // Y is Z in this case
-);
+float relativeX = position.x - (parcel.x * ParcelMathHelper.PARCEL_SIZE);
+float relativeZ = position.z - (parcel.y * ParcelMathHelper.PARCEL_SIZE);

-int compressedX = FloatQuantizer.Compress(relativePosition.x, 0, ParcelMathHelper.PARCEL_SIZE, xzBits);
-int compressedZ = FloatQuantizer.Compress(relativePosition.y, 0, ParcelMathHelper.PARCEL_SIZE, xzBits);
+int compressedX = FloatQuantizer.Compress(relativeX, 0, ParcelMathHelper.PARCEL_SIZE, xzBits);
+int compressedZ = FloatQuantizer.Compress(relativeZ, 0, ParcelMathHelper.PARCEL_SIZE, xzBits);
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c4fa7a0 and 5f74fd1.

Files selected for processing (14)
  • Explorer/Assets/DCL/Multiplayer/Movement/Encoder/FloatQuantizer.cs (1 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/Encoder/NetworkMessageEncoder.cs (4 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/NetworkMovementMessage.cs (1 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/Settings/MessageEncodingSettings.cs (1 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/Systems/MultiplayerMovementMessageBus.cs (2 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/Systems/PlayerMovementNetSendSystem.cs (3 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/Systems/csc.rsp (1 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/Systems/csc.rsp.meta (1 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/Tests/MovementMessageCompressionTests.cs (7 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/Tests/csc.rsp (1 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/Tests/csc.rsp.meta (1 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/csc.rsp (1 hunks)
  • Explorer/Assets/DCL/Multiplayer/Movement/csc.rsp.meta (1 hunks)
  • Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs (1 hunks)
Files skipped from review due to trivial changes (4)
  • Explorer/Assets/DCL/Multiplayer/Movement/Encoder/FloatQuantizer.cs
  • Explorer/Assets/DCL/Multiplayer/Movement/Systems/csc.rsp.meta
  • Explorer/Assets/DCL/Multiplayer/Movement/Tests/csc.rsp.meta
  • Explorer/Assets/DCL/Multiplayer/Movement/csc.rsp.meta
Additional context used
Path-based instructions (7)
Explorer/Assets/DCL/Multiplayer/Movement/Settings/MessageEncodingSettings.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/DCL/Multiplayer/Movement/NetworkMovementMessage.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/DCL/Multiplayer/Movement/Systems/MultiplayerMovementMessageBus.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/DCL/Multiplayer/Movement/Systems/PlayerMovementNetSendSystem.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/DCL/Multiplayer/Movement/Encoder/NetworkMessageEncoder.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/DCL/Multiplayer/Movement/Tests/MovementMessageCompressionTests.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Additional comments not posted (33)
Explorer/Assets/DCL/Multiplayer/Movement/Tests/csc.rsp (1)

1-1: Enabling nullable reference types is a good practice, but be prepared to address warnings.

Enabling nullable reference types using the -nullable:enable compiler option is a good practice as it helps prevent null reference exceptions and improves code quality by enforcing null-safety.

However, enabling this feature might lead to new warnings in the existing codebase. Be prepared to address these warnings by updating the code to properly handle null values and adding necessary null checks.

Also, ensure that all team members are aware of this change and understand how to work with nullable reference types effectively.

Explorer/Assets/DCL/Multiplayer/Movement/csc.rsp (1)

1-1: Ensure project compatibility with nullable reference types.

Enabling nullable reference types is a good practice to improve code quality and catch potential null reference exceptions at compile time. However, please ensure that the rest of the project is updated to properly annotate nullable and non-nullable reference types to avoid compilation errors.

Verification successful

Project is compatible with nullable reference types.

The codebase contains multiple files with the #nullable enable directive, and no related compilation errors were found. This suggests that the project is compatible with nullable reference types. Ensure ongoing code updates maintain this compatibility.

  • Files with #nullable enable directive:
    • Explorer/Assets/Scripts/SceneRunner/Tests/SceneFacadeShould.cs
    • Explorer/Assets/Scripts/ECS/TestSuite/TestWebRequestController.cs
    • Explorer/Assets/Scripts/ECS/Unity/Materials/Pooling/MaterialsPool.cs
    • Explorer/Assets/Scripts/ECS/StreamableLoading/Tests/Urns/UrnsTest.cs
    • Explorer/Assets/Scripts/ECS/ComponentsPooling/Systems/FinalizeWorldSystemExtensions.cs
    • Explorer/Assets/DCL/WebRequests/WebContentSizes/ContentLengthBasedWebContentSizes.cs
    • Explorer/Assets/DCL/WebRequests/WebContentSizes/SeveralWebContentSizes.cs
    • Explorer/Assets/DCL/WebRequests/WebContentSizes/RangeBasedWebContentSizes.cs
    • Explorer/Assets/DCL/WebRequests/WebContentSizes/Playground/WebContentsSizesPlayground.cs
    • Explorer/Assets/DCL/Tests/Editor/CodeConventionTests.cs
    • Explorer/Assets/DCL/Tests/Editor/ValidationTests.cs
    • Explorer/Assets/DCL/SDKComponents/AudioSources/AudioSourceExtensions.cs
    • Explorer/Assets/DCL/SDKComponents/AudioSources/AudioUtils.cs
    • Explorer/Assets/DCL/SDKComponents/AudioSources/Components/AudioSourceComponent.cs
    • Explorer/Assets/DCL/Profiles/DataModels/ProfileJsonDto.cs
    • Explorer/Assets/DCL/PlacesAPIService/IPlacesAPIService.cs
    • Explorer/Assets/Plugins/SocketIO/SocketIOClient/Transport/WebSockets/DefaultClientWebSocket.cs
    • Explorer/Assets/Plugins/SocketIO/SocketIOClient/Transport/WebSockets/WebSocketReceiveResult.cs
    • Explorer/Assets/DCL/PerformanceAndDiagnostics/Optimization/PerformanceBudgeting/Memory/MemoryBudget.cs
    • Explorer/Assets/DCL/PerformanceAndDiagnostics/Optimization/PerformanceBudgeting/FrameTimeCapBudget.cs
    • Explorer/Assets/DCL/PerformanceAndDiagnostics/Analytics/AnalyticsController.cs
    • Explorer/Assets/DCL/PerformanceAndDiagnostics/Analytics/IAnalyticsController.cs
    • Explorer/Assets/DCL/Multiplayer/Movement/Components/RemotePlayerMovementComponent.cs
    • Explorer/Assets/DCL/Input/Utils/InteractionCache.cs
    • Explorer/Assets/DCL/AvatarRendering/Wearables/Helpers/WearablesConstants.cs
    • Explorer/Assets/DCL/AvatarRendering/AvatarShape/ComputeShader/FixedComputeBufferHandler.cs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the project compiles successfully with nullable reference types enabled.

# Test: Search for compilation errors related to nullable reference types.
rg --type cs $'#nullable enable' -A 10 | rg $'error CS8600|error CS8602|error CS8603|error CS8604|error CS8618|error CS8625'

Length of output: 124


Script:

#!/bin/bash
# Description: Verify the presence of `#nullable enable` directives and check for related errors in the codebase.

# Search for files with `#nullable enable` directive.
rg --type cs '#nullable enable' > nullable_files.txt

# Check for nullable reference type errors in the identified files.
if [ -s nullable_files.txt ]; then
  rg --file nullable_files.txt -A 10 | rg 'error CS8600|error CS8602|error CS8603|error CS8604|error CS8618|error CS8625'
else
  echo "No files with #nullable enable directive found."
fi

Length of output: 187


Script:

#!/bin/bash
# Description: List files containing the `#nullable enable` directive.

# List files with `#nullable enable` directive.
rg --type cs '#nullable enable' --files-with-matches

Length of output: 2030

Explorer/Assets/DCL/Multiplayer/Movement/Settings/MessageEncodingSettings.cs (1)

57-76: LGTM!

The changes improve the encapsulation of the MovementEncodingConfig class by:

  • Making the fields private and adding the SerializeField attribute to allow serialization by Unity.
  • Introducing public properties to provide read-only access to the private fields.

These changes align with the best practices of object-oriented programming and do not introduce any issues. The code segment does not involve any heap allocations or require any Unity engine-specific optimizations.

Explorer/Assets/DCL/Multiplayer/Movement/NetworkMovementMessage.cs (4)

23-24: LGTM!

The change from int to byte for the velocityTier field is a good optimization to reduce memory usage. The declaration looks good.


25-38: LGTM!

The constructor update to include the new velocityTier parameter looks good. The initialization of all the fields in the constructor is correct.


41-42: LGTM!

The usage of the null-forgiving operator in the ToString method is a good indication that the JSON serialization is guaranteed to not yield a null result. The change looks good.


43-69: LGTM!

The updates to the GetHashCode and Equals methods look good:

  • Including the new velocityTier field in the GetHashCode method ensures that hash codes are unique and account for all relevant data.
  • The additional comparisons in the Equals method improve the accuracy of equality checks between instances of the struct.

The implementation of both methods is correct.

Explorer/Assets/DCL/Multiplayer/Movement/Systems/MultiplayerMovementMessageBus.cs (5)

21-21: LGTM!

The null! operator is correctly used to suppress the null-state warning for the messageEncoder field, which is later initialized in the InitializeEncoder method.


Line range hint 27-37: LGTM!

The constructor has been correctly simplified by removing the scheme parameter and associated logic for handling different message compression schemes. The changes align with the PR objective of focusing on a single message format.


80-82: LGTM!

The WriteAndSend method has been correctly refactored to remove the conditional logic for handling uncompressed and compressed messages. The changes align with the PR objective of focusing on a single message format.


Line range hint 85-90: LGTM!

The WriteToProto method has been correctly updated to accept a CompressedNetworkMovementMessage, reflecting the new focus on compressed messages. The change aligns with the PR objective.


Line range hint 1-115: No issues found related to heap allocations or Unity engine optimizations.

I reviewed the code for potential heap allocation improvements and Unity engine optimizations as per the additional instructions. Here are my findings:

  1. Heap allocations:
  • The code does not appear to have any unnecessary heap allocations.
  • The CompressedNetworkMovementMessage object is created using object initializer syntax, which does not cause additional heap allocations.
  1. Unity engine optimizations:
  • The code does not directly interact with Unity engine APIs, so there are no specific Unity engine optimizations to suggest.

Overall, the code looks good from the perspective of heap allocations and Unity engine optimizations.

Explorer/Assets/DCL/Multiplayer/Movement/Systems/PlayerMovementNetSendSystem.cs (2)

Line range hint 115-125: LGTM!

The refactoring of the velocity tier calculation logic into the VelocityTierFromSpeed method improves code readability and modularity. The functionality remains unchanged, and the naming convention is consistent.


157-164: LGTM!

The VelocityTierFromSpeed method encapsulates the velocity tier calculation logic, which improves code readability and modularity. The implementation using a while loop is simple and efficient, and it does not allocate any memory on the heap, which is good for performance.

Explorer/Assets/DCL/Multiplayer/Movement/Encoder/NetworkMessageEncoder.cs (11)

24-25: LGTM!

The changes to the Compress method and the refactored CompressMovementData method improve the accuracy and maintainability of the movement data compression logic.


62-63: LGTM!

The change improves the readability of the code for extracting the movementKind from the compressed temporal data.


64-65: LGTM!

The change improves the readability of the code by assigning the decompressed velocity to a new variable correctedVelocity.


68-69: LGTM!

The change aligns with the updated compression logic that uses velocityTier instead of tier.


72-73: LGTM!

The change aligns with the updated decompression logic that assigns the decompressed velocity to a new variable correctedVelocity.


78-78: LGTM!

The change aligns with the updated decompression logic that extracts the movementKind from the compressed temporal data using a bitwise operation and a mask.


139-143: LGTM!

The change aligns with the updated decompression logic that uses the settings object to retrieve the encoding configuration.


146-147: LGTM!

The change aligns with the updated decompression logic that uses the settings object to retrieve the encoding configuration.


170-172: LGTM!

The change aligns with the updated decompression logic that handles the sign of the velocity and its absolute value separately using the new DecompressedVelocity method.


177-185: LGTM!

The new CompressedVelocity method enhances the clarity and maintainability of the code while ensuring that velocity data is accurately represented by handling the sign of the velocity and its absolute value separately.


187-200: LGTM!

The new DecompressedVelocity method enhances the clarity and maintainability of the code while ensuring that velocity data is accurately decompressed by handling the sign of the velocity and its absolute value separately. The NegativeSignFlag helper method also improves the readability of the code.

Explorer/Assets/DCL/Multiplayer/Movement/Tests/MovementMessageCompressionTests.cs (7)

Line range hint 131-145: LGTM!

The test case method looks good and aligns with the updated property name XZ__BITS in the settings.tier3 object.


148-154: LGTM!

The method looks good and aligns with the updated property name Y__MAX in the Settings.tier3 object.


167-173: LGTM!

The test case method looks good and aligns with the updated property name Y__MAX in the settings.tier3 object.


181-181: LGTM!

The assertion statement looks good and aligns with the updated property name Y__MAX in the settings.tier3 object.


188-191: LGTM!

The method looks good and aligns with the updated property name MAX__VELOCITY in the Settings.tier3 object.


203-212: LGTM!

The test case method looks good and aligns with the updated property name MAX__VELOCITY in the settings.tier3 object.


241-272: LGTM!

The new test case method FloatCompressDecompress and the corresponding test case data generator method FloatCompressDecompressTestCases look good. They enhance the test suite by providing coverage for the compression logic using the FloatQuantizer class.

Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs (1)

438-438: Verify the implications of using the default scheme for MultiplayerMovementMessageBus.

Removing the MultiplayerMovementMessageBus.Scheme.Uncompressed parameter suggests the intention is to use compression for the MultiplayerMovementMessageBus. This change could impact:

  • Network bandwidth usage
  • CPU overhead for compressing/decompressing messages

Please verify if this change aligns with the expected behavior and performance requirements.

Run the following script to verify if compression is being used and assess the performance impact:

Copy link
Contributor

@anicalbano anicalbano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Reviewed by QA

@NickKhalow NickKhalow merged commit 228a583 into main Sep 12, 2024
5 checks passed
@NickKhalow NickKhalow deleted the fix/avatar-turning branch September 12, 2024 13:29
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.

3 participants