浏览代码

update soccer scene

/comms-grad
Andrew Cohen 4 年前
当前提交
c183040a
共有 5 个文件被更改,包括 43 次插入31 次删除
  1. 8
      Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab
  2. 28
      Project/Assets/ML-Agents/Examples/Soccer/Scenes/SoccerTwos.unity
  3. 2
      Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs
  4. 8
      Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccerCollab.cs
  5. 28
      config/ppo/SoccerTwos.yaml

8
Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab


m_RayLength: 20
m_RayLayerMask:
serializedVersion: 2
m_Bits: 1536
m_Bits: 1024
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}

m_RayLength: 20
m_RayLayerMask:
serializedVersion: 2
m_Bits: 1536
m_Bits: 1024
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}

m_RayLength: 20
m_RayLayerMask:
serializedVersion: 2
m_Bits: 1536
m_Bits: 1024
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}

m_RayLength: 20
m_RayLayerMask:
serializedVersion: 2
m_Bits: 1536
m_Bits: 1024
m_ObservationStacks: 3
rayHitColor: {r: 1, g: 0, b: 0, a: 1}
rayMissColor: {r: 1, g: 1, b: 1, a: 1}

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


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_LocalPosition.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_LocalPosition.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_LocalPosition.x

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

propertyPath: m_Name
value: SoccerFieldTwos (8)
objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x
value: 0

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_LocalPosition.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_LocalPosition.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_LocalPosition.x

objectReference: {fileID: 0}
- target: {fileID: 114387866097048300, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
propertyPath: m_BehaviorType
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114387866097048300, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
propertyPath: GroupId
value: 2
objectReference: {fileID: 0}

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_LocalPosition.x

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


}
if (c.gameObject.CompareTag("ball"))
{
AddReward(.2f * m_BallTouch);
AddReward(.4f * m_BallTouch * m_KickPower);
var dir = c.contacts[0].point - transform.position;
dir = dir.normalized;
c.gameObject.GetComponent<Rigidbody>().AddForce(dir * force);

8
Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccerCollab.cs


public void tellAgent(int message)
{
m_Message[m_Previous] = 0f;
//if (team == Team.Purple)
//{
// message = Random.Range(0, 2);
//}
if (team == Team.Purple)
{
message = 0;//Random.Range(0, 2);
}
m_Message[message] = 1f;
m_Previous = message;
}

28
config/ppo/SoccerTwos.yaml


SoccerTwos:
trainer_type: ppo
hyperparameters:
batch_size: 4096
buffer_size: 40960
batch_size: 2048
buffer_size: 20480
learning_rate: 0.0003
beta: 0.005
epsilon: 0.2

behavior: SoccerTwos
signal_smoothing: true
min_lesson_length: 100
threshold: 0.001
threshold: 0.005
value: 1.0
- name: Lesson1
completion_criteria:

min_lesson_length: 100
threshold: 0.00175
value: 0.5
threshold: 0.01
value: 0.75
- name: Lesson2
completion_criteria:
measure: progress

threshold: 0.00225
value: 0.1
threshold: 0.015
value: 0.5
- name: Lesson3
completion_criteria:
measure: progress

threshold: 0.003
threshold: 0.02
value: 0.25
- name: Lesson4
completion_criteria:
measure: progress
behavior: SoccerTwos
signal_smoothing: true
min_lesson_length: 100
threshold: 0.025
env_settings:
num_envs: 1
#env_settings:
# num_envs: 1
正在加载...
取消
保存