From 594a0f5c79d91097ae72428fb2c44683c8bb1953 Mon Sep 17 00:00:00 2001 From: mischa Date: Thu, 3 Aug 2023 12:34:17 +0800 Subject: [PATCH] Examples: added BenchmarkIdle demo to test with 80% idle objects --- Assets/Mirror/Examples/BenchmarkIdle.meta | 8 + .../BenchmarkIdle/BenchmarkIdle.unity | 519 ++++++++++++++++++ .../BenchmarkIdle/BenchmarkIdle.unity.meta | 7 + .../BenchmarkIdleNetworkManager.cs | 98 ++++ .../BenchmarkIdleNetworkManager.cs.meta | 11 + Assets/Mirror/Examples/BenchmarkIdle/Npc.cs | 39 ++ .../Mirror/Examples/BenchmarkIdle/Npc.cs.meta | 11 + Assets/Mirror/Examples/BenchmarkIdle/Npc.mat | 77 +++ .../Examples/BenchmarkIdle/Npc.mat.meta | 8 + .../Mirror/Examples/BenchmarkIdle/Npc.prefab | 123 +++++ .../Examples/BenchmarkIdle/Npc.prefab.meta | 7 + .../Mirror/Examples/BenchmarkIdle/Player.cs | 87 +++ .../Examples/BenchmarkIdle/Player.cs.meta | 11 + .../Mirror/Examples/BenchmarkIdle/Player.mat | 77 +++ .../Examples/BenchmarkIdle/Player.mat.meta | 8 + .../Examples/BenchmarkIdle/Player.prefab | 158 ++++++ .../Examples/BenchmarkIdle/Player.prefab.meta | 7 + .../Mirror/Examples/BenchmarkIdle/Readme.txt | 9 + .../Examples/BenchmarkIdle/Readme.txt.meta | 3 + .../Mirror/Examples/BenchmarkIdle/_Readme.txt | 4 + .../Examples/BenchmarkIdle/_Readme.txt.meta | 3 + 21 files changed, 1275 insertions(+) create mode 100644 Assets/Mirror/Examples/BenchmarkIdle.meta create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdle.unity create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdle.unity.meta create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdleNetworkManager.cs create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdleNetworkManager.cs.meta create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Npc.cs create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Npc.cs.meta create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Npc.mat create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Npc.mat.meta create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Npc.prefab create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Npc.prefab.meta create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Player.cs create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Player.cs.meta create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Player.mat create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Player.mat.meta create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Player.prefab create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Player.prefab.meta create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Readme.txt create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/Readme.txt.meta create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/_Readme.txt create mode 100644 Assets/Mirror/Examples/BenchmarkIdle/_Readme.txt.meta diff --git a/Assets/Mirror/Examples/BenchmarkIdle.meta b/Assets/Mirror/Examples/BenchmarkIdle.meta new file mode 100644 index 000000000..dba267d59 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8cdce54a5125843aeb2a7ca5db3e4dd4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdle.unity b/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdle.unity new file mode 100644 index 000000000..147bb8048 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdle.unity @@ -0,0 +1,519 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 23800000, guid: 0bc607fa2e315482ebe98797e844e11f, type: 2} +--- !u!1 &88936773 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 88936777} + - component: {fileID: 88936776} + - component: {fileID: 88936774} + - component: {fileID: 88936778} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &88936774 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 88936773} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9021b6cc314944290986ab6feb48db79, type: 3} + m_Name: + m_EditorClassIdentifier: + height: 150 + maxLogCount: 50 + hotKey: 293 +--- !u!20 &88936776 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 88936773} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 35 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &88936777 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 88936773} + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: 0, y: 100, z: -150} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} +--- !u!114 &88936778 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 88936773} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6635375fbc6be456ea640b75add6378e, type: 3} + m_Name: + m_EditorClassIdentifier: + showGUI: 1 + showLog: 1 +--- !u!1 &535739935 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 535739936} + - component: {fileID: 535739937} + m_Layer: 0 + m_Name: SpawnPosition + m_TagString: Untagged + m_Icon: {fileID: -964228994112308473, guid: 0000000000000000d000000000000000, type: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &535739936 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 535739935} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &535739937 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 535739935} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 41f84591ce72545258ea98cb7518d8b9, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1282001517 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1282001518} + - component: {fileID: 1282001520} + - component: {fileID: 1282001519} + - component: {fileID: 1282001523} + - component: {fileID: 1282001524} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1282001518 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1282001517} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1282001519 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1282001517} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6442dc8070ceb41f094e44de0bf87274, type: 3} + m_Name: + m_EditorClassIdentifier: + offsetX: 0 + offsetY: 0 +--- !u!114 &1282001520 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1282001517} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6f7f7192969f04e1eb1d3b30cb378a20, type: 3} + m_Name: + m_EditorClassIdentifier: + dontDestroyOnLoad: 1 + runInBackground: 1 + autoStartServerBuild: 1 + autoConnectClientBuild: 0 + sendRate: 30 + offlineScene: + onlineScene: + transport: {fileID: 1282001524} + networkAddress: localhost + maxConnections: 1000 + disconnectInactiveConnections: 0 + disconnectInactiveTimeout: 60 + authenticator: {fileID: 0} + playerPrefab: {fileID: 449802645721213856, guid: c07d22724e9914db19b931058fd2111e, + type: 3} + autoCreatePlayer: 1 + playerSpawnMethod: 1 + spawnPrefabs: + - {fileID: 449802645721213856, guid: 0ea79775d59804682a8cdd46b3811344, type: 3} + snapshotSettings: + bufferTimeMultiplier: 2 + bufferLimit: 32 + catchupNegativeThreshold: -1 + catchupPositiveThreshold: 1 + catchupSpeed: 0.019999999552965164 + slowdownSpeed: 0.03999999910593033 + driftEmaDuration: 1 + dynamicAdjustment: 1 + dynamicAdjustmentTolerance: 1 + deliveryTimeEmaDuration: 2 + connectionQualityInterval: 3 + timeInterpolationGui: 0 + spawnAmount: 50000 + interleave: 2 + spawnPrefab: {fileID: 449802645721213856, guid: 0ea79775d59804682a8cdd46b3811344, + type: 3} + spawnPositionRatio: 0.01 +--- !u!114 &1282001523 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1282001517} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d7da4e566d24ea7b0e12178d934b648, type: 3} + m_Name: + m_EditorClassIdentifier: + clientIntervalReceivedPackets: 0 + clientIntervalReceivedBytes: 0 + clientIntervalSentPackets: 0 + clientIntervalSentBytes: 0 + clientReceivedPacketsPerSecond: 0 + clientReceivedBytesPerSecond: 0 + clientSentPacketsPerSecond: 0 + clientSentBytesPerSecond: 0 + serverIntervalReceivedPackets: 0 + serverIntervalReceivedBytes: 0 + serverIntervalSentPackets: 0 + serverIntervalSentBytes: 0 + serverReceivedPacketsPerSecond: 0 + serverReceivedBytesPerSecond: 0 + serverSentPacketsPerSecond: 0 + serverSentBytesPerSecond: 0 +--- !u!114 &1282001524 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1282001517} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c7424c1070fad4ba2a7a96b02fbeb4bb, type: 3} + m_Name: + m_EditorClassIdentifier: + port: 7777 + NoDelay: 1 + SendTimeout: 5000 + ReceiveTimeout: 30000 + serverMaxMessageSize: 16384 + serverMaxReceivesPerTick: 10000 + serverSendQueueLimitPerConnection: 10000 + serverReceiveQueueLimitPerConnection: 10000 + clientMaxMessageSize: 16384 + clientMaxReceivesPerTick: 1000 + clientSendQueueLimit: 10000 + clientReceiveQueueLimit: 10000 +--- !u!1 &2054208274 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2054208276} + - component: {fileID: 2054208275} + m_Layer: 0 + m_Name: Directional light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &2054208275 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054208274} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0.8 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &2054208276 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054208274} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} diff --git a/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdle.unity.meta b/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdle.unity.meta new file mode 100644 index 000000000..9798cec87 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdle.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 23a7fdebddb0e4caabec9f7777f799f0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdleNetworkManager.cs b/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdleNetworkManager.cs new file mode 100644 index 000000000..536a8fd72 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdleNetworkManager.cs @@ -0,0 +1,98 @@ +using UnityEngine; + +namespace Mirror.Examples.BenchmarkIdle +{ + [AddComponentMenu("")] + public class BenchmarkIdleNetworkManager : NetworkManager + { + [Header("Spawns")] + public int spawnAmount = 10_000; + public float interleave = 1; + public GameObject spawnPrefab; + + // player spawn positions should be spread across the world. + // not all at one place. + // but _some_ at the same place. + // => deterministic random is ideal + [Range(0, 1)] public float spawnPositionRatio = 0.01f; + + System.Random random = new System.Random(42); + + void SpawnAll() + { + // clear previous player spawn positions in case we start twice + foreach (Transform position in startPositions) + Destroy(position.gameObject); + + startPositions.Clear(); + + // calculate sqrt so we can spawn N * N = Amount + float sqrt = Mathf.Sqrt(spawnAmount); + + // calculate spawn xz start positions + // based on spawnAmount * distance + float offset = -sqrt / 2 * interleave; + + // spawn exactly the amount, not one more. + int spawned = 0; + for (int spawnX = 0; spawnX < sqrt; ++spawnX) + { + for (int spawnZ = 0; spawnZ < sqrt; ++spawnZ) + { + // spawn exactly the amount, not any more + // (our sqrt method isn't 100% precise) + if (spawned < spawnAmount) + { + // spawn & position + GameObject go = Instantiate(spawnPrefab); + float x = offset + spawnX * interleave; + float z = offset + spawnZ * interleave; + Vector3 position = new Vector3(x, 0, z); + go.transform.position = position; + + // spawn + NetworkServer.Spawn(go); + ++spawned; + + // add random spawn position for players. + // don't have them all in the same place. + if (random.NextDouble() <= spawnPositionRatio) + { + GameObject spawnGO = new GameObject("Spawn"); + spawnGO.transform.position = position; + spawnGO.AddComponent(); + } + } + } + } + } + + // overwrite random spawn position selection: + // - needs to be deterministic so every CCU test results in the same + // - needs to be random so not only are the spawn positions spread out + // randomly, we also have a random amount of players per spawn position + public override Transform GetStartPosition() + { + // first remove any dead transforms + startPositions.RemoveAll(t => t == null); + + if (startPositions.Count == 0) + return null; + + // pick a random one + int index = random.Next(0, startPositions.Count); // DETERMINISTIC + return startPositions[index]; + } + + public override void OnStartServer() + { + base.OnStartServer(); + SpawnAll(); + + // disable rendering on server to reduce noise in profiling. + // keep enabled in host mode though. + if (mode == NetworkManagerMode.ServerOnly) + Camera.main.enabled = false; + } + } +} diff --git a/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdleNetworkManager.cs.meta b/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdleNetworkManager.cs.meta new file mode 100644 index 000000000..841c486c3 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/BenchmarkIdleNetworkManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6f7f7192969f04e1eb1d3b30cb378a20 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Npc.cs b/Assets/Mirror/Examples/BenchmarkIdle/Npc.cs new file mode 100644 index 000000000..7c9bd8d5f --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Npc.cs @@ -0,0 +1,39 @@ +// idle object that rarely gets dirty +using UnityEngine; + +namespace Mirror.Examples.BenchmarkIdle +{ + public class Npc : NetworkBehaviour + { + // component to assign in inspector + public Renderer rend; + + // the value to set dirty + [SyncVar] ulong value; + + [Tooltip("Probability that this object just sleeps the whole time without ever getting dirty. (Npcs, Item drops, etc.)")] + [Range(0, 1)] public float sleepingProbability = 0.80f; // 80% of the objects are sleeping + bool sleeping; + + [Header("Colors")] + public Color activeColor = Color.white; + public Color sleepingColor = Color.red; + + public override void OnStartServer() + { + sleeping = Random.value < sleepingProbability; + + // color coding + // can't do this in update, it's too expensive + rend.material.color = sleeping ? sleepingColor : activeColor; + } + + [ServerCallback] + void Update() + { + // set dirty if not sleeping. + // only counts as dirty every 'syncInterval'. + if (!sleeping) ++value; + } + } +} diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Npc.cs.meta b/Assets/Mirror/Examples/BenchmarkIdle/Npc.cs.meta new file mode 100644 index 000000000..cef1fc45f --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Npc.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 112eda4d75f3840238a75926c4d465bf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Npc.mat b/Assets/Mirror/Examples/BenchmarkIdle/Npc.mat new file mode 100644 index 000000000..6e2a11068 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Npc.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Npc + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 0 + m_EnableInstancingVariants: 1 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 0, b: 0, a: 1} + - _EmissionColor: {r: 0.3254902, g: 0.3254902, b: 0.3254902, a: 1} diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Npc.mat.meta b/Assets/Mirror/Examples/BenchmarkIdle/Npc.mat.meta new file mode 100644 index 000000000..d5672b780 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Npc.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3ec830ed62de74cfe8c71892397c32ee +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Npc.prefab b/Assets/Mirror/Examples/BenchmarkIdle/Npc.prefab new file mode 100644 index 000000000..b6596d151 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Npc.prefab @@ -0,0 +1,123 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &449802645721213856 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2697352357490696306} + - component: {fileID: 8695142844114820487} + - component: {fileID: 6692327599609520039} + - component: {fileID: 1078519278818213949} + - component: {fileID: -3181616459286004871} + m_Layer: 0 + m_Name: Npc + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2697352357490696306 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8695142844114820487 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6692327599609520039 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 451c5da2c5056496297cffba02216286, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &1078519278818213949 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3} + m_Name: + m_EditorClassIdentifier: + sceneId: 0 + _assetId: 134303604 + serverOnly: 0 + visible: 0 + hasSpawned: 0 +--- !u!114 &-3181616459286004871 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 112eda4d75f3840238a75926c4d465bf, type: 3} + m_Name: + m_EditorClassIdentifier: + syncDirection: 0 + syncMode: 0 + syncInterval: 0.1 + rend: {fileID: 6692327599609520039} + sleepingProbability: 0.8 + dirtyColor: {r: 1, g: 1, b: 1, a: 1} + cleanColor: {r: 1, g: 0, b: 0, a: 1} diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Npc.prefab.meta b/Assets/Mirror/Examples/BenchmarkIdle/Npc.prefab.meta new file mode 100644 index 000000000..8fa885e6c --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Npc.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0ea79775d59804682a8cdd46b3811344 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Player.cs b/Assets/Mirror/Examples/BenchmarkIdle/Player.cs new file mode 100644 index 000000000..83261e313 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Player.cs @@ -0,0 +1,87 @@ +using UnityEngine; + +namespace Mirror.Examples.BenchmarkIdle +{ + public class Player : NetworkBehaviour + { + // automated movement. + // player may switch to manual movement any time + [Header("Automated Movement")] + public bool autoMove = true; + public float autoSpeed = 2; + public float movementProbability = 0.5f; + public float movementDistance = 20; + bool moving; + Vector3 start; + Vector3 destination; + + [Header("Manual Movement")] + public float manualSpeed = 10; + + // cache .transform for benchmark demo. + // Component.get_transform shows in profiler otherwise. + Transform tf; + + public override void OnStartLocalPlayer() + { + tf = transform; + start = tf.position; + } + + void AutoMove() + { + if (moving) + { + if (Vector3.Distance(tf.position, destination) <= 0.01f) + { + moving = false; + } + else + { + tf.position = Vector3.MoveTowards(tf.position, destination, autoSpeed * Time.deltaTime); + } + } + else + { + float r = Random.value; + if (r < movementProbability * Time.deltaTime) + { + // calculate a random position in a circle + float circleX = Mathf.Cos(Random.value * Mathf.PI); + float circleZ = Mathf.Sin(Random.value * Mathf.PI); + Vector2 circlePos = new Vector2(circleX, circleZ); + Vector3 dir = new Vector3(circlePos.x, 0, circlePos.y); + + // set destination on random pos in a circle around start. + // (don't want to wander off) + destination = start + dir * movementDistance; + moving = true; + } + } + } + + void ManualMove() + { + float h = Input.GetAxis("Horizontal"); + float v = Input.GetAxis("Vertical"); + + Vector3 direction = new Vector3(h, 0, v); + transform.position += direction.normalized * (Time.deltaTime * manualSpeed); + } + + static bool Interrupted() => + Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0; + + void Update() + { + if (!isLocalPlayer) return; + + // player may interrupt auto movement to switch to manual + if (Interrupted()) autoMove = false; + + // move + if (autoMove) AutoMove(); + else ManualMove(); + } + } +} diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Player.cs.meta b/Assets/Mirror/Examples/BenchmarkIdle/Player.cs.meta new file mode 100644 index 000000000..999e213e1 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Player.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4bfbc9d9d08147c3966a2661650986a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Player.mat b/Assets/Mirror/Examples/BenchmarkIdle/Player.mat new file mode 100644 index 000000000..aa2c0566b --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Player.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Player + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 0 + m_EnableInstancingVariants: 1 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0.3254902, g: 0.3254902, b: 0.3254902, a: 1} diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Player.mat.meta b/Assets/Mirror/Examples/BenchmarkIdle/Player.mat.meta new file mode 100644 index 000000000..69c5c9823 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Player.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d420d3b9c6ea54d8392b48f1cfa2e91c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Player.prefab b/Assets/Mirror/Examples/BenchmarkIdle/Player.prefab new file mode 100644 index 000000000..b9567335a --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Player.prefab @@ -0,0 +1,158 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &449802645721213856 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2697352357490696306} + - component: {fileID: 8695142844114820487} + - component: {fileID: 6692327599609520039} + - component: {fileID: 1078519278818213949} + - component: {fileID: 3679374677650722848} + - component: {fileID: 8691745481282286165} + m_Layer: 0 + m_Name: Player + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2697352357490696306 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8695142844114820487 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6692327599609520039 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: ff8f106e5c9e34da28ad9cee6edb2255, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &1078519278818213949 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3} + m_Name: + m_EditorClassIdentifier: + sceneId: 0 + _assetId: 3481667453 + serverOnly: 0 + visible: 0 + hasSpawned: 0 +--- !u!114 &3679374677650722848 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a553cb17010b2403e8523b558bffbc14, type: 3} + m_Name: + m_EditorClassIdentifier: + syncDirection: 1 + syncMode: 0 + syncInterval: 0 + target: {fileID: 2697352357490696306} + clientAuthority: 0 + syncPosition: 1 + syncRotation: 0 + syncScale: 0 + interpolatePosition: 1 + interpolateRotation: 0 + interpolateScale: 0 + sendIntervalMultiplier: 3 + timelineOffset: 1 + showGizmos: 0 + showOverlay: 0 + overlayColor: {r: 0, g: 0, b: 0, a: 0.5} + onlySyncOnChange: 1 + bufferResetMultiplier: 5 + positionSensitivity: 0.01 + rotationSensitivity: 0.01 + scaleSensitivity: 0.01 +--- !u!114 &8691745481282286165 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449802645721213856} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c4bfbc9d9d08147c3966a2661650986a, type: 3} + m_Name: + m_EditorClassIdentifier: + syncDirection: 0 + syncMode: 0 + syncInterval: 0.1 + autoMove: 1 + autoSpeed: 2 + movementProbability: 0.5 + movementDistance: 20 + manualSpeed: 10 diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Player.prefab.meta b/Assets/Mirror/Examples/BenchmarkIdle/Player.prefab.meta new file mode 100644 index 000000000..83b8747ad --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Player.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c07d22724e9914db19b931058fd2111e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Readme.txt b/Assets/Mirror/Examples/BenchmarkIdle/Readme.txt new file mode 100644 index 000000000..673d30ead --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Readme.txt @@ -0,0 +1,9 @@ +This is used for CCU tests. +White = players, Red = monsters. + +In NetworkManager: +- set the server's IP/Port +- enable 'auto start headless server', build server binary. +- enable 'auto connect headless client', build client binary. + +Launch 1 server with N clients. \ No newline at end of file diff --git a/Assets/Mirror/Examples/BenchmarkIdle/Readme.txt.meta b/Assets/Mirror/Examples/BenchmarkIdle/Readme.txt.meta new file mode 100644 index 000000000..1b0fdc797 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/Readme.txt.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f470f284e61694f03b862ce57768786d +timeCreated: 1678260514 \ No newline at end of file diff --git a/Assets/Mirror/Examples/BenchmarkIdle/_Readme.txt b/Assets/Mirror/Examples/BenchmarkIdle/_Readme.txt new file mode 100644 index 000000000..a7031fb94 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/_Readme.txt @@ -0,0 +1,4 @@ +Benchmark with majority idle objects to test dirtyObjects technique. + +This is generating large traffic. +The test requires Telepathy in order to not disconnect the client. \ No newline at end of file diff --git a/Assets/Mirror/Examples/BenchmarkIdle/_Readme.txt.meta b/Assets/Mirror/Examples/BenchmarkIdle/_Readme.txt.meta new file mode 100644 index 000000000..c54099338 --- /dev/null +++ b/Assets/Mirror/Examples/BenchmarkIdle/_Readme.txt.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c00df365757142c3b4b835df96eba59b +timeCreated: 1690899527 \ No newline at end of file