浏览代码

final training done. ready to go.

/hh-develop-all-posed-characters
bhh 5 年前
当前提交
1ecc8924
共有 5 个文件被更改,包括 244 次插入1323 次删除
  1. 332
      Project/Assets/ML-Agents/Examples/Worm/Prefabs/PlatformWormStaticTarget.prefab
  2. 211
      Project/Assets/ML-Agents/Examples/Worm/Scenes/WormDynamicTarget.unity
  3. 932
      Project/Assets/ML-Agents/Examples/Worm/Scenes/WormStaticTarget.unity
  4. 88
      Project/Assets/ML-Agents/Examples/Worm/Scripts/WormAgent.cs
  5. 4
      config/trainer_config.yaml

332
Project/Assets/ML-Agents/Examples/Worm/Prefabs/PlatformWormStaticTarget.prefab


m_Component:
- component: {fileID: 6159098657755358046}
m_Layer: 0
m_Name: StaticTargetWorm
m_Name: PlatformWormStaticTarget
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_Children:
- {fileID: 6154083967640940648}
- {fileID: 6153654619654777566}
- {fileID: 8157993330123722724}
- {fileID: 1440213860184461585}
- {fileID: 9068231799831062525}
m_Father: {fileID: 0}
m_RootOrder: 0

- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_RootOrder
value: 4
value: 2
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}

