diff --git a/Assets/3_MarathonEnvs/Scripts/Ragdoll004/DReConRewards.cs b/Assets/3_MarathonEnvs/Scripts/Ragdoll004/DReConRewards.cs index b5777f2..44fa5b5 100644 --- a/Assets/3_MarathonEnvs/Scripts/Ragdoll004/DReConRewards.cs +++ b/Assets/3_MarathonEnvs/Scripts/Ragdoll004/DReConRewards.cs @@ -11,6 +11,7 @@ public class DReConRewards : MonoBehaviour [Header("Reward")] public float SumOfSubRewards; public float Reward; + public float m_CumulativeReward; [Header("Position Reward")] public float SumOfDistances; @@ -72,6 +73,10 @@ public class DReConRewards : MonoBehaviour public string targetedRootName = "articulation:Hips"; + // Unity Events // + public delegate void onUpdateStatDelegate(float value, int statIndex); + public static onUpdateStatDelegate m_UpdateStat; + public void OnAgentInitialize() { @@ -189,10 +194,17 @@ public class DReConRewards : MonoBehaviour // reward SumOfSubRewards = PositionReward+ComReward+PointsVelocityReward+LocalPoseReward; Reward = DistanceFactor*SumOfSubRewards; + + m_CumulativeReward += Reward; + m_UpdateStat?.Invoke(m_CumulativeReward/10f, 0); + //m_UpdateStat?.Invoke(LocalPoseReward, 1); + //m_UpdateStat?.Invoke(PointsVelocityReward, 2); + //m_UpdateStat?.Invoke(PositionReward, 3); // Reward = (DirectionFactor*SumOfSubRewards) * DistanceFactor; } public void OnReset() { + m_CumulativeReward = 0f; Assert.IsTrue(_hasLazyInitialized); _mocapBodyStats.OnReset(); diff --git a/Assets/5_Scenes/DreconDemo.unity b/Assets/5_Scenes/DreconDemo.unity index 334d8fa..6f7984e 100644 --- a/Assets/5_Scenes/DreconDemo.unity +++ b/Assets/5_Scenes/DreconDemo.unity @@ -203,6 +203,141 @@ MonoBehaviour: m_PositionUnits: 1 m_Speed: 10 m_Position: 0 +--- !u!1 &45273095 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 45273096} + - component: {fileID: 45273098} + - component: {fileID: 45273097} + m_Layer: 13 + m_Name: Stat 2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &45273096 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 45273095} + 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: 459103777} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 205, y: 916.7} + m_SizeDelta: {x: 1800, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &45273097 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 45273095} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 1 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: e43a431f01118124d8d1cf15a46635c3, type: 2} + m_sharedMaterial: {fileID: -966069743490610113, guid: e43a431f01118124d8d1cf15a46635c3, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4290576383 + m_fontColor: {r: 1, g: 1, b: 0.7372549, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 100 + m_fontSizeBase: 120 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 100 + m_fontSizeMax: 175 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: -20 + m_lineSpacing: -40 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &45273098 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 45273095} + m_CullTransparentMesh: 1 --- !u!1 &62178361 GameObject: m_ObjectHideFlags: 0 @@ -459,7 +594,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 153031623} serializedVersion: 2 - m_LocalRotation: {x: -0.000010763111, y: 0.9982297, z: 0.059476666, w: -0.000077584016} + m_LocalRotation: {x: -0.000010761081, y: 0.9982297, z: 0.059476666, w: -0.000077618104} m_LocalPosition: {x: 18.101631, y: 8.540332, z: 4.4995093} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 @@ -658,7 +793,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 98836c5e4d194524a9f515b29e1d7db1, type: 3} m_Name: m_EditorClassIdentifier: - m_Filename: {fileID: 4900000, guid: b54b804405d8bff49a578c17dac833a6, type: 3} + m_Filename: {fileID: 4900000, guid: 9bfe02abbdee42a4ba994a8df7a47a6b, type: 3} --- !u!114 &273313796 MonoBehaviour: m_ObjectHideFlags: 0 @@ -783,7 +918,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 320225263} serializedVersion: 2 - m_LocalRotation: {x: 0.3891651, y: 0.5932087, z: -0.5829446, w: 0.39601725} + m_LocalRotation: {x: 0.38916236, y: 0.5932106, z: -0.58294636, w: 0.39601454} m_LocalPosition: {x: 17.78, y: 21.78, z: 3.06} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 @@ -1108,7 +1243,7 @@ MonoBehaviour: m_BlendUpdateMethod: 1 m_DefaultBlend: m_Style: 1 - m_Time: 0 + m_Time: 3 m_CustomCurve: serializedVersion: 2 m_Curve: [] @@ -1264,6 +1399,141 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: attenuationObject: {fileID: 0} +--- !u!1 &405810717 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 405810718} + - component: {fileID: 405810720} + - component: {fileID: 405810719} + m_Layer: 13 + m_Name: Stat 4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &405810718 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 405810717} + 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: 459103777} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 605, y: 916.7} + m_SizeDelta: {x: 1800, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &405810719 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 405810717} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 1 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: e43a431f01118124d8d1cf15a46635c3, type: 2} + m_sharedMaterial: {fileID: -966069743490610113, guid: e43a431f01118124d8d1cf15a46635c3, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4290576383 + m_fontColor: {r: 1, g: 1, b: 0.7372549, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 100 + m_fontSizeBase: 120 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 100 + m_fontSizeMax: 175 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: -20 + m_lineSpacing: -40 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &405810720 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 405810717} + m_CullTransparentMesh: 1 --- !u!1 &410087039 GameObject: m_ObjectHideFlags: 0 @@ -1481,6 +1751,143 @@ MonoBehaviour: m_PointlightHDType: 0 m_SpotLightShape: 0 m_AreaLightShape: 0 +--- !u!1 &446294239 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 446294240} + - component: {fileID: 446294242} + - component: {fileID: 446294241} + m_Layer: 13 + m_Name: Stat 3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &446294240 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 446294239} + 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: 459103777} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 405, y: 916.7} + m_SizeDelta: {x: 1800, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &446294241 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 446294239} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: '1.0 + +' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: e43a431f01118124d8d1cf15a46635c3, type: 2} + m_sharedMaterial: {fileID: -966069743490610113, guid: e43a431f01118124d8d1cf15a46635c3, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4290576383 + m_fontColor: {r: 1, g: 1, b: 0.7372549, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 100 + m_fontSizeBase: 120 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 100 + m_fontSizeMax: 175 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: -20 + m_lineSpacing: -40 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &446294242 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 446294239} + m_CullTransparentMesh: 1 --- !u!1 &446396106 GameObject: m_ObjectHideFlags: 0 @@ -1560,6 +1967,46 @@ MonoBehaviour: m_Calls: [] m_LegacyBlendHint: 0 m_ComponentOwner: {fileID: 1578895885} +--- !u!1 &459103776 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 459103777} + m_Layer: 13 + m_Name: Rewards + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &459103777 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 459103776} + 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: + - {fileID: 1361807060} + - {fileID: 45273096} + - {fileID: 446294240} + - {fileID: 405810718} + - {fileID: 1261636062} + m_Father: {fileID: 951379159} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -5, y: -436.7} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1001 &489043705 PrefabInstance: m_ObjectHideFlags: 0 @@ -1700,6 +2147,55 @@ Transform: - {fileID: 1601195943} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &595798489 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 595798490} + - component: {fileID: 595798491} + m_Layer: 0 + m_Name: UI Manager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &595798490 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 595798489} + serializedVersion: 2 + 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: 760971828} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &595798491 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 595798489} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c0a7c3e427defe4418f938386d76b117, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StatText: + - {fileID: 1361807061} + - {fileID: 45273097} + - {fileID: 446294241} + - {fileID: 405810719} --- !u!4 &635122736 stripped Transform: m_CorrespondingSourceObject: {fileID: 7722778103894512693, guid: 248e74dcdf41731459e829be7f230e47, @@ -1941,6 +2437,7 @@ Transform: - {fileID: 1403332545} - {fileID: 842964162} - {fileID: 2024068565} + - {fileID: 595798490} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &766384027 @@ -2505,7 +3002,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 882491594} serializedVersion: 2 - m_LocalRotation: {x: 0.49182287, y: 0.0021121174, z: -0.00119306, w: 0.8706919} + m_LocalRotation: {x: 0.49182287, y: 0.0021121474, z: -0.001193077, w: 0.8706919} m_LocalPosition: {x: 18.100853, y: 10.155965, z: -0.48116565} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 @@ -2791,7 +3288,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!114 &951379156 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2844,7 +3341,7 @@ Canvas: m_RenderMode: 0 m_Camera: {fileID: 330585545} m_PlaneDistance: 100 - m_PixelPerfect: 0 + m_PixelPerfect: 1 m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 @@ -2867,8 +3364,8 @@ RectTransform: m_LocalScale: {x: 0, y: 0, z: 0} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 459103777} - {fileID: 2115541933} - - {fileID: 1361807060} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -3374,6 +3871,141 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1261636061 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1261636062} + - component: {fileID: 1261636064} + - component: {fileID: 1261636063} + m_Layer: 13 + m_Name: Model Number + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1261636062 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261636061} + 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: 459103777} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 75.5, y: 916.7} + m_SizeDelta: {x: 1800, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1261636063 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261636061} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 0 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: e43a431f01118124d8d1cf15a46635c3, type: 2} + m_sharedMaterial: {fileID: -966069743490610113, guid: e43a431f01118124d8d1cf15a46635c3, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4290576383 + m_fontColor: {r: 1, g: 1, b: 0.7372549, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 100 + m_fontSizeBase: 120 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 100 + m_fontSizeMax: 175 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: -20 + m_lineSpacing: -40 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1261636064 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261636061} + m_CullTransparentMesh: 1 --- !u!1 &1327997888 GameObject: m_ObjectHideFlags: 0 @@ -3460,8 +4092,8 @@ GameObject: - component: {fileID: 1361807060} - component: {fileID: 1361807062} - component: {fileID: 1361807061} - m_Layer: 5 - m_Name: Model + m_Layer: 13 + m_Name: Stat 1 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -3474,16 +4106,16 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1361807059} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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: 951379159} + m_Father: {fileID: 459103777} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 430} + m_AnchoredPosition: {x: 5, y: 916.7} m_SizeDelta: {x: 1800, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1361807061 @@ -3506,9 +4138,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: '900,0000 - - 1.00' + m_text: 12.457 m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: e43a431f01118124d8d1cf15a46635c3, type: 2} m_sharedMaterial: {fileID: -966069743490610113, guid: e43a431f01118124d8d1cf15a46635c3, @@ -4471,7 +5101,7 @@ MonoBehaviour: m_PivotOffset: {x: 0, y: 0, z: 0} m_AmplitudeGain: 0.5 m_FrequencyGain: 0.1 - mNoiseOffsets: {x: 0, y: 0, z: 0} + mNoiseOffsets: {x: -11.757019, y: -299.61145, z: -901.43494} --- !u!114 &1795712170 MonoBehaviour: m_ObjectHideFlags: 3 @@ -5019,7 +5649,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1955078056} serializedVersion: 2 - m_LocalRotation: {x: 0.7004388, y: -0.026130881, z: 0.025700254, w: 0.7127709} + m_LocalRotation: {x: 0.700439, y: -0.026124025, z: 0.025693517, w: 0.7127711} m_LocalPosition: {x: 18.102207, y: 11.040333, z: -0.5004903} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 @@ -5073,10 +5703,10 @@ MonoBehaviour: m_EditorClassIdentifier: m_Everything: serializedVersion: 2 - m_Bits: 8063 + m_Bits: 16255 m_Agent: serializedVersion: 2 - m_Bits: 3199 + m_Bits: 11391 m_Bodies: serializedVersion: 2 m_Bits: 1335 @@ -5085,7 +5715,8 @@ MonoBehaviour: m_Bits: 3135 m_Actuations: serializedVersion: 2 - m_Bits: 5175 + m_Bits: 13367 + m_Rewards: {fileID: 459103776} m_CameraBlendMin: 3 m_CameraBlendMax: 4 m_CameraSwapMin: 7 @@ -12010,6 +12641,7 @@ MonoBehaviour: m_EditorClassIdentifier: SumOfSubRewards: 0 Reward: 0 + m_CumulativeReward: 0 SumOfDistances: 0 SumOfSqrDistances: 0 PositionReward: 0 diff --git a/Assets/8_Scripts/1_Managers/CameraManager.cs b/Assets/8_Scripts/1_Managers/CameraManager.cs index 6d1c204..f913d51 100644 --- a/Assets/8_Scripts/1_Managers/CameraManager.cs +++ b/Assets/8_Scripts/1_Managers/CameraManager.cs @@ -26,6 +26,9 @@ public class CameraManager : MonoBehaviour public LayerMask m_Environment; public LayerMask m_Actuations; + [Header("Text Objects")] + public GameObject m_Rewards; + [Header("Camera Settings")] [Range(2, 20)] public int m_CameraBlendMin; @@ -107,15 +110,19 @@ public class CameraManager : MonoBehaviour { case "vc_Agent": m_Camera.cullingMask = m_Agent; + m_Rewards.SetActive(true); break; case "vc_Body": m_Camera.cullingMask = m_Bodies; + m_Rewards.SetActive(false); break; case "vc_Environment": m_Camera.cullingMask = m_Environment; + m_Rewards.SetActive(false); break; case "vc_Actuations": m_Camera.cullingMask = m_Actuations; + m_Rewards.SetActive(true); break; } diff --git a/Assets/8_Scripts/1_Managers/Model Manager.cs b/Assets/8_Scripts/1_Managers/Model Manager.cs new file mode 100644 index 0000000..e9d85c0 --- /dev/null +++ b/Assets/8_Scripts/1_Managers/Model Manager.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Collections.Generic; +using Unity.MLAgents.Policies; +using UnityEngine; + +public class ModelManager : MonoBehaviour +{ + [SerializeField] + public string m_ModelName; + + private BehaviorParameters m_Parameters; + + // Unity Events // + public delegate void onUpdateModelNameDelegate(string modelName); + public static onUpdateModelNameDelegate m_UpdateModelName; + private void OnEnable() + { + m_Parameters = GetComponent(); + } + + private void FixedUpdate() + { + if (m_Parameters != null) + { + m_ModelName = m_Parameters.Model.name; + m_UpdateModelName?.Invoke(m_ModelName); + } + } +} diff --git a/Assets/8_Scripts/1_Managers/Model Manager.cs.meta b/Assets/8_Scripts/1_Managers/Model Manager.cs.meta new file mode 100644 index 0000000..cc99831 --- /dev/null +++ b/Assets/8_Scripts/1_Managers/Model Manager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: af36152b9449197449b578448c25b741 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/8_Scripts/1_Managers/NarrationManager.cs b/Assets/8_Scripts/1_Managers/NarrationManager.cs index a75cfec..435fb45 100644 --- a/Assets/8_Scripts/1_Managers/NarrationManager.cs +++ b/Assets/8_Scripts/1_Managers/NarrationManager.cs @@ -80,11 +80,11 @@ public class NarrationManager : MonoBehaviour // Increments to next index in list, and updates UI. void updateSubtitle() { - m_ScriptIndex++; if (m_ScriptIndex == m_scriptSlices.Count) m_ScriptIndex = 0; CalculateVariableWaitTime(m_scriptSlices[m_ScriptIndex]); DisplayText(m_scriptSlices[m_ScriptIndex]); + m_ScriptIndex++; StartCoroutine(SubtitleWait()); } diff --git a/Assets/8_Scripts/1_Managers/UIManager.cs b/Assets/8_Scripts/1_Managers/UIManager.cs new file mode 100644 index 0000000..baeab4e --- /dev/null +++ b/Assets/8_Scripts/1_Managers/UIManager.cs @@ -0,0 +1,44 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using TMPro; + +public class UIManager : MonoBehaviour +{ + [Header("Stat Text Objects")] + public List m_StatText; + + public TMP_Text m_ModelNameText; + + private void OnEnable() + { + DReConRewards.m_UpdateStat += UpdateStatText; + ModelManager.m_UpdateModelName += UpdateModelName; + } + + private void OnDisable() + { + DReConRewards.m_UpdateStat -= UpdateStatText; + ModelManager.m_UpdateModelName -= UpdateModelName; + } + + private void UpdateStatText(float reward, int statIndex) + { + try + { + m_StatText[statIndex].text = reward.ToString("#.000"); + } + catch + { + Debug.LogError($"Text object did not exist index: {statIndex}"); + } + } + + private void UpdateModelName(string modelName) + { + if( m_ModelNameText != null ) + { + m_ModelNameText.text = modelName; + } + } +} diff --git a/Assets/8_Scripts/1_Managers/UIManager.cs.meta b/Assets/8_Scripts/1_Managers/UIManager.cs.meta new file mode 100644 index 0000000..9cd1680 --- /dev/null +++ b/Assets/8_Scripts/1_Managers/UIManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0a7c3e427defe4418f938386d76b117 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/8_Scripts/3_Script/Howl Short Test.txt b/Assets/8_Scripts/3_Script/Howl Short Test.txt new file mode 100644 index 0000000..519b28d --- /dev/null +++ b/Assets/8_Scripts/3_Script/Howl Short Test.txt @@ -0,0 +1,2 @@ +what sphinx of cement and aluminum bashed open their skulls and ate up their brains and imagination? +moloch \ No newline at end of file diff --git a/Assets/8_Scripts/3_Script/Howl Short Test.txt.meta b/Assets/8_Scripts/3_Script/Howl Short Test.txt.meta new file mode 100644 index 0000000..de55799 --- /dev/null +++ b/Assets/8_Scripts/3_Script/Howl Short Test.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9bfe02abbdee42a4ba994a8df7a47a6b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ML-Agents/Timers/DreconDemo_timers.json b/Assets/ML-Agents/Timers/DreconDemo_timers.json index 4ce59a1..542538f 100644 --- a/Assets/ML-Agents/Timers/DreconDemo_timers.json +++ b/Assets/ML-Agents/Timers/DreconDemo_timers.json @@ -1 +1 @@ -{"count":1,"self":89.022976,"total":91.5332865,"children":{"InitializeActuators":{"count":1,"self":0.0009996,"total":0.0009996,"children":null},"InitializeSensors":{"count":1,"self":0.0010000999999999999,"total":0.0010000999999999999,"children":null},"AgentSendState":{"count":5120,"self":0.0254454,"total":0.6623137,"children":{"CollectObservations":{"count":2560,"self":0.61879469999999992,"total":0.61879469999999992,"children":null},"WriteActionMask":{"count":2560,"self":0.0025134999999999997,"total":0.0025134999999999997,"children":null},"RequestDecision":{"count":2560,"self":0.015560099999999999,"total":0.015560099999999999,"children":null}}},"DecideAction":{"count":5120,"self":1.0943142,"total":1.0943142,"children":null},"AgentAct":{"count":5120,"self":0.7506809,"total":0.7506809,"children":null}},"gauges":{"DReCon-v0.CumulativeReward":{"count":1,"max":81.79638,"min":81.79638,"runningAverage":81.79638,"value":81.79638,"weightedAverage":81.79638}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1713535872","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 35e1e307-bed6-45f6-bd2e-ffedcc836cc6 -accessToken 0lRu6csHJ34cbzvP-Bp73LSli6WheMXxZCca1Jo9JP8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1713535964"}} \ No newline at end of file +{"count":1,"self":69.959808,"total":71.912097899999992,"children":{"InitializeActuators":{"count":1,"self":0.0009989,"total":0.0009989,"children":null},"InitializeSensors":{"count":1,"self":0.0010052,"total":0.0010052,"children":null},"AgentSendState":{"count":3942,"self":0.0166721,"total":0.4865961,"children":{"CollectObservations":{"count":1971,"self":0.45088469999999997,"total":0.45088469999999997,"children":null},"WriteActionMask":{"count":1971,"self":0.0030042999999999997,"total":0.0030042999999999997,"children":null},"RequestDecision":{"count":1971,"self":0.016035,"total":0.016035,"children":null}}},"DecideAction":{"count":3942,"self":0.8178881,"total":0.8178881,"children":null},"AgentAct":{"count":3942,"self":0.64580149999999992,"total":0.64580149999999992,"children":null}},"gauges":{"DReCon-v0.CumulativeReward":{"count":2,"max":247.057678,"min":79.2546539,"runningAverage":163.156158,"value":247.057678,"weightedAverage":121.205414}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714389274","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 9b433f92-5c93-446a-923f-743ea7173ebf -accessToken EpS5BrO4ecWgDnIKinrxODUmKDNMMpqYHpQjzvf9aho005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1714389346"}} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset b/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset index 9f2a433..ff21a4b 100644 --- a/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset +++ b/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset @@ -451,13 +451,13 @@ MonoBehaviour: m_Name: FMODStudioSettings m_EditorClassIdentifier: switchSettingsMigration: 1 - HasSourceProject: 1 - HasPlatforms: 1 + HasSourceProject: 0 + HasPlatforms: 0 sourceProjectPath: ../moloch/moloch.fspro - sourceBankPath: ../moloch/Build + sourceBankPath: FMOD Banks/Desktop sourceBankPathUnformatted: - BankRefreshCooldown: 1 - ShowBankRefreshWindow: 0 + BankRefreshCooldown: 5 + ShowBankRefreshWindow: 1 AutomaticEventLoading: 1 BankLoadType: 0 AutomaticSampleLoading: 0 diff --git a/FMOD Banks/Desktop/Music.bank b/FMOD Banks/Desktop/Music.bank index 66b1073..e35a4a9 100644 Binary files a/FMOD Banks/Desktop/Music.bank and b/FMOD Banks/Desktop/Music.bank differ diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 0b1b16b..13bce1e 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -22,7 +22,7 @@ TagManager: - VFX - Camera Ground - Actuations - - + - UI Stat - - -