浏览代码

add actuated sensors & rbsensor

/develop/soccer-groupman/mod/hunter
HH 4 年前
当前提交
02ac5091
共有 8 个文件被更改,包括 1315 次插入334 次删除
  1. 422
      Project/Assets/ML-Agents/Examples/Soccer/Prefabs/BlueStriker.prefab
  2. 211
      Project/Assets/ML-Agents/Examples/Soccer/Prefabs/PurpleStriker.prefab
  3. 806
      Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab
  4. 74
      Project/Assets/ML-Agents/Examples/Soccer/Scenes/SoccerTwos.unity
  5. 60
      Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs
  6. 6
      Project/Assets/ML-Agents/Examples/Soccer/TFModels/SoccerTwos-14999860.onnx.meta
  7. 14
      Project/Assets/ML-Agents/Examples/Soccer/TFModels/SoccerTwos-30999978.onnx.meta
  8. 56
      config/poca/Soccer.yaml

422
Project/Assets/ML-Agents/Examples/Soccer/Prefabs/BlueStriker.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &161301779983801904
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3084142930283604803}
- component: {fileID: 7893899253060053071}
m_Layer: 10
m_Name: RaySensorBlueAgents
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &3084142930283604803
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 161301779983801904}
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_Children: []
m_Father: {fileID: 6033637986218926083}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7893899253060053071
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 161301779983801904}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: TeammateBlueRayPerceptionSensor
m_DetectableTags:
- blueAgent
m_RaysPerDirection: 12
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 1331
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!1 &922446411616811097
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4534212122170701232}
- component: {fileID: 1691792984321538705}
m_Layer: 10
m_Name: RaySensorPurpleAgents
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &4534212122170701232
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 922446411616811097}
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_Children: []
m_Father: {fileID: 6033637986218926083}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1691792984321538705
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 922446411616811097}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: OpponentBlueRayPerceptionSensor
m_DetectableTags:
- purpleAgent
m_RaysPerDirection: 12
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 2355
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!1 &3555807687982913070
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2154900239737326374}
- component: {fileID: 3847391541845119253}
m_Layer: 10
m_Name: RaySensorBall
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &2154900239737326374
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3555807687982913070}
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_Children: []
m_Father: {fileID: 6033637986218926083}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3847391541845119253
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3555807687982913070}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: BallBlueRayPerceptionSensor
m_DetectableTags:
- ball
m_RaysPerDirection: 20
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 819
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!1 &4271663842289902626
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6903292148076757099}
- component: {fileID: 3343228272183200124}
m_Layer: 10
m_Name: RaySensorEverything
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6903292148076757099
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4271663842289902626}
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_Children: []
m_Father: {fileID: 6033637986218926083}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3343228272183200124
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4271663842289902626}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: BlueRayPerceptionSensor
m_DetectableTags:
- ball
- blueGoal
- purpleGoal
- wall
- blueAgent
- purpleAgent
m_RaysPerDirection: 16
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 3585
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!1 &6030327595305340077
GameObject:
m_ObjectHideFlags: 0

- component: {fileID: 5921112085002027199}
- component: {fileID: 6208698791010987259}
- component: {fileID: 2699369445970917263}
- component: {fileID: 5918526098337498759}
- component: {fileID: 6166895040598452978}
- component: {fileID: 5154235608112411214}
- component: {fileID: 4580724097406181005}
- component: {fileID: 1575060282611693468}
m_Layer: 10
m_Name: BlueStriker
m_TagString: blueAgent

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 6027426712508094869}
- {fileID: 4544914441785437329}
- {fileID: 3084142930283604803}
- {fileID: 4534212122170701232}
- {fileID: 8718814957555716854}
- {fileID: 2154900239737326374}
- {fileID: 6903292148076757099}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 0
VectorObservationSize: 2
m_NumContinuousActions: 3
m_NumContinuousActions: 5
VectorActionSize: 03000000
VectorActionSize: 05000000
VectorActionDescriptions: []
VectorActionSpaceType: 1
hasUpgradedBrainParametersWithActionSpec: 1

agentRb: {fileID: 0}
initialPos: {x: 0, y: 0, z: 0}
rotSign: 0
UseVectorObs: 1
UseActuatedRaycastSensor: 1
RaySensor: {fileID: 3343228272183200124}
MinMaxRayAngles: {x: 25, y: 160}
MinMaxSpherecastRadius: {x: 0.25, y: 1}
CurrentRayAngleLerp: 0.5
CurrentSpherecastRadiusLerp: 0.5
--- !u!114 &6208698791010987259
MonoBehaviour:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
debugCommandLineOverride:
--- !u!114 &5918526098337498759
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6030327595305340077}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: BallBlueRayPerceptionSensor
m_DetectableTags:
- ball
m_RaysPerDirection: 20
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 819
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!114 &6166895040598452978
--- !u!114 &1575060282611693468
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}