type: 3}
m_PrefabInstance: {fileID: 3009069707527495055}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &5180866707155577699
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 6159098657755358046}
m_Modifications:
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_LocalPosition.x
value: -400
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_LocalPosition.y
value: 3.86
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980403, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_Name
value: WormBasePrefab Remade
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980403, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980406, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_BrainParameters.vectorObservationSize
value: 57
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980406, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_BehaviorName
value: WormStatic
objectReference: {fileID: 0}
- target: {fileID: 6060305997115980406, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 30738a3f6868a41b6ad10649fd8eb443,
type: 3}
- target: {fileID: 6060305997115980407, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: target
value:
objectReference: {fileID: 6153654619654777566}
- target: {fileID: 6060305997115980407, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: ground
value:
objectReference: {fileID: 6154042827339560612}
- target: {fileID: 6060305997115980407, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: targetIsStatic
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6060305997219920622, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: 0.2890001
objectReference: {fileID: 0}
- target: {fileID: 6060305997219920622, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.6479937
objectReference: {fileID: 0}
- target: {fileID: 6060305997253355877, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -2.1862854e-14
objectReference: {fileID: 0}
- target: {fileID: 6060305997253355877, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.7537963
objectReference: {fileID: 0}
- target: {fileID: 6060305998013033665, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -6.663004e-14
objectReference: {fileID: 0}
- target: {fileID: 6060305998013033665, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.7496134
objectReference: {fileID: 0}
- target: {fileID: 6060305998013033665, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.00048619506
objectReference: {fileID: 0}
- target: {fileID: 6060305998100557857, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -0.27000007
objectReference: {fileID: 0}
- target: {fileID: 6060305998100557857, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.59799176
objectReference: {fileID: 0}
- target: {fileID: 6060305998293381317, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -7.799574e-14
objectReference: {fileID: 0}
- target: {fileID: 6060305998293381317, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.7379877
objectReference: {fileID: 0}
- target: {fileID: 6060305998293381317, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.00074179325
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 474c1571fc3d34e85a958dcb97ba350f, type: 3}
--- !u!4 &1440213860184461585 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6060305997115980402, guid: 474c1571fc3d34e85a958dcb97ba350f,
type: 3}
m_PrefabInstance: {fileID: 5180866707155577699}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &6193783337108477685
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 6159098657755358046}
m_Modifications:
- target: {fileID: 2649170551576466342, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.00074179325
objectReference: {fileID: 0}
- target: {fileID: 2649170551576466342, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -7.799574e-14
objectReference: {fileID: 0}
- target: {fileID: 2649170551576466342, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.7379877
objectReference: {fileID: 0}
- target: {fileID: 2649170551786296130, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: 0.5980294
objectReference: {fileID: 0}
- target: {fileID: 2649170551786296130, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.13707508
objectReference: {fileID: 0}
- target: {fileID: 2649170551786296130, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -0.36724865
objectReference: {fileID: 0}
- target: {fileID: 2649170551908224930, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.7496134
objectReference: {fileID: 0}
- target: {fileID: 2649170551908224930, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.00048619506
objectReference: {fileID: 0}
- target: {fileID: 2649170551908224930, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -6.663004e-14
objectReference: {fileID: 0}
- target: {fileID: 2649170552616552966, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -2.9737416e-14
objectReference: {fileID: 0}
- target: {fileID: 2649170552616552966, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.7537961
objectReference: {fileID: 0}
- target: {fileID: 2649170552649963917, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: 0.39309213
objectReference: {fileID: 0}
- target: {fileID: 2649170552649963917, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: 0.6480085
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709584, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_Name
value: WormStaticVariantPrefab
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709584, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_LocalPosition.x
value: -400
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_LocalPosition.y
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2649170552749709588, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: ground
value:
objectReference: {fileID: 6154042827339560612}
- target: {fileID: 2649170552749709588, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
propertyPath: target
value:
objectReference: {fileID: 6153654619654777566}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ec8fea3f438ca4104948c55004dad23e, type: 3}
--- !u!4 &8157993330123722724 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2649170552749709585, guid: ec8fea3f438ca4104948c55004dad23e,
type: 3}
m_PrefabInstance: {fileID: 6193783337108477685}
m_PrefabAsset: {fileID: 0}

211
Project/Assets/ML-Agents/Examples/Worm/Scenes/WormDynamicTarget.unity


m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -0.27001014
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: 0.28900146
objectReference: {fileID: 0}
- target: {fileID: 7516351800607109742, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_Name

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6381221600546481521, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.73800296
objectReference: {fileID: 0}
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -0.2699984
objectReference: {fileID: 0}
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.59799767
objectReference: {fileID: 0}
- target: {fileID: 6381221600826571125, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.7495971
objectReference: {fileID: 0}
- target: {fileID: 6381221601586314449, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.7538019
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: 0.28900146
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.6479996
objectReference: {fileID: 0}
- target: {fileID: 7516351800607109742, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_Name

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6381221600546481521, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.73800296
objectReference: {fileID: 0}
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.59799767
objectReference: {fileID: 0}
- target: {fileID: 6381221600826571125, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.7495971
objectReference: {fileID: 0}
- target: {fileID: 6381221601586314449, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.7538019
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.6479996
objectReference: {fileID: 0}
- target: {fileID: 7516351800607109742, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_Name

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -0.27001014
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: 0.28900146
objectReference: {fileID: 0}
- target: {fileID: 7516351800607109742, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_Name

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -0.2699984
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: 0.28900146
objectReference: {fileID: 0}
- target: {fileID: 7516351800607109742, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_Name

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6381221600546481521, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.73800296
objectReference: {fileID: 0}
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -0.27001014
objectReference: {fileID: 0}
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.59799767
objectReference: {fileID: 0}
- target: {fileID: 6381221600826571125, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.7495971
objectReference: {fileID: 0}
- target: {fileID: 6381221601586314449, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.7538019
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: 0.28900146
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.6479996
objectReference: {fileID: 0}
- target: {fileID: 7516351800607109742, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_Name

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6381221600546481521, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.73800296
objectReference: {fileID: 0}
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -0.2699984
objectReference: {fileID: 0}
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.59799767
objectReference: {fileID: 0}
- target: {fileID: 6381221600826571125, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.7495971
objectReference: {fileID: 0}
- target: {fileID: 6381221601586314449, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.7538019
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: 0.28900146
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.6479996
objectReference: {fileID: 0}
- target: {fileID: 7516351800607109742, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_Name

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1392866527}
m_LocalRotation: {x: 0.15746945, y: -0.49537456, z: 0.09181954, w: 0.84933895}
m_LocalPosition: {x: 13.24, y: 9.66, z: -9.2}
m_LocalRotation: {x: 0.15304591, y: -0.6903456, z: 0.15304591, w: 0.6903456}
m_LocalPosition: {x: 15, y: 9.66, z: -2.88}
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 25, y: -90, z: 0}
--- !u!114 &1392866533
MonoBehaviour:
m_ObjectHideFlags: 0

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6381221600546481521, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.73800296
objectReference: {fileID: 0}
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -0.27001014
objectReference: {fileID: 0}
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.59799767
objectReference: {fileID: 0}
- target: {fileID: 6381221600826571125, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.y
value: -0.7495971
objectReference: {fileID: 0}
- target: {fileID: 6381221601586314449, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: -0.7538019
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: 0.28900146
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.z
value: 0.6479996
objectReference: {fileID: 0}
- target: {fileID: 7516351800607109742, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_Name

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6381221600739370389, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: -0.2699984
objectReference: {fileID: 0}
- target: {fileID: 6381221601619947354, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_ConnectedAnchor.x
value: 0.28900146
objectReference: {fileID: 0}
- target: {fileID: 7516351800607109742, guid: 75720cc09f5b24833af829458ac467fa,
type: 3}
propertyPath: m_Name

932
Project/Assets/ML-Agents/Examples/Worm/Scenes/WormStaticTarget.unity
文件差异内容过多而无法显示
查看文件

88
Project/Assets/ML-Agents/Examples/Worm/Scripts/WormAgent.cs


}
//Get Joint Rotation Relative to the Connected Rigidbody
//We want to collect this info because it is the actual rotation, not the "target rotation"
// public Quaternion GetJointRotation(ConfigurableJoint joint)
// {
//// return(Quaternion.FromToRotation(joint.axis, joint.connectedBody.transform.rotation.eulerAngles));
// return(Quaternion.Inverse(joint.connectedBody.transform.rotationd) * joint.transform); joint.connectedBody.transform.rotation.eulerAngles));
// }
/// <summary>
/// Add relevant information on each body part to observations.
/// </summary>

var localPosRelToBody = bodySegment0.InverseTransformPoint(rb.position);
sensor.AddObservation(localPosRelToBody);
sensor.AddObservation(GetJointRotation(bp.joint));
// sensor.AddObservation(bp.currentXNormalizedRot); // Current x rot
// sensor.AddObservation(bp.currentYNormalizedRot); // Current y rot
// sensor.AddObservation(bp.currentZNormalizedRot); // Current z rot
// /// <summary>
// /// Add relevant information on each body part to observations.
// /// </summary>
// public void CollectObservationBodyPart(BodyPart bp, VectorSensor sensor)
// {
// var rb = bp.rb;
// sensor.AddObservation(bp.groundContact.touchingGround ? 1 : 0); // Whether the bp touching the ground
//
// var velocityRelativeToLookRotationToTarget = m_TargetDirMatrix.inverse.MultiplyVector(rb.velocity);
// sensor.AddObservation(velocityRelativeToLookRotationToTarget);
//
// var angularVelocityRelativeToLookRotationToTarget = m_TargetDirMatrix.inverse.MultiplyVector(rb.angularVelocity);
// sensor.AddObservation(angularVelocityRelativeToLookRotationToTarget);
//
// if (bp.rb.transform != bodySegment0)
// {
// var localPosRelToBody = bodySegment0.InverseTransformPoint(rb.position);
// sensor.AddObservation(localPosRelToBody);
// sensor.AddObservation(bp.currentXNormalizedRot); // Current x rot
// sensor.AddObservation(bp.currentYNormalizedRot); // Current y rot
// sensor.AddObservation(bp.currentZNormalizedRot); // Current z rot
// sensor.AddObservation(bp.currentStrength / m_JdController.maxJointForceLimit);
// }
// }
public override void CollectObservations(VectorSensor sensor)
{
m_JdController.GetCurrentJointForces();

CollectObservationBodyPart(bodyPart, sensor);
}
// // Forward & up to help with orientation
// var bodyForwardRelativeToLookRotationToTarget = m_TargetDirMatrix.inverse.MultiplyVector(bodySegment0.up);
// sensor.AddObservation(bodyForwardRelativeToLookRotationToTarget);
//
// var bodyUpRelativeToLookRotationToTarget = m_TargetDirMatrix.inverse.MultiplyVector(-bodySegment0.forward);
// sensor.AddObservation(bodyUpRelativeToLookRotationToTarget);
//ADD ROTATION DELTA
Quaternion rotDelta = Quaternion.Inverse(m_TargetDirMatrix.rotation) * bodySegment0.rotation;
sensor.AddObservation(rotDelta);
//Rotation delta between the matrix and the head
Quaternion headRotationDeltaFromMatrixRot = Quaternion.Inverse(m_TargetDirMatrix.rotation) * bodySegment0.rotation;
sensor.AddObservation(headRotationDeltaFromMatrixRot);
}
/// <summary>

void RewardFunctionMovingTowards()
{
m_MovingTowardsDot = Vector3.Dot(m_JdController.bodyPartsDict[bodySegment0].rb.velocity, m_DirToTarget.normalized);
// AddReward(0.03f * m_MovingTowardsDot);
// AddReward(1/maxStep * m_MovingTowardsDot);
AddReward(0.01f * m_MovingTowardsDot);
}

void RewardFunctionFacingTarget()
{
//Discourage rotating away from target dir
// float currentFacingDir =((-1 * Quaternion.Dot(m_TargetDirMatrix.rotation, bodySegment0.rotation)) + 1) * .5f; //normalize. 0 good, 1 bad
// float currentFacingDir = -.01f * ((Quaternion.Dot(m_TargetDirMatrix.rotation, bodySegment0.rotation) + 1) * .5f); //normalize. 0 good, 1 bad
//PENALTY IF LOOKING AWAY
float notFacingPenalty = ((-1 * Quaternion.Dot(m_TargetDirMatrix.rotation, bodySegment0.rotation)) + 1) * .5f; //normalize. 0 good, 1 bad
AddReward(-.01f * notFacingPenalty);
// float currentFacingDot = (Quaternion.Dot(m_TargetDirMatrix.rotation, bodySegment0.rotation) + 1) * .5f; //normalize. 0 facing away, 1 facing
// AddReward(-.01f * currentFacingDot);
float bodyRotRelativeToMatrixDot = Quaternion.Dot(m_TargetDirMatrix.rotation, bodySegment0.rotation);
AddReward(0.01f * bodyRotRelativeToMatrixDot);
// /// <summary>
// /// Reward facing target & Penalize facing away from target
// /// </summary>
// void RewardFunctionFacingTarget()
// {
//// m_FacingDot = Vector3.Dot(m_DirToTarget.normalized, bodySegment0.forward);
// m_FacingDot = Vector3.Dot(m_DirToTarget.normalized, bodySegment0.up);
//// AddReward(0.01f * m_FacingDot);
//// AddReward(1/maxStep * m_FacingDot);
//// AddReward(0.01f * m_FacingDot);
// AddReward(0.01f * (m_FacingDot - 1));
// }
/// <summary>
/// Existential penalty for time-contrained tasks.

/// </summary>
public override void OnEpisodeBegin()
{
foreach (var bodyPart in m_JdController.bodyPartsDict.Values)
{
bodyPart.Reset(bodyPart);
}
if (m_DirToTarget != Vector3.zero)
{
transform.rotation = Quaternion.LookRotation(m_DirToTarget);

foreach (var bodyPart in m_JdController.bodyPartsDict.Values)
{
bodyPart.Reset(bodyPart);
}
if (!targetIsStatic)
{
GetRandomTargetPos();

4
config/trainer_config.yaml


time_horizon: 1000
batch_size: 2024
buffer_size: 20240
max_steps: 5e6
max_steps: 3e6
summary_freq: 30000
num_layers: 3
hidden_units: 512

time_horizon: 1000
batch_size: 2024
buffer_size: 20240
max_steps: 5e6
max_steps: 3e6
summary_freq: 30000
num_layers: 3
hidden_units: 512

正在加载...
取消
保存