浏览代码

increased scale tennis env

/asymm-envs
Andrew Cohen 5 年前
当前提交
8ad1323e
共有 4 个文件被更改,包括 38 次插入31 次删除
  1. 20
      Project/Assets/ML-Agents/Examples/Tennis/Prefabs/TennisArea.prefab
  2. 39
      Project/Assets/ML-Agents/Examples/Tennis/Scenes/Tennis.unity
  3. 2
      Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs
  4. 8
      Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisArea.cs

20
Project/Assets/ML-Agents/Examples/Tennis/Prefabs/TennisArea.prefab


vectorActionSize: 03000000
vectorActionDescriptions: []
vectorActionSpaceType: 1
m_Model: {fileID: 11400000, guid: af0e636edb8584db08624f42c5f71f97, type: 3}
m_Model: {fileID: 11400000, guid: d6c5e749e4ceb4cf79640a5955706d3d, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: Tennis

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1485570486708108}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -5.9507, y: -3, z: 0}
m_LocalScale: {x: 1.0831101, y: 1, z: 1.1727886}
m_LocalPosition: {x: -6.07, y: -1.4, z: 0}
m_LocalScale: {x: 1.1, y: 1, z: 1.2}
m_Children: []
m_Father: {fileID: 4275308033819996}
m_RootOrder: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1485570486708108}
m_Material: {fileID: 0}
m_Material: {fileID: 13400000, guid: 56162663048874fd4b10e065f9cf78b7, type: 2}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2

m_GameObject: {fileID: 1600389029549348}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -7.5, z: 0}
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
m_LocalScale: {x: 0.02, y: 0.02, z: 0.02}
m_Children:
- {fileID: 4859823443517042}
- {fileID: 4821769212579210}

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1730923431341952}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 6.07, y: -3, z: 0}
m_LocalScale: {x: 1.0919912, y: 1, z: 1.1119019}
m_LocalPosition: {x: 6.07, y: -1.4, z: 0}
m_LocalScale: {x: 1.09, y: 1, z: 1.2}
m_Children: []
m_Father: {fileID: 4275308033819996}
m_RootOrder: 1

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1730923431341952}
m_Material: {fileID: 0}
m_Material: {fileID: 13400000, guid: 56162663048874fd4b10e065f9cf78b7, type: 2}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2

vectorActionSize: 03000000
vectorActionDescriptions: []
vectorActionSpaceType: 1
m_Model: {fileID: 11400000, guid: af0e636edb8584db08624f42c5f71f97, type: 3}
m_Model: {fileID: 11400000, guid: d6c5e749e4ceb4cf79640a5955706d3d, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: Tennis

m_GameObject: {fileID: 1969551055586186}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -4, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children:
- {fileID: 4733128113887812}
- {fileID: 4535263776590958}

39
Project/Assets/ML-Agents/Examples/Tennis/Scenes/Tennis.unity


objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: 44.4
value: 60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: 44.4
value: 60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: -45.6
value: -60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: -45.6
value: -60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: -45.6
value: -60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: 44.4
value: 60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: -45.6
value: -60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 957430531}
m_LocalRotation: {x: 0.13052616, y: 0, z: 0, w: 0.9914449}
m_LocalPosition: {x: 0, y: 6.25, z: -25.6}
m_LocalRotation: {x: 0.17364816, y: 0, z: 0, w: 0.9848078}
m_LocalPosition: {x: 0, y: 15, z: -42}
m_LocalEulerAnglesHint: {x: 15, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 20, y: 0, z: 0}
--- !u!1001 &978771510
PrefabInstance:
m_ObjectHideFlags: 0

propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1969551055586186, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
value: -45.6
value: -60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

- target: {fileID: 1541947554534326, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_Name
value: TennisArea (3)
objectReference: {fileID: 0}
- target: {fileID: 1541947554534326, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x

objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: 44.4
value: 60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: 44.4
value: 60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: 44.4
value: 60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

m_Name:
m_EditorClassIdentifier:
gravityMultiplier: 1
monitorVerticalOffset: 0
fixedDeltaTime: 0.02
maximumDeltaTime: 0.33333334
solverIterations: 6

objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.x
value: -45.6
value: -60
objectReference: {fileID: 0}
- target: {fileID: 4172342666475122, guid: 812997c7bc2544b6f927ff684c03450f, type: 3}
propertyPath: m_LocalPosition.y

2
Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs


{
m_Area.MatchReset();
}
transform.position = new Vector3(-m_InvertMult * Random.Range(6f, 8f), -1.5f, -1.8f) + transform.parent.transform.position;
transform.position = new Vector3(-m_InvertMult * 14f, 5f, -1.8f) + transform.parent.transform.position;
m_AgentRb.velocity = new Vector3(0f, 0f, 0f);
SetResetParameters();
}

8
Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisArea.cs


public void MatchReset()
{
var ballOut = Random.Range(6f, 8f);
var ballOut = 14f;
ball.transform.position = new Vector3(-ballOut, 6f, 0f) + transform.position;
ball.transform.position = new Vector3(-ballOut, 10f, 0f) + transform.position;
ball.transform.position = new Vector3(ballOut, 6f, 0f) + transform.position;
ball.transform.position = new Vector3(ballOut, 10f, 0f) + transform.position;
}
m_BallRb.velocity = new Vector3(0f, 0f, 0f);
ball.transform.localScale = new Vector3(.5f, .5f, .5f);

{
m_BallRb.AddForce(down);
var rgV = m_BallRb.velocity;
m_BallRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -20f, 20f), Mathf.Clamp(rgV.y, -30f, 30f), rgV.z);
m_BallRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -30f, 30f), Mathf.Clamp(rgV.y, -35f, 35f), rgV.z);
}
}
正在加载...
取消
保存