m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Script: {fileID: 11500000, guid: df0f8be9a37d6486498061e2cbc4cd94, type: 3}
m_SensorName: TeammateBlueRayPerceptionSensor
m_DetectableTags:
- blueAgent
m_RaysPerDirection: 12
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 1331
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!114 &5154235608112411214
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6030327595305340077}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: OpponentBlueRayPerceptionSensor
m_DetectableTags:
- purpleAgent
m_RaysPerDirection: 12
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 2355
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!114 &4580724097406181005
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6030327595305340077}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: WallBlueRayPerceptionSensor
m_DetectableTags:
- wall
- blueGoal
- purpleGoal
m_RaysPerDirection: 5
m_MaxRayDegrees: 90
m_SphereCastRadius: 0.5
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 307
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
RootBody: {fileID: 6013994672817233831}
VirtualRoot: {fileID: 6030327595305340077}
Settings:
UseModelSpaceTranslations: 0
UseModelSpaceRotations: 0
UseLocalSpaceTranslations: 1
UseLocalSpaceRotations: 1
UseModelSpaceLinearVelocity: 0
UseLocalSpaceLinearVelocity: 1
UseJointPositionsAndAngles: 0
UseJointForces: 0
sensorName: RBSensor
--- !u!1 &6030755009428851883
GameObject:
m_ObjectHideFlags: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &7803096889037966710
--- !u!1 &8202368685770303340
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}

m_Component:
- component: {fileID: 4544914441785437329}
- component: {fileID: 7531414272779648763}
- component: {fileID: 8718814957555716854}
- component: {fileID: 1256050638380047572}
m_Name: BlueReverseRays
m_TagString: blueAgent
m_Name: RaySensorEnv
m_TagString: Untagged
m_IsActive: 1
--- !u!4 &4544914441785437329
m_IsActive: 0
--- !u!4 &8718814957555716854
m_GameObject: {fileID: 7803096889037966710}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: -0, y: 0, z: 0}
m_GameObject: {fileID: 8202368685770303340}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!114 &7531414272779648763
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1256050638380047572
m_GameObject: {fileID: 7803096889037966710}
m_GameObject: {fileID: 8202368685770303340}
m_SensorName: BackBlueRayPerceptionSensor
m_SensorName: WallBlueRayPerceptionSensor
m_RaysPerDirection: 1
m_MaxRayDegrees: 20
m_RaysPerDirection: 5
m_MaxRayDegrees: 90
m_SphereCastRadius: 0.5
m_RayLength: 60
m_RayLayerMask:

211
Project/Assets/ML-Agents/Examples/Soccer/Prefabs/PurpleStriker.prefab


m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &3012430755271482569
Transform:
m_ObjectHideFlags: 0

rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!1 &2284490826287028057
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2223814564048225530}
- component: {fileID: 7946483855019906744}
m_Layer: 11
m_Name: RaySensorEverything
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2223814564048225530
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2284490826287028057}
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_Children: []
m_Father: {fileID: 8274065550969517594}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7946483855019906744
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2284490826287028057}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: PurpleRayPerceptionSensor
m_DetectableTags:
- ball
- purpleGoal
- blueGoal
- wall
- purpleAgent
- blueAgent
m_RaysPerDirection: 16
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 3585
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!1 &8275516613532996228
GameObject:
m_ObjectHideFlags: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

- component: {fileID: 8307613324337731416}
- component: {fileID: 997902657987214240}
- component: {fileID: 8775384753860522886}
- component: {fileID: 8307581884824213156}
- component: {fileID: 613782037252311925}
- component: {fileID: 4520953910130910384}
- component: {fileID: 8862605692950166824}
- component: {fileID: 2187050942640912814}
m_Layer: 11
m_Name: PurpleStriker
m_TagString: purpleAgent

m_Children:
- {fileID: 8272111360709471126}
- {fileID: 3012430755271482569}
- {fileID: 2223814564048225530}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0}

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 0
VectorObservationSize: 2
m_NumContinuousActions: 3
m_NumContinuousActions: 5
VectorActionSize: 03000000
VectorActionSize: 05000000
VectorActionDescriptions: []
VectorActionSpaceType: 1
hasUpgradedBrainParametersWithActionSpec: 1

