From 4765189c219a31c14b9395aafa1c176f9ea0af9b Mon Sep 17 00:00:00 2001 From: Cailean Finn Date: Fri, 22 Mar 2024 13:43:57 +0000 Subject: [PATCH] layer changes, camera added --- .../ML-Agents/Timers/DreconDemo_timers.json | 2 +- .../Ragdoll004/MocapControllerArtanim.cs | 29 ++-- Assets/Scenes/DreconDemo.unity | 132 +++++++++++------- Assets/Scenes/DreconDemo/Volume Profile.asset | 10 +- Packages/manifest.json | 1 + Packages/packages-lock.json | 9 ++ ProjectSettings/EditorSettings.asset | 22 ++- 7 files changed, 134 insertions(+), 71 deletions(-) diff --git a/Assets/ML-Agents/Timers/DreconDemo_timers.json b/Assets/ML-Agents/Timers/DreconDemo_timers.json index 0d1fed3..700f9a6 100644 --- a/Assets/ML-Agents/Timers/DreconDemo_timers.json +++ b/Assets/ML-Agents/Timers/DreconDemo_timers.json @@ -1 +1 @@ -{"count":1,"self":8.3608272,"total":8.5257697999999991,"children":{"InitializeActuators":{"count":1,"self":0.0010012,"total":0.0010012,"children":null},"InitializeSensors":{"count":1,"self":0.0010059,"total":0.0010059,"children":null},"AgentSendState":{"count":219,"self":0.0005036,"total":0.0356133,"children":{"CollectObservations":{"count":110,"self":0.0240878,"total":0.0240878,"children":null},"WriteActionMask":{"count":110,"self":0,"total":0,"children":null},"RequestDecision":{"count":110,"self":0.0110219,"total":0.0110219,"children":null}}},"DecideAction":{"count":219,"self":0.0907428,"total":0.0907428,"children":null},"AgentAct":{"count":219,"self":0.0365797,"total":0.0365797,"children":null}},"gauges":{"DReCon-v0.CumulativeReward":{"count":1,"max":93.1809158,"min":93.1809158,"runningAverage":93.1809158,"value":93.1809158,"weightedAverage":93.1809158}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1711038444","unity_version":"2022.3.5f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.5f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\Projects\\24_3-Moloch\\2_Unity\\Expeirments\\Drecon2022 -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-caile -hubSessionId 585fb154-c60e-4d06-858f-da51882ef412 -accessToken uYlRmxZm8yQI0ljQ6TREamLSDSVcPFPnk5wEHmLEyOE005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1711038452"}} \ No newline at end of file +{"count":1,"self":1714.3368704,"total":1809.0330984999998,"children":{"InitializeActuators":{"count":1,"self":0.0019619999999999998,"total":0.0019619999999999998,"children":null},"InitializeSensors":{"count":1,"self":0.0019390999999999998,"total":0.0019390999999999998,"children":null},"AgentSendState":{"count":143826,"self":1.4402523999999999,"total":32.4746783,"children":{"CollectObservations":{"count":71913,"self":30.4117632,"total":30.4117642,"children":null},"WriteActionMask":{"count":71913,"self":0.174433,"total":0.174433,"children":null},"RequestDecision":{"count":71913,"self":0.4482287,"total":0.4482287,"children":null}}},"DecideAction":{"count":143826,"self":39.5388288,"total":39.5388276,"children":null},"AgentAct":{"count":143826,"self":22.677847999999997,"total":22.6778475,"children":null}},"gauges":{"DReCon-v0.CumulativeReward":{"count":96,"max":1691.42554,"min":34.2285233,"runningAverage":846.3525,"value":1443.46228,"weightedAverage":944.87915}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1711113183","unity_version":"2022.3.5f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.5f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\drecon-unity -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-cail -hubSessionId b9bb4f89-6ebb-4174-8dd7-232c198f283f -accessToken 3bKq64kDohwvzBedRQa064i5VQbRQJvsqbs_u4eNH0g005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1711114992"}} \ No newline at end of file diff --git a/Assets/MarathonEnvs/Scripts/Ragdoll004/MocapControllerArtanim.cs b/Assets/MarathonEnvs/Scripts/Ragdoll004/MocapControllerArtanim.cs index 1ce52be..f36d62b 100644 --- a/Assets/MarathonEnvs/Scripts/Ragdoll004/MocapControllerArtanim.cs +++ b/Assets/MarathonEnvs/Scripts/Ragdoll004/MocapControllerArtanim.cs @@ -74,9 +74,11 @@ public class MocapControllerArtanim : MonoBehaviour, IOnSensorCollision bool _hasLazyInitialized; + private List allChildObjects = new List(); - void SetOffsetSourcePose2RBInProceduralWorld() { + + void SetOffsetSourcePose2RBInProceduralWorld() { _transforms = GetComponentsInChildren().ToList(); @@ -339,19 +341,17 @@ public class MocapControllerArtanim : MonoBehaviour, IOnSensorCollision // set the layers ragdollForMocap.layer = this.gameObject.layer; + FindAllChildObjects(ragdollForMocap.transform); - - - foreach (Transform child in ragdollForMocap.transform) + foreach (var obj in allChildObjects) { - child.gameObject.layer = this.gameObject.layer; + obj.layer = this.gameObject.layer; } + // setup HandleOverlap foreach (var rb in clone.GetComponentsInChildren()) { // remove cloned HandledOverlap - Transform t = rb.GetComponent(); - t.gameObject.layer = 3; var oldHandleOverlap = rb.GetComponent(); DestroyImmediate(oldHandleOverlap); var handleOverlap = rb.gameObject.AddComponent(); @@ -368,7 +368,20 @@ public class MocapControllerArtanim : MonoBehaviour, IOnSensorCollision //Debug.Log(children.Count); } - void SetupSensors() + + // Function to recursively find all child game objects + private void FindAllChildObjects(Transform parent) + { + foreach (Transform child in parent) + { + // Add the child to the list + allChildObjects.Add(child.gameObject); + + // Recursively call this function for each child's children + FindAllChildObjects(child); + } + } + void SetupSensors() { _sensors = GetComponentsInChildren() .Select(x=>x.gameObject) diff --git a/Assets/Scenes/DreconDemo.unity b/Assets/Scenes/DreconDemo.unity index 34776ed..17c6fd8 100644 --- a/Assets/Scenes/DreconDemo.unity +++ b/Assets/Scenes/DreconDemo.unity @@ -134,6 +134,7 @@ GameObject: - component: {fileID: 153031625} - component: {fileID: 153031624} - component: {fileID: 153031626} + - component: {fileID: 153031627} m_Layer: 0 m_Name: Cameras m_TagString: Untagged @@ -160,7 +161,7 @@ MonoBehaviour: m_Priority: 10 m_StandbyUpdate: 2 m_LookAt: {fileID: 6929616558284982652} - m_Follow: {fileID: 853179281038527757} + m_Follow: {fileID: 4601739312331501785} m_Lens: FieldOfView: 10 OrthographicSize: 10 @@ -188,8 +189,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 153031623} serializedVersion: 2 - m_LocalRotation: {x: -0.03985313, y: -0.7325023, z: -0.043042026, w: 0.67823267} - m_LocalPosition: {x: 5.3327937, y: 0.95045125, z: -1.2969661} + m_LocalRotation: {x: 7.355525e-17, y: 0.99859816, z: 0.052931532, w: -1.4190396e-15} + m_LocalPosition: {x: -1.2288619, y: 1.2526504, z: 3.21949} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -203,16 +204,32 @@ MonoBehaviour: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 153031623} - m_Enabled: 0 + m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 449ef5ebbe24720439ec31d15f7b6f3d, type: 3} m_Name: m_EditorClassIdentifier: m_FocusTracksTarget: 0 - m_FocusTracking: 1 + m_FocusTracking: 0 m_FocusTarget: {fileID: 0} m_FocusOffset: 0 m_Profile: {fileID: 11400000, guid: caceb0fea4f4dbe42acf97a8f550cb73, type: 2} +--- !u!114 &153031627 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 153031623} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4700f9f03ad19f94baf0367cb7a9c988, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Width: 2 + m_Damping: 8 + m_MinFOV: 1 + m_MaxFOV: 10 --- !u!1 &330585543 GameObject: m_ObjectHideFlags: 0 @@ -300,8 +317,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 330585543} serializedVersion: 2 - m_LocalRotation: {x: -0.03985313, y: -0.7325023, z: -0.043042026, w: 0.67823267} - m_LocalPosition: {x: 5.3327937, y: 0.95045125, z: -1.2969661} + m_LocalRotation: {x: 7.355525e-17, y: 0.99859816, z: 0.052931532, w: -1.4190396e-15} + m_LocalPosition: {x: -1.2288619, y: 1.2526504, z: 3.21949} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -562,9 +579,9 @@ GameObject: m_Component: - component: {fileID: 1187767391} - component: {fileID: 1187767394} - - component: {fileID: 1187767397} - component: {fileID: 1187767396} - component: {fileID: 1187767398} + - component: {fileID: 1187767399} m_Layer: 0 m_Name: cm m_TagString: Untagged @@ -611,12 +628,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f4044717213e31446939f7bd49c896ea, type: 3} m_Name: m_EditorClassIdentifier: - m_TrackedObjectOffset: {x: 0, y: 0.12, z: 0} + m_TrackedObjectOffset: {x: 0, y: 0.18, z: 0} m_LookaheadTime: 0 m_LookaheadSmoothing: 0 m_LookaheadIgnoreY: 0 - m_HorizontalDamping: 0.5 - m_VerticalDamping: 0.5 + m_HorizontalDamping: 1 + m_VerticalDamping: 1 m_ScreenX: 0.5 m_ScreenY: 0.5 m_DeadZoneWidth: 0 @@ -626,7 +643,7 @@ MonoBehaviour: m_BiasX: 0 m_BiasY: 0 m_CenterOnActivate: 1 ---- !u!114 &1187767397 +--- !u!114 &1187767398 MonoBehaviour: m_ObjectHideFlags: 3 m_CorrespondingSourceObject: {fileID: 0} @@ -635,41 +652,15 @@ MonoBehaviour: m_GameObject: {fileID: 1187767390} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6ad980451443d70438faac0bc6c235a0, type: 3} + m_Script: {fileID: 11500000, guid: 68bb026fafb42b14791938953eaace77, type: 3} m_Name: m_EditorClassIdentifier: - m_TrackedObjectOffset: {x: 5.72, y: 0, z: 0.41} - m_LookaheadTime: 0 - m_LookaheadSmoothing: 0 - m_LookaheadIgnoreY: 0 - m_XDamping: 5.86 - m_YDamping: 8.53 - m_ZDamping: 5.58 - m_TargetMovementOnly: 1 - m_ScreenX: 0.5 - m_ScreenY: 0.5 - m_CameraDistance: 0.85 - m_DeadZoneWidth: 0 - m_DeadZoneHeight: 0 - m_DeadZoneDepth: 0 - m_UnlimitedSoftZone: 0 - m_SoftZoneWidth: 0.8 - m_SoftZoneHeight: 0.8 - m_BiasX: 0 - m_BiasY: 0 - m_CenterOnActivate: 1 - m_GroupFramingMode: 2 - m_AdjustmentMode: 0 - m_GroupFramingSize: 0.8 - m_MaxDollyIn: 5000 - m_MaxDollyOut: 5000 - m_MinimumDistance: 1 - m_MaximumDistance: 5000 - m_MinimumFOV: 3 - m_MaximumFOV: 60 - m_MinimumOrthoSize: 1 - m_MaximumOrthoSize: 5000 ---- !u!114 &1187767398 + m_NoiseProfile: {fileID: 11400000, guid: 46965f9cbaf525742a6da4c2172a99cd, type: 2} + m_PivotOffset: {x: 0, y: 0, z: 0} + m_AmplitudeGain: 1 + m_FrequencyGain: 1 + mNoiseOffsets: {x: 902.40234, y: -591.7914, z: 888.80176} +--- !u!114 &1187767399 MonoBehaviour: m_ObjectHideFlags: 3 m_CorrespondingSourceObject: {fileID: 0} @@ -678,14 +669,51 @@ MonoBehaviour: m_GameObject: {fileID: 1187767390} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 68bb026fafb42b14791938953eaace77, type: 3} + m_Script: {fileID: 11500000, guid: 9384ab8608cdc3d479fe89cd51eed48f, type: 3} m_Name: m_EditorClassIdentifier: - m_NoiseProfile: {fileID: 11400000, guid: e9ce97b7a206dc64d90931ea044e0c72, type: 2} - m_PivotOffset: {x: 0, y: 0, z: 0} - m_AmplitudeGain: 1 - m_FrequencyGain: 1 - mNoiseOffsets: {x: 902.40234, y: -591.7914, z: 888.80176} + m_BindingMode: 0 + m_FollowOffset: {x: 0, y: 0, z: 5} + m_XDamping: 10 + m_YDamping: 1 + m_ZDamping: 0.5 + m_AngularDampingMode: 0 + m_PitchDamping: 0 + m_YawDamping: 0 + m_RollDamping: 0 + m_AngularDamping: 0 + m_Heading: + m_Definition: 2 + m_VelocityFilterStrength: 4 + m_Bias: 0 + m_RecenterToTargetHeading: + m_enabled: 1 + m_WaitTime: 1 + m_RecenteringTime: 2 + m_LegacyHeadingDefinition: -1 + m_LegacyVelocityFilterStrength: -1 + m_XAxis: + Value: 0 + m_SpeedMode: 0 + m_MaxSpeed: 300 + m_AccelTime: 0.1 + m_DecelTime: 0.1 + m_InputAxisName: Mouse X + m_InputAxisValue: 0 + m_InvertInput: 1 + m_MinValue: -180 + m_MaxValue: 180 + m_Wrap: 1 + m_Recentering: + m_enabled: 0 + m_WaitTime: 1 + m_RecenteringTime: 2 + m_LegacyHeadingDefinition: -1 + m_LegacyVelocityFilterStrength: -1 + m_LegacyRadius: 3.4028235e+38 + m_LegacyHeightOffset: 3.4028235e+38 + m_LegacyHeadingBias: 3.4028235e+38 + m_HeadingIsSlave: 0 --- !u!171741748 &23053004779861953 ArticulationBody: m_ObjectHideFlags: 0 @@ -2412,7 +2440,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b028a18f3817e4b768154fd94047e4d7, type: 3} m_Name: m_EditorClassIdentifier: - MaxVelocity: 4 + MaxVelocity: 8 ClipInput: 0 NoJumpsInMockMode: 1 TargetMovementVector: {x: 0, y: 0} diff --git a/Assets/Scenes/DreconDemo/Volume Profile.asset b/Assets/Scenes/DreconDemo/Volume Profile.asset index 9a1469d..fe3caa1 100644 --- a/Assets/Scenes/DreconDemo/Volume Profile.asset +++ b/Assets/Scenes/DreconDemo/Volume Profile.asset @@ -27,16 +27,16 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c01700fd266d6914ababb731e09af2eb, type: 3} m_Name: DepthOfField m_EditorClassIdentifier: - active: 0 + active: 1 mode: m_OverrideState: 1 m_Value: 1 gaussianStart: m_OverrideState: 1 - m_Value: 5.43 + m_Value: 5 gaussianEnd: m_OverrideState: 1 - m_Value: 10 + m_Value: 20 gaussianMaxRadius: m_OverrideState: 1 m_Value: 1.5 @@ -73,7 +73,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ccf1aba9553839d41ae37dd52e9ebcce, type: 3} m_Name: MotionBlur m_EditorClassIdentifier: - active: 0 + active: 1 mode: m_OverrideState: 0 m_Value: 0 @@ -82,7 +82,7 @@ MonoBehaviour: m_Value: 2 intensity: m_OverrideState: 1 - m_Value: 0 + m_Value: 0.106 clamp: m_OverrideState: 1 m_Value: 0.05 diff --git a/Packages/manifest.json b/Packages/manifest.json index c4c1e27..86934c0 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -7,6 +7,7 @@ "com.unity.ide.visualstudio": "2.0.18", "com.unity.ide.vscode": "1.2.5", "com.unity.jobs": "0.70.0-preview.7", + "com.unity.recorder": "4.0.2", "com.unity.render-pipelines.universal": "14.0.8", "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.6", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index c6d02ac..89d41df 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -122,6 +122,15 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.recorder": { + "version": "4.0.2", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.timeline": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.render-pipelines.core": { "version": "14.0.8", "depth": 1, diff --git a/ProjectSettings/EditorSettings.asset b/ProjectSettings/EditorSettings.asset index c8da44e..3a01328 100644 --- a/ProjectSettings/EditorSettings.asset +++ b/ProjectSettings/EditorSettings.asset @@ -3,33 +3,45 @@ --- !u!159 &1 EditorSettings: m_ObjectHideFlags: 0 - serializedVersion: 9 - m_ExternalVersionControlSupport: Visible Meta Files + serializedVersion: 12 m_SerializationMode: 2 m_LineEndingsForNewScripts: 2 m_DefaultBehaviorMode: 0 m_PrefabRegularEnvironment: {fileID: 0} m_PrefabUIEnvironment: {fileID: 0} m_SpritePackerMode: 0 + m_SpritePackerCacheSize: 10 m_SpritePackerPaddingPower: 1 + m_Bc7TextureCompressor: 0 m_EtcTextureCompressorBehavior: 1 m_EtcTextureFastCompressor: 1 m_EtcTextureNormalCompressor: 2 m_EtcTextureBestCompressor: 4 m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp m_ProjectGenerationRootNamespace: - m_CollabEditorSettings: - inProgressEnabled: 1 m_EnableTextureStreamingInEditMode: 1 m_EnableTextureStreamingInPlayMode: 1 + m_EnableEditorAsyncCPUTextureLoading: 0 m_AsyncShaderCompilation: 1 + m_PrefabModeAllowAutoSave: 1 m_EnterPlayModeOptionsEnabled: 0 m_EnterPlayModeOptions: 3 - m_ShowLightmapResolutionOverlay: 1 + m_GameObjectNamingDigits: 1 + m_GameObjectNamingScheme: 0 + m_AssetNamingUsesSpace: 1 + m_InspectorUseIMGUIDefaultInspector: 0 m_UseLegacyProbeSampleCount: 0 + m_SerializeInlineMappingsOnOneLine: 0 + m_DisableCookiesInLightmapper: 1 m_AssetPipelineMode: 1 + m_RefreshImportMode: 0 m_CacheServerMode: 0 m_CacheServerEndpoint: m_CacheServerNamespacePrefix: default m_CacheServerEnableDownload: 1 m_CacheServerEnableUpload: 1 + m_CacheServerEnableAuth: 0 + m_CacheServerEnableTls: 0 + m_CacheServerValidationMode: 2 + m_CacheServerDownloadBatchSize: 128 + m_EnableEnlightenBakedGI: 0