From de27d5fbfcff11d947c22453c7cf91f83b96e27a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Aug 2026 06:47:11 +0000 Subject: [PATCH] Revert spatial hashing visRange default and related comments to 30 Co-authored-by: miwarnec <16416509+miwarnec@users.noreply.github.com> --- .../SpatialHashing/SpatialHashing3DInterestManagement.cs | 8 ++++---- .../SpatialHashing/SpatialHashingInterestManagement.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashing3DInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashing3DInterestManagement.cs index 761f2c13f6b..15a2453a67d 100644 --- a/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashing3DInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashing3DInterestManagement.cs @@ -11,19 +11,19 @@ namespace Mirror [AddComponentMenu("Network/ Interest Management/ Spatial Hash/Grid Spatial Hash (3D)")] public class SpatialHashing3DInterestManagement : InterestManagement { - [Tooltip("The maximum range that objects will be visible.\nSet to 10-20% larger than camera far clip plane")] - public int visRange = 1200; + [Tooltip("The maximum range that objects will be visible at.")] + public int visRange = 30; // we use a 9 neighbour grid. // so we always see in a distance of 2 grids. // for example, our own grid and then one on top / below / left / right. // // this means that grid resolution needs to be distance / 2. - // so for example, for distance = 1200 we see 2 cells = 600 * 2 distance. + // so for example, for distance = 30 we see 2 cells = 15 * 2 distance. // // on first sight, it seems we need distance / 3 (we see left/us/right). // but that's not the case. - // resolution would be 400, and we only see 1 cell far, so 400+400=800. + // resolution would be 10, and we only see 1 cell far, so 10+10=20. public int resolution => visRange / 2; // same as XY because if XY is rotated 90 degree for 3D, it's still the same distance [Tooltip("Rebuild all every 'rebuildInterval' seconds.")] diff --git a/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs index 35cdafdcf7a..85897cd7a2b 100644 --- a/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs @@ -11,19 +11,19 @@ namespace Mirror [AddComponentMenu("Network/ Interest Management/ Spatial Hash/Grid Spatial Hash (2D)")] public class SpatialHashingInterestManagement : InterestManagement { - [Tooltip("The maximum range that objects will be visible.\nSet to 10-20% larger than camera far clip plane")] - public int visRange = 1200; + [Tooltip("The maximum range that objects will be visible at.")] + public int visRange = 30; // we use a 9 neighbour grid. // so we always see in a distance of 2 grids. // for example, our own grid and then one on top / below / left / right. // // this means that grid resolution needs to be distance / 2. - // so for example, for distance = 1200 we see 2 cells = 600 * 2 distance. + // so for example, for distance = 30 we see 2 cells = 15 * 2 distance. // // on first sight, it seems we need distance / 3 (we see left/us/right). // but that's not the case. - // resolution would be 400, and we only see 1 cell far, so 400+400=800. + // resolution would be 10, and we only see 1 cell far, so 10+10=20. public int resolution => visRange / 2; [Tooltip("Rebuild all every 'rebuildInterval' seconds.")]