agentRb: {fileID: 0}
initialPos: {x: 0, y: 0, z: 0}
rotSign: 0
UseVectorObs: 1
UseActuatedRaycastSensor: 1
RaySensor: {fileID: 7946483855019906744}
MinMaxRayAngles: {x: 25, y: 160}
MinMaxSpherecastRadius: {x: 0.25, y: 1}
CurrentRayAngleLerp: 0.5
CurrentSpherecastRadiusLerp: 0.5
--- !u!114 &997902657987214240
MonoBehaviour:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
debugCommandLineOverride:
--- !u!114 &8307581884824213156
--- !u!114 &2187050942640912814
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}

m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Script: {fileID: 11500000, guid: df0f8be9a37d6486498061e2cbc4cd94, type: 3}
m_SensorName: BallPurpleRayPerceptionSensor
m_DetectableTags:
- ball
m_RaysPerDirection: 20
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 819
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!114 &613782037252311925
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8277532713597140832}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: TeammatePurpleRayPerceptionSensor
m_DetectableTags:
- purpleAgent
m_RaysPerDirection: 12
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 2355
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!114 &4520953910130910384
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8277532713597140832}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: OpponentPurpleRayPerceptionSensor
m_DetectableTags:
- blueAgent
m_RaysPerDirection: 12
m_MaxRayDegrees: 160
m_SphereCastRadius: 1
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 1331
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
--- !u!114 &8862605692950166824
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8277532713597140832}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SensorName: WallPurpleRayPerceptionSensor
m_DetectableTags:
- wall
- purpleGoal
- blueGoal
m_RaysPerDirection: 5
m_MaxRayDegrees: 90
m_SphereCastRadius: 0.5
m_RayLength: 60
m_RayLayerMask:
serializedVersion: 2
m_Bits: 307
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}
m_StartVerticalOffset: 0.5
m_EndVerticalOffset: 0.5
RootBody: {fileID: 8222804916546358778}
VirtualRoot: {fileID: 8277532713597140832}
Settings:
UseModelSpaceTranslations: 0
UseModelSpaceRotations: 0
UseLocalSpaceTranslations: 1
UseLocalSpaceRotations: 1
UseModelSpaceLinearVelocity: 0
UseLocalSpaceLinearVelocity: 1
UseJointPositionsAndAngles: 0
UseJointForces: 0
sensorName: RBSensor
--- !u!1 &8277538618770863586
GameObject:
m_ObjectHideFlags: 0

m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2

806
Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab
文件差异内容过多而无法显示
查看文件

74
Project/Assets/ML-Agents/Examples/Soccer/Scenes/SoccerTwos.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.449714, g: 0.49977934, b: 0.575638, a: 1}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:

m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 12
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024

m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 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_PVREnvironmentMIS: 0
m_PVRFilteringMode: 2
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5

m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 112000002, guid: 03723c7f910c3423aa1974f1b9ce8392,
type: 2}
m_UseShadowmask: 1

m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &255077125
MonoBehaviour:
m_ObjectHideFlags: 0

m_GameObject: {fileID: 255077123}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Script: {fileID: 0}
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 5
--- !u!4 &255077126
Transform:
m_ObjectHideFlags: 0

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1537641056927260, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114595077744033850, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_Pivot.x

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_RootOrder

value: SoccerFieldTwos
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}

- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.x

- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalEulerAnglesHint.x

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 114559182131992928, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
--- !u!1 &1009000883
GameObject:

m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_RootOrder

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_RootOrder

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_RootOrder

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_RootOrder

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_RootOrder

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_RootOrder

60
Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs


using UnityEngine;
using System.Collections.Generic;
using Unity.MLAgents.Sensors;
using Unity.MLAgents.Policies;
public enum Team

public float rotSign;
EnvironmentParameters m_ResetParams;
[Header("ACTUATED RAY SENSOR")]
//Actuated RayS
public bool UseVectorObs = true;
public bool UseActuatedRaycastSensor = false;
// public List<RayPerceptionSensorComponent3D> RaySensorsList = new List<RayPerceptionSensorComponent3D>();
public RayPerceptionSensorComponent3D RaySensor;
public Vector2 MinMaxRayAngles = new Vector2(25, 120);
public Vector2 MinMaxSpherecastRadius = new Vector2(.25f, 1);
public float CurrentRayAngleLerp = .5f;
public float CurrentSpherecastRadiusLerp = .5f;
public override void Initialize()
{

m_ResetParams = Academy.Instance.EnvironmentParameters;
}
public override void CollectObservations(VectorSensor sensor)
{
if (UseVectorObs)
{
// // sensor.AddObservation((float)StepCount / (float)MaxStep); //Helps with credit assign?
// sensor.AddObservation(ThrowController.coolDownWait); //Held DBs Normalized
// sensor.AddObservation((float)currentNumberOfBalls/4); //Held DBs Normalized
// // sensor.AddObservation((float)HitPointsRemaining/(float)NumberOfTimesPlayerCanBeHit); //Remaining Hit Points Normalized
// sensor.AddObservation((float)HitPointsRemaining/(float)m_GameController.PlayerMaxHitPoints); //Remaining Hit Points Normalized
// sensor.AddObservation(Vector3.Dot(m_AgentRb.velocity, m_AgentRb.transform.forward)); //forward speed
// sensor.AddObservation(Vector3.Dot(m_AgentRb.velocity, m_AgentRb.transform.right)); //lateral speed
// sensor.AddObservation(m_AgentRb.angularVelocity);
if (UseActuatedRaycastSensor)
{
sensor.AddObservation(CurrentRayAngleLerp);
sensor.AddObservation(CurrentSpherecastRadiusLerp);
}
}
}
public void UpdateSensors()
{
}
public void MoveAgent(ActionSegment<float> act)
{
var dirToGo = Vector3.zero;

dirToGo += transform.right * right * m_LateralSpeed;
rotateDir = -transform.up * rotate * m_RotateSpeed;
// ACTUATED SENSOR STUFF
CurrentRayAngleLerp = (act[3] + 1)/2;
CurrentSpherecastRadiusLerp = (act[4] + 1)/2;
if (UseActuatedRaycastSensor)
{
RaySensor.MaxRayDegrees = Mathf.Lerp(MinMaxRayAngles.x, MinMaxRayAngles.y, CurrentRayAngleLerp);
RaySensor.SphereCastRadius = Mathf.Lerp(MinMaxSpherecastRadius.x, MinMaxSpherecastRadius.y, CurrentSpherecastRadiusLerp);
// foreach (var item in RaySensorsList)
// {
// item.MaxRayDegrees = Mathf.Lerp(MinMaxRayAngles.x, MinMaxRayAngles.y, CurrentRayAngleLerp);
// item.SphereCastRadius = Mathf.Lerp(MinMaxSpherecastRadius.x, MinMaxSpherecastRadius.y, CurrentSpherecastRadiusLerp);
// }
}
}
public override void OnActionReceived(ActionBuffers actionBuffers)

6
Project/Assets/ML-Agents/Examples/Soccer/TFModels/SoccerTwos-14999860.onnx.meta


fileFormatVersion: 2
guid: 564bcbe7c3d62405da7bc6d3b6942309
ScriptedImporter:
internalIDToNameTable: []
fileIDToRecycleName:
11400000: main obj
11400002: model data
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:

treatErrorsAsWarnings: 0
importMode: 1

14
Project/Assets/ML-Agents/Examples/Soccer/TFModels/SoccerTwos-30999978.onnx.meta


fileFormatVersion: 2
guid: 35a8ece9976644fb09a36594f3dfab69
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3}
optimizeModel: 1
forceArbitraryBatchSize: 1
treatErrorsAsWarnings: 0

56
config/poca/Soccer.yaml


behaviors:
SoccerTwos:
trainer_type: poca
hyperparameters:
batch_size: 2048
buffer_size: 20480
learning_rate: 0.0003
beta: 0.01
epsilon: 0.2
lambd: 0.95
num_epoch: 3
learning_rate_schedule: constant
network_settings:
normalize: false
hidden_units: 512
num_layers: 2
vis_encode_type: simple
reward_signals:
extrinsic:
gamma: 0.99
strength: 1.0
keep_checkpoints: 5
max_steps: 100000000
time_horizon: 1000
summary_freq: 10000
threaded: false
self_play:
save_steps: 50000
team_change: 200000
swap_steps: 2000
window: 10
play_against_latest_model_ratio: 0.5
initial_elo: 1200.0
environment_parameters:
ball_touch:
curriculum:
- name: Lesson0 # The '-' is important as this is a list
completion_criteria:
measure: progress
behavior: SoccerTwos
signal_smoothing: true
min_lesson_length: 100
threshold: 0.01
value: 1.0
- name: Lesson1 # The '-' is important as this is a list
completion_criteria:
measure: progress
behavior: SoccerTwos
signal_smoothing: true
min_lesson_length: 100
threshold: 0.02
value: 0.5
- name: Lesson2 # The '-' is important as this is a list
value: 0.0
#env_settings:
# num_envs: 3
正在加载...
取消
保存