比较提交

...
此合并请求有变更与目标分支冲突。
/config/ppo/PushBlock.yaml
/config/sac/PushBlock.yaml
/Project/Packages/manifest.json
/Project/ProjectSettings/TagManager.asset
/Project/ProjectSettings/ProjectVersion.txt
/Project/Assets/ML-Agents/Examples/Crawler/Scenes/CrawlerDynamicVariableSpeed.unity
/Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs
/Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpCrawlerDynVS.demo.meta
/Project/Assets/ML-Agents/Examples/GridWorld/Demos/ExpertGrid.demo.meta
/Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity
/Project/Assets/ML-Agents/Examples/PushBlock/Demos/ExpertPush.demo.meta
/Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerDyVS.demo.meta
/Project/Assets/ML-Agents/Examples/Soccer/Scenes/SoccerTwos.unity
/Project/Packages/packages-lock.json
/Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/CollisionCallbacks.cs
/Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/CollisionCallbacks.cs.meta
/com.unity.ml-agents.extensions/Documentation~/Grid-Sensor.md
/com.unity.ml-agents.extensions/Runtime/Sensors/GridSensor.cs
/Project/Assets/ML-Agents/Examples/Bouncer/Demos/ExpertBouncer.demo.meta
/Project/Assets/ML-Agents/Examples/Reacher/Demos/ExpertReacher.demo.meta
/Project/Assets/ML-Agents/Examples/Tennis/Demos/ExpertTennis.demo.meta
/Project/Assets/ML-Agents/Examples/FoodCollector/Demos/ExpertFood.demo.meta
/Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpCrawlerStaVS.demo.meta
/Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerDyn.demo.meta
/Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerSta.demo.meta
/Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerDy.demo.meta
/Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerStVS.demo.meta
/Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerSta.demo.meta

11 次代码提交

共有 130 个文件被更改,包括 21926 次插入501 次删除
  1. 10
      config/ppo/PushBlock.yaml
  2. 2
      config/sac/PushBlock.yaml
  3. 1
      com.unity.ml-agents.extensions/Documentation~/Grid-Sensor.md
  4. 74
      com.unity.ml-agents.extensions/Runtime/Sensors/GridSensor.cs
  5. 23
      Project/Packages/manifest.json
  6. 2
      Project/ProjectSettings/TagManager.asset
  7. 3
      Project/ProjectSettings/ProjectVersion.txt
  8. 7
      Project/Assets/ML-Agents/Examples/3DBall/Demos/Expert3DBall.demo.meta
  9. 7
      Project/Assets/ML-Agents/Examples/3DBall/Demos/Expert3DBallHard.demo.meta
  10. 7
      Project/Assets/ML-Agents/Examples/Bouncer/Demos/ExpertBouncer.demo.meta
  11. 462
      Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity
  12. 7
      Project/Assets/ML-Agents/Examples/GridWorld/Demos/ExpertGrid.demo.meta
  13. 7
      Project/Assets/ML-Agents/Examples/Hallway/Demos/ExpertHallway.demo.meta
  14. 7
      Project/Assets/ML-Agents/Examples/Pyramids/Demos/ExpertPyramid.demo.meta
  15. 7
      Project/Assets/ML-Agents/Examples/Reacher/Demos/ExpertReacher.demo.meta
  16. 294
      Project/Assets/ML-Agents/Examples/Soccer/Scenes/SoccerTwos.unity
  17. 7
      Project/Assets/ML-Agents/Examples/Tennis/Demos/ExpertTennis.demo.meta
  18. 7
      Project/Assets/ML-Agents/Examples/WallJump/Materials/spawnVolumeMaterial.mat
  19. 88
      Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/BadFood.prefab
  20. 88
      Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/Food.prefab
  21. 7
      Project/Assets/ML-Agents/Examples/FoodCollector/Demos/ExpertFood.demo.meta
  22. 980
      Project/Assets/ML-Agents/Examples/Crawler/Scenes/CrawlerDynamicVariableSpeed.unity
  23. 6
      Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs
  24. 7
      Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpCrawlerDynVS.demo.meta
  25. 7
      Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpCrawlerStaVS.demo.meta
  26. 7
      Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerDyn.demo.meta
  27. 7
      Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerSta.demo.meta
  28. 7
      Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerDy.demo.meta
  29. 7
      Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerDyVS.demo.meta
  30. 7
      Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerStVS.demo.meta
  31. 7
      Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerSta.demo.meta
  32. 7
      Project/Assets/ML-Agents/Examples/Basic/Demos/ExpertBasic.demo.meta
  33. 16
      Project/Assets/ML-Agents/Examples/SharedAssets/Prefabs/Targets/DynamicTarget.prefab
  34. 7
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/JointDriveController.cs
  35. 7
      Project/Assets/ML-Agents/Examples/PushBlock/Demos/ExpertPush.demo.meta
  36. 28
      config/sac/PushBlockcopy.yaml
  37. 1001
      com.unity.ml-agents.extensions/Documentation~/images/gridsensor-debug.png
  38. 423
      Project/Packages/packages-lock.json
  39. 38
      Project/ProjectSettings/PackageManagerSettings.asset
  40. 10
      Project/ProjectSettings/XRSettings.asset
  41. 329
      Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/Canvas.prefab
  42. 7
      Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/Canvas.prefab.meta
  43. 7
      Project/Assets/ML-Agents/Examples/Crawler/Scenes/CrawlerGRAVEYARD.unity.meta
  44. 1001
      Project/Assets/ML-Agents/Examples/Crawler/Scenes/CrawlerGRAVEYARD.unity
  45. 7
      Project/Assets/ML-Agents/Examples/Crawler/Prefabs/CreaturePlatform.prefab.meta
  46. 1001
      Project/Assets/ML-Agents/Examples/Crawler/Prefabs/CreaturePlatform.prefab
  47. 13
      Project/Assets/ML-Agents/Examples/Crawler/Scripts/CreatureAgent.cs.meta
  48. 465
      Project/Assets/ML-Agents/Examples/Crawler/Scripts/CreatureAgent.cs
  49. 1001
      Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature2Legs.nn
  50. 11
      Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature2Legs.nn.meta
  51. 1001
      Project/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerDynamicVariableSpeedUpsideDownPenGroundPen.nn
  52. 11
      Project/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerDynamicVariableSpeedUpsideDownPenGroundPen.nn.meta
  53. 1001
      Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature6Legs.nn
  54. 11
      Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature6Legs.nn.meta
  55. 1001
      Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature6LegsOld.nn
  56. 11
      Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature6LegsOld.nn.meta
  57. 1001
      Project/Assets/ML-Agents/Examples/Crawler/TFModels/CreatureMaster.nn
  58. 11
      Project/Assets/ML-Agents/Examples/Crawler/TFModels/CreatureMaster.nn.meta
  59. 78
      Project/Assets/ML-Agents/Examples/SharedAssets/Materials/MOON.mat
  60. 8
      Project/Assets/ML-Agents/Examples/SharedAssets/Materials/MOON.mat.meta
  61. 77
      Project/Assets/ML-Agents/Examples/SharedAssets/Materials/ProjectileMat.mat
  62. 10
      Project/Assets/ML-Agents/Examples/SharedAssets/Materials/ProjectileMat.mat.meta
  63. 78
      Project/Assets/ML-Agents/Examples/SharedAssets/Materials/WhiteEmissive.mat
  64. 8
      Project/Assets/ML-Agents/Examples/SharedAssets/Materials/WhiteEmissive.mat.meta
  65. 7
      Project/Assets/ML-Agents/Examples/SharedAssets/Prefabs/PlayerCubeWithGun.prefab.meta
  66. 7
      Project/Assets/ML-Agents/Examples/SharedAssets/Prefabs/Projectile.prefab.meta
  67. 704
      Project/Assets/ML-Agents/Examples/SharedAssets/Prefabs/PlayerCubeWithGun.prefab
  68. 129
      Project/Assets/ML-Agents/Examples/SharedAssets/Prefabs/Projectile.prefab
  69. 135
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/CollisionCallbacks.cs
  70. 11
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/CollisionCallbacks.cs.meta
  71. 11
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AgentCubeMovement.cs.meta
  72. 11
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AgentCubeGroundCheck.cs.meta
  73. 355
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AvgCenterOfMass.cs
  74. 11
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AvgCenterOfMass.cs.meta
  75. 84
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/Projectile.cs
  76. 11
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/Projectile.cs.meta
  77. 142
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ShootProjectiles.cs
  78. 11
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ShootProjectiles.cs.meta
  79. 32
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/RandomTorqueEveryXSec.cs
  80. 11
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/RandomTorqueEveryXSec.cs.meta
  81. 81
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AgentCubeGroundCheck.cs
  82. 206
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AgentCubeMovement.cs
  83. 12
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentGrid.cs.meta
  84. 519
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentGrid.cs
  85. 7
      Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockHard.prefab.meta
  86. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockHard.prefab
  87. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockCombo.nn
  88. 11
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockCombo.nn.meta
  89. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGrid.nn
  90. 11
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGrid.nn.meta
  91. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGridHard.nn
  92. 11
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGridHard.nn.meta
  93. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockHardRays.nn
  94. 11
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockHardRays.nn.meta
  95. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlock2Grids.nn
  96. 11
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlock2Grids.nn.meta
  97. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockComboStaticGrid.nn
  98. 11
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockComboStaticGrid.nn.meta
  99. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGridOnlyLatest.nn
  100. 11
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGridOnlyLatest.nn.meta

10
config/ppo/PushBlock.yaml


PushBlock:
trainer_type: ppo
hyperparameters:
batch_size: 128
buffer_size: 2048
batch_size: 1024 #128
buffer_size: 10240 #2048
learning_rate: 0.0003
beta: 0.01
epsilon: 0.2

extrinsic:
gamma: 0.99
strength: 1.0
# curiosity:
# strength: 0.02
# gamma: 0.99
# encoding_size: 256
summary_freq: 60000
summary_freq: 10000
threaded: true

2
config/sac/PushBlock.yaml


keep_checkpoints: 5
max_steps: 2000000
time_horizon: 64
summary_freq: 100000
summary_freq: 10000
threaded: true

1
com.unity.ml-agents.extensions/Documentation~/Grid-Sensor.md


The Grid Sensor combines the generality of data extraction from Raycasts with the image processing power of Convolutional Neural Networks. The Grid Sensor can be used to collect data in the general form of a "Width x Height x Channel" matrix which can be used for training Reinforcement Learning agents or for data analysis.
<img src="images/gridsensor-debug.png" align="middle" width="3000"/>
# Motivation

74
com.unity.ml-agents.extensions/Runtime/Sensors/GridSensor.cs


[Tooltip("Rotate the grid based on the direction the agent is facing")]
public bool RotateToAgent;
public bool TranslateToAgent; //should the grid move with the agent
// public bool MapThisAgent = false; //should this agent be mapped
public List<Collider> collidersToIgnore;
/// <summary>
/// Array holding the depth of each channel.
/// </summary>

/// <summary>
/// Texture where the colors are written to so that they can be compressed in PNG format.
/// </summary>
protected Texture2D m_perceptionTexture2D;
public Texture2D m_perceptionTexture2D;
//
// Utility Constants Calculated on Init

/// </summary>
private List<byte[]> byteSizesBytesList;
private Color DebugDefaultColor = new Color(1f, 1f, 1f, 0.25f);
public Color DebugDefaultColor = new Color(1f, 1f, 1f, 0.55f);
/// <inheritdoc/>
public override ISensor CreateSensor()

byteSizesBytesList = new List<byte[]>();
m_perceptionTexture2D = new Texture2D(GridNumSideX, GridNumSideZ, TextureFormat.RGB24, false);
testTexture = new Texture2D(GridNumSideX, GridNumSideZ, TextureFormat.RGB24, false);
}
/// <summary>

return SensorCompressionType.PNG;
}
// public Texture aTexture;
public Texture2D testTexture;
public bool showGridObservationGUI;
void OnGUI()
{
// if (!aTexture)
if (!testTexture)
{
Debug.LogError("Assign a Texture in the inspector.");
return;
}
if (showGridObservationGUI)
{
// GUI.DrawTexture(new Rect(10, 10, 60, 60), aTexture, ScaleMode.ScaleToFit, true, 10.0F);
GUI.DrawTexture(new Rect(10, 10, 600, 600), testTexture, ScaleMode.ScaleToFit, true, 1f);
}
}
/// <summary>
/// GetCompressedObservation - Calls Perceive then puts the data stored on the perception buffer
/// onto the m_perceptionTexture2D to be converted to a byte array and returned

}
}
m_perceptionTexture2D.SetPixels(m_PerceptionColors);
if (showGridObservationGUI)
{
testTexture.SetPixels(m_PerceptionColors);
// testTexture.EncodeToPNG();
testTexture.Apply();
}
public float overlapBoxScale = .5f;
/// <summary>
/// Perceive - Clears the buffers, calls overlap box on the actual cell (the actual perception part)
/// for all found colliders, LoadObjectData is called

Collider[] foundColliders = null;
Vector3 cellCenter = Vector3.zero;
Vector3 halfCellScale = new Vector3(CellScaleX / 2f, CellScaleY, CellScaleZ / 2f);
Vector3 halfCellScale = Vector3.one * (overlapBoxScale * .5f);
// Vector3 halfCellScale = new Vector3(CellScaleX / 2f, CellScaleY, CellScaleZ / 2f);
cellCenter = transform.TransformPoint(CellPoints[cellIndex]);
foundColliders = Physics.OverlapBox(cellCenter, halfCellScale, transform.rotation, ObserveMask);
// cellCenter = transform.TransformPoint(CellPoints[cellIndex]);
cellCenter = rootReference.transform.TransformPoint(CellPoints[cellIndex]);
// foundColliders = Physics.OverlapBox(cellCenter, halfCellScale, transform.rotation, ObserveMask);
foundColliders = Physics.OverlapBox(cellCenter, halfCellScale, rootReference.transform.rotation, ObserveMask);
cellCenter = transform.position + CellPoints[cellIndex];
cellCenter = rootReference.transform.position + CellPoints[cellIndex];
// cellCenter = transform.position + CellPoints[cellIndex];
foundColliders = Physics.OverlapBox(cellCenter, halfCellScale, Quaternion.identity, ObserveMask);
}

currentColliderGo = foundColliders[i].gameObject;
// Continue if the current collider go is the root reference
if (currentColliderGo == rootReference)
if (collidersToIgnore.Contains(foundColliders[i]))
// if (currentColliderGo == rootReference && !MapThisAgent)
// if (!MapThisAgent)
continue;
closestColliderPoint = foundColliders[i].ClosestPointOnBounds(cellCenter);

float z = (cell / GridNumSideZ - OffsetGridNumSide) * CellScaleZ - DiffNumSideZX;
if (shouldTransformPoint)
return transform.TransformPoint(new Vector3(x, 0, z));
// return transform.TransformPoint(new Vector3(x, 0, z));
return rootReference.transform.TransformPoint(new Vector3(x, 0, z));
return new Vector3(x, 0, z);
}

/// <param name="globalPoint">The 3D point in global space</param>
public int PointToCell(Vector3 globalPoint)
{
Vector3 point = transform.InverseTransformPoint(globalPoint);
// Vector3 point = transform.InverseTransformPoint(globalPoint);
Vector3 point = rootReference.transform.InverseTransformPoint(globalPoint);
if (point.x < -HalfOfGridX || point.x > HalfOfGridX || point.z < -HalfOfGridZ || point.z > HalfOfGridZ)
return -1;

Vector3 offset = new Vector3(0, GizmoYOffset, 0);
Matrix4x4 oldGizmoMatrix = Gizmos.matrix;
Matrix4x4 cubeTransform = Gizmos.matrix;
// Matrix4x4 cubeTransform = rootReference.transform.localToWorldMatrix;
// Matrix4x4 cubeTransform = transform.localToWorldMatrix;
cubeTransform = Matrix4x4.TRS(CellToPoint(i) + offset, transform.rotation, scale);
// cubeTransform = Matrix4x4.TRS(CellToPoint(i) + offset, transform.rotation, scale);
cubeTransform = Matrix4x4.TRS(CellToPoint(i) + offset, rootReference.transform.rotation, scale);
cubeTransform = Matrix4x4.TRS(CellToPoint(i, false) + transform.position + offset, Quaternion.identity, scale);
// cubeTransform = Matrix4x4.TRS(CellToPoint(i, false) + transform.position + offset, Quaternion.identity, scale);
cubeTransform = Matrix4x4.TRS(CellToPoint(i, false) + rootReference.transform.position + offset, Quaternion.identity, scale);
// cubeTransform = Matrix4x4.TRS(CellToPoint(i, false) + offset, Quaternion.identity, scale);
Gizmos.DrawCube(Vector3.zero, Vector3.one);
// Gizmos.DrawCube(Vector3.zero, Vector3.one * .75f);
Gizmos.DrawCube(Vector3.zero, Vector3.one * overlapBoxScale);
// Gizmos.DrawCube(Vector3.zero, new Vector3(.85f, .15f, .85f));
// Gizmos.DrawWireCube(Vector3.zero, Vector3.one * .75f);
// Gizmos.DrawSphere(Vector3.zero, .5f);
}
Gizmos.matrix = oldGizmoMatrix;

23
Project/Packages/manifest.json


{
"dependencies": {
"com.unity.ads": "2.0.8",
"com.unity.analytics": "3.2.3",
"com.unity.collab-proxy": "1.2.15",
"com.unity.ml-agents": "file:../../com.unity.ml-agents",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ads": "3.6.1",
"com.unity.analytics": "3.3.5",
"com.unity.collab-proxy": "1.2.16",
"com.unity.ide.rider": "1.1.4",
"com.unity.ide.vscode": "1.2.3",
"com.unity.ml-agents": "1.4.0-preview",
"com.unity.package-manager-ui": "2.0.8",
"com.unity.purchasing": "2.0.3",
"com.unity.textmeshpro": "1.4.1",
"com.unity.multiplayer-hlapi": "1.0.8",
"com.unity.purchasing": "2.2.1",
"com.unity.test-framework": "1.1.22",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.2.6",
"com.unity.ugui": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.7",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",

2
Project/ProjectSettings/TagManager.asset


- symbol_O_Goal
- purpleAgent
- purpleGoal
- hazard
- direction
layers:
- Default
- TransparentFX

3
Project/ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2018.4.24f1
m_EditorVersion: 2019.4.20f1
m_EditorVersionWithRevision: 2019.4.20f1 (6dd1c08eedfa)

7
Project/Assets/ML-Agents/Examples/3DBall/Demos/Expert3DBall.demo.meta


fileFormatVersion: 2
guid: bbf6756da134740eaa002a1b84f655cb
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/3DBall/Demos/Expert3DBall.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/3DBall/Demos/Expert3DBall.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/3DBall/Demos/Expert3DBallHard.demo.meta


fileFormatVersion: 2
guid: 6942431e411b146be9a597663eca89af
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/3DBall/Demos/Expert3DBallHard.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/3DBall/Demos/Expert3DBallHard.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Bouncer/Demos/ExpertBouncer.demo.meta


fileFormatVersion: 2
guid: 6285af622c80e493b906f26cf5b2327f
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/Bouncer/Demos/ExpertBouncer.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/Bouncer/Demos/ExpertBouncer.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

462
Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44971168, g: 0.4997775, b: 0.57563686, a: 1}
m_IndirectSpecularColor: {r: 0.4497121, g: 0.4997778, b: 0.5756369, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:

agentParameters:
maxStep: 100
hasUpgradedFromAgentParameters: 1
maxStep: 100
MaxStep: 100
area: {fileID: 1795599557}
timeBetweenDecisionsAtInference: 0.15
renderCamera: {fileID: 797520692}

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
vectorObservationSize: 0
numStackedVectorObservations: 1
vectorActionSize: 05000000
vectorActionDescriptions: []
vectorActionSpaceType: 0
VectorObservationSize: 0
NumStackedVectorObservations: 1
VectorActionSize: 05000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: a812f1ce7763a4a0c912717f3594fe20, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0

m_UseChildActuators: 1
m_ObservableAttributeHandling: 0
--- !u!114 &125487791
MonoBehaviour:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 260425459}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &363761396
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 363761400}
- component: {fileID: 363761399}
- component: {fileID: 363761398}
- component: {fileID: 363761397}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &363761397
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 363761396}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &363761398
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 363761396}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!223 &363761399
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 363761396}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &363761400
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 363761396}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1553342943}
- {fileID: 918893359}
- {fileID: 1305247360}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &486401523
GameObject:
m_ObjectHideFlags: 0

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5c2bd19e4bbda4991b74387ca5d28156, type: 3}
--- !u!1 &918893358
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 918893359}
- component: {fileID: 918893361}
- component: {fileID: 918893360}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &918893359
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 918893358}
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: 363761400}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 150, y: -230}
m_SizeDelta: {x: 160, y: 55.599976}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &918893360
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 918893358}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 22
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 7
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'Agent View
(RenderTexture)'
--- !u!222 &918893361
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 918893358}
m_CullTransparentMesh: 0
--- !u!1001 &949576938
PrefabInstance:
m_ObjectHideFlags: 0

m_Father: {fileID: 486401524}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1305247359
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1305247360}
- component: {fileID: 1305247362}
- component: {fileID: 1305247361}
m_Layer: 5
m_Name: RawImage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1305247360
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1305247359}
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: 363761400}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 150, y: -128}
m_SizeDelta: {x: 200, y: 152}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1305247361
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1305247359}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 8400000, guid: 114608d5384404f89bff4b6f88432958, type: 2}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &1305247362
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1305247359}
m_CullTransparentMesh: 0
--- !u!1001 &1305594059
PrefabInstance:
m_ObjectHideFlags: 0

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5c2bd19e4bbda4991b74387ca5d28156, type: 3}
--- !u!1 &1553342942
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1553342943}
- component: {fileID: 1553342945}
- component: {fileID: 1553342944}
m_Layer: 5
m_Name: DebugTxt
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1553342943
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1553342942}
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: 363761400}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 179.2, y: -78.9}
m_SizeDelta: {x: 300, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1553342944
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1553342942}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!222 &1553342945
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1553342942}
m_CullTransparentMesh: 0
--- !u!1001 &1558187638
PrefabInstance:
m_ObjectHideFlags: 0

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5c2bd19e4bbda4991b74387ca5d28156, type: 3}
--- !u!1001 &6380077984856455798
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6380077985063908482, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_Name
value: Canvas
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6380077985063908494, guid: e2aeaee87f7b0435ea6e2abcc16faf03,
type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e2aeaee87f7b0435ea6e2abcc16faf03, type: 3}

7
Project/Assets/ML-Agents/Examples/GridWorld/Demos/ExpertGrid.demo.meta


fileFormatVersion: 2
guid: 0092f2e4aece345aea4730a37eeebf68
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/GridWorld/Demos/ExpertGrid.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/GridWorld/Demos/ExpertGrid.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Hallway/Demos/ExpertHallway.demo.meta


fileFormatVersion: 2
guid: 41c6af18564fe425fa1c047d603ee34e
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/Hallway/Demos/ExpertHallway.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/Hallway/Demos/ExpertHallway.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Pyramids/Demos/ExpertPyramid.demo.meta


fileFormatVersion: 2
guid: 2f9d53c90f11846d7a6499ce0f1dfebb
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/Pyramids/Demos/ExpertPyramid.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/Pyramids/Demos/ExpertPyramid.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Reacher/Demos/ExpertReacher.demo.meta


fileFormatVersion: 2
guid: 4f14b17d2835e482097c88301323e587
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/Reacher/Demos/ExpertReacher.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/Reacher/Demos/ExpertReacher.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

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


debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &19590773 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1095606497496374, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
m_PrefabInstance: {fileID: 774084574}
m_PrefabAsset: {fileID: 0}
--- !u!65 &19590774
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 19590773}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &19590782
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 19590773}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.12, y: 0.37, z: 1}
m_Center: {x: 0, y: 0, z: 0.51}
--- !u!1 &255077123
GameObject:
m_ObjectHideFlags: 0

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1131626411948014, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1475025089682726, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_TagString
value: ground
objectReference: {fileID: 0}
- target: {fileID: 4277721046484044, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4277721046484044, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.y
value: -0.7071068
objectReference: {fileID: 0}
- target: {fileID: 4277721046484044, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4277721046484044, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 4277721046484044, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x
value: 3.1821482
objectReference: {fileID: 0}
- target: {fileID: 4277721046484044, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.z
value: 1.1386062
objectReference: {fileID: 0}
- target: {fileID: 4277721046484044, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -90
objectReference: {fileID: 0}
- target: {fileID: 4444285537983296, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x
value: -5.4
objectReference: {fileID: 0}
- target: {fileID: 4444285537983296, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4444285537983296, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.y
value: 0.7055439
objectReference: {fileID: 0}
- target: {fileID: 4444285537983296, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4444285537983296, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7086663
objectReference: {fileID: 0}
- target: {fileID: 4444285537983296, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 89.747
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x
value: 0

propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
- target: {fileID: 65240990864984162, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 736576636681813138, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1897170901855235213, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6257467487437560250, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9136065168043485173, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 114516244030127556, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
- {fileID: 114320493772006642, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
- {fileID: 1023485123796557062, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
--- !u!1 &774084575 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1131626411948014, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
m_PrefabInstance: {fileID: 774084574}
m_PrefabAsset: {fileID: 0}
--- !u!114 &774084576
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 774084575}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 801669c0cdece6b40b2e741ad0b119ac, type: 3}
m_Name:
m_EditorClassIdentifier:
Name:
CellScaleX: 0.1
CellScaleZ: 0.15
GridNumSideX: 200
GridNumSideZ: 200
CellScaleY: 0.01
RotateToAgent: 1
ChannelDepth: 08000000
DetectableObjects:
- purpleAgent
- blueAgent
- ball
- wall
- blueGoal
- purpleGoal
- ground
ObserveMask:
serializedVersion: 2
m_Bits: 4294967295
gridDepthType: 0
rootReference: {fileID: 774084575}
ObservationPerCell: 1
NumberOfObservations: 40000
ChannelOffsets: 00000000
DebugColors:
- {r: 0.508012, g: 0.27205884, b: 1, a: 1}
- {r: 0.31731597, g: 0.72000253, b: 0.853, a: 0}
- {r: 1, g: 0.8196079, b: 0, a: 1}
- {r: 1, g: 0.43867922, b: 0.46069172, a: 0.89411765}
- {r: 0.31731597, g: 0.72000253, b: 0.853, a: 0}
- {r: 0.508012, g: 0.27205884, b: 1, a: 0}
- {r: 1, g: 0.6933962, b: 0.6933962, a: 0}
GizmoYOffset: 0
ShowGizmos: 1
--- !u!1 &1009000883
GameObject:
m_ObjectHideFlags: 0

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
--- !u!1 &1339800399
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1339800403}
- component: {fileID: 1339800402}
- component: {fileID: 1339800401}
- component: {fileID: 1339800400}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!65 &1339800400
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1339800399}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &1339800401
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1339800399}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: ecd59def9213741058b969f699d10e8e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1339800402
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1339800399}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1339800403
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1339800399}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.12, y: 1.07, z: -0.04}
m_LocalScale: {x: 31, y: 2, z: 16}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1348885204
PrefabInstance:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
gravityMultiplier: 1
monitorVerticalOffset: 0
reuseCollisionCallbacks: 1
--- !u!114 &1574236051
MonoBehaviour:
m_ObjectHideFlags: 0

blueMaterial: {fileID: 2100000, guid: c9fa44c2c3f8ce74ca39a3355ea42631, type: 2}
randomizePlayersTeamForTraining: 0
agentRunSpeed: 2
strikerPunish: -0.1
strikerReward: 1
goaliePunish: -1
goalieReward: 0.1
--- !u!1001 &1606160104
PrefabInstance:
m_ObjectHideFlags: 0

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
--- !u!1 &2136467727 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6257467487437560250, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
m_PrefabInstance: {fileID: 774084574}
m_PrefabAsset: {fileID: 0}
--- !u!65 &2136467728
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2136467727}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.12, y: 0.37, z: 1}
m_Center: {x: 0, y: 0, z: 0.51}

7
Project/Assets/ML-Agents/Examples/Tennis/Demos/ExpertTennis.demo.meta


fileFormatVersion: 2
guid: 9676a67fc4a8d420aab12eb513a845a8
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/Tennis/Demos/ExpertTennis.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/Tennis/Demos/ExpertTennis.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/WallJump/Materials/spawnVolumeMaterial.mat


Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: spawnVolumeMaterial
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHABLEND_ON

- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 0, g: 0.83448315, b: 1, a: 0.303}
- _Color: {r: 0, g: 0.568055, b: 0.77254903, a: 0.303}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

88
Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/BadFood.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1853821981215314}
m_IsPrefabParent: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4094284922894548}
- component: {fileID: 33861055306973786}

m_IsActive: 1
--- !u!4 &4094284922894548
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -32.01, y: 2, z: -12.46}

m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33861055306973786
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!135 &135398688903115902
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
m_Enabled: 1
m_CastShadows: 1

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33861055306973786
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1853821981215314}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
serializedVersion: 2
m_Mass: 5

m_CollisionDetection: 0
--- !u!114 &114054540722299252
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
m_Enabled: 1
m_EditorHideFlags: 0

respawn: 0
myArea: {fileID: 0}
--- !u!135 &135398688903115902
SphereCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1853821981215314}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.75
m_Center: {x: 0, y: 0, z: 0}

88
Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/Food.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1699568242032636}
m_IsPrefabParent: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4317744128851916}
- component: {fileID: 33865088620820440}

m_IsActive: 1
--- !u!4 &4317744128851916
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -32.01, y: 2, z: -9.559753}

m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33865088620820440
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!135 &135161629589834772
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
m_Enabled: 1
m_CastShadows: 1

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33865088620820440
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1699568242032636}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
serializedVersion: 2
m_Mass: 5

m_CollisionDetection: 0
--- !u!114 &114154930672833238
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
m_Enabled: 1
m_EditorHideFlags: 0

respawn: 0
myArea: {fileID: 0}
--- !u!135 &135161629589834772
SphereCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1699568242032636}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.75
m_Center: {x: 0, y: 0, z: 0}

7
Project/Assets/ML-Agents/Examples/FoodCollector/Demos/ExpertFood.demo.meta


fileFormatVersion: 2
guid: 95285c32be79a4c77a5ac225e671e4b5
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/FoodCollector/Demos/ExpertFood.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/FoodCollector/Demos/ExpertFood.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

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

6
Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs


private bool m_RandomizeWalkSpeedEachEpisode;
//The direction an agent will walk during training.
[Header("Target To Walk Towards")] public Transform dynamicTargetPrefab; //Target prefab to use in Dynamic envs
[Header("Target To Walk Towards")]
public Transform dynamicTargetPrefab; //Target prefab to use in Dynamic envs
private Transform m_Target; //Target the agent will walk towards during training.
public Transform m_Target; //Target the agent will walk towards during training.
[Header("Body Parts")] [Space(10)] public Transform body;
public Transform leg0Upper;

7
Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpCrawlerDynVS.demo.meta


fileFormatVersion: 2
guid: 34586a8d0f1c342a49973b36a609e73b
ScriptedImporter:
fileIDToRecycleName:
11400002: Assets/ML-Agents/Examples/Crawler/Demos/ExpCrawlerDynVS.demo
internalIDToNameTable:
- first:
114: 11400002
second: Assets/ML-Agents/Examples/Crawler/Demos/ExpCrawlerDynVS.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpCrawlerStaVS.demo.meta


fileFormatVersion: 2
guid: bb01ccbc2dfbc47cfacfaa52ddfc4e96
ScriptedImporter:
fileIDToRecycleName:
11400002: Assets/ML-Agents/Examples/Crawler/Demos/ExpCrawlerStaVS.demo
internalIDToNameTable:
- first:
114: 11400002
second: Assets/ML-Agents/Examples/Crawler/Demos/ExpCrawlerStaVS.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerDyn.demo.meta


fileFormatVersion: 2
guid: 3f667fd81a6f9437ba91dd70a1f2209b
ScriptedImporter:
fileIDToRecycleName:
11400002: Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerDyn.demo
internalIDToNameTable:
- first:
114: 11400002
second: Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerDyn.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerSta.demo.meta


fileFormatVersion: 2
guid: a7654a04b30024a8cbe6121997b01f59
ScriptedImporter:
fileIDToRecycleName:
11400002: Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerSta.demo
internalIDToNameTable:
- first:
114: 11400002
second: Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerSta.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerDy.demo.meta


fileFormatVersion: 2
guid: 9f87b3070a0fd4a1e838131a91399c2f
ScriptedImporter:
fileIDToRecycleName:
11400002: Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerDy.demo
internalIDToNameTable:
- first:
114: 11400002
second: Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerDy.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerDyVS.demo.meta


fileFormatVersion: 2
guid: a4b02e2c382c247919eb63ce72e90a3b
ScriptedImporter:
fileIDToRecycleName:
11400002: Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerDyVS.demo
internalIDToNameTable:
- first:
114: 11400002
second: Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerDyVS.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerStVS.demo.meta


fileFormatVersion: 2
guid: edcbb505552464c5c829886a4a3817dd
ScriptedImporter:
fileIDToRecycleName:
11400002: Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerStVS.demo
internalIDToNameTable:
- first:
114: 11400002
second: Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerStVS.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerSta.demo.meta


fileFormatVersion: 2
guid: 1f3a5d62e6aea4b5eb053ac33f11b06d
ScriptedImporter:
fileIDToRecycleName:
11400002: Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerSta.demo
internalIDToNameTable:
- first:
114: 11400002
second: Assets/ML-Agents/Examples/Walker/Demos/ExpertWalkerSta.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Basic/Demos/ExpertBasic.demo.meta


fileFormatVersion: 2
guid: 414224ce8b3e247ad936b17f574b10ab
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/Basic/Demos/ExpertBasic.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/Basic/Demos/ExpertBasic.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

16
Project/Assets/ML-Agents/Examples/SharedAssets/Prefabs/Targets/DynamicTarget.prefab


- component: {fileID: 3826955612593018128}
- component: {fileID: 3858402326794362026}
- component: {fileID: 3631016866778687563}
- component: {fileID: 114455976044412662}
m_Layer: 0
m_Name: DynamicTarget
m_TagString: target

onCollisionExitEvent:
m_PersistentCalls:
m_Calls: []
--- !u!114 &114455976044412662
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3840539935788495952}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1d08fceed19554884bcef5f0c316ca2d, type: 3}
m_Name:
m_EditorClassIdentifier:
maxTorque: {x: 111, y: 111, z: 0}
randomizeTorqueEveryXSec: 10
forceMode: 0

7
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/JointDriveController.cs


/// <summary>
/// Create BodyPart object and add it to dictionary.
/// </summary>
public void SetupBodyPart(Transform t)
// public void SetupBodyPart(Transform t)
public void SetupBodyPart(Transform t, bool includeJoint = true)
{
var bp = new BodyPart
{

startingRot = t.rotation
};
if (!includeJoint)
{
bp.joint = null;
}
bp.rb.maxAngularVelocity = k_MaxAngularVelocity;
// Add & setup the ground contact script

7
Project/Assets/ML-Agents/Examples/PushBlock/Demos/ExpertPush.demo.meta


fileFormatVersion: 2
guid: 7f11f35191533404c9957443a681aaee
ScriptedImporter:
fileIDToRecycleName:
11400000: Assets/ML-Agents/Examples/PushBlock/Demos/ExpertPush.demo
internalIDToNameTable:
- first:
114: 11400000
second: Assets/ML-Agents/Examples/PushBlock/Demos/ExpertPush.demo
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'
assetBundleName:
assetBundleVariant:

28
config/sac/PushBlockcopy.yaml


behaviors:
PushBlock:
trainer_type: sac
hyperparameters:
learning_rate: 0.0003
learning_rate_schedule: constant
batch_size: 128
buffer_size: 50000
buffer_init_steps: 0
tau: 0.005
steps_per_update: 10.0
save_replay_buffer: false
init_entcoef: 0.05
reward_signal_steps_per_update: 10.0
network_settings:
normalize: false
hidden_units: 256
num_layers: 2
vis_encode_type: simple
reward_signals:
extrinsic:
gamma: 0.99
strength: 1.0
keep_checkpoints: 5
max_steps: 2000000
time_horizon: 64
summary_freq: 100000
threaded: true

1001
com.unity.ml-agents.extensions/Documentation~/images/gridsensor-debug.png
文件差异内容过多而无法显示
查看文件

423
Project/Packages/packages-lock.json


{
"dependencies": {
"com.unity.2d.sprite": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.2d.tilemap": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.ads": {
"version": "3.6.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.analytics": {
"version": "3.3.5",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.barracuda": {
"version": "1.1.1-preview",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.3.4"
},
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.3.4",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.2.1"
},
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.2.16",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "1.1.4",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.1"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.3",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.mathematics": {
"version": "1.2.1",
"depth": 3,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ml-agents": {
"version": "1.4.0-preview",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.barracuda": "1.1.1-preview",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ml-agents.extensions": {
"version": "file:../../com.unity.ml-agents.extensions",
"depth": 0,
"source": "local",
"dependencies": {
"com.unity.ml-agents": "1.4.0-preview"
}
},
"com.unity.multiplayer-hlapi": {
"version": "1.0.8",
"depth": 0,
"source": "registry",
"dependencies": {
"nuget.mono-cecil": "0.1.6-preview"
},
"url": "https://packages.unity.com"
},
"com.unity.purchasing": {
"version": "2.2.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.22",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "2.0.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.2.6",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.xr.legacyinputhelpers": {
"version": "2.1.7",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.xr": "1.0.0"
},
"url": "https://packages.unity.com"
},
"nuget.mono-cecil": {
"version": "0.1.6-preview",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.modules.ai": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.androidjni": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.animation": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.assetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.audio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.cloth": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.director": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.animation": "1.0.0"
}
},
"com.unity.modules.imageconversion": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imgui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.jsonserialize": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.particlesystem": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics2d": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.screencapture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.subsystems": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.terrain": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.terrainphysics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.terrain": "1.0.0"
}
},
"com.unity.modules.tilemap": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics2d": "1.0.0"
}
},
"com.unity.modules.ui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.uielements": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.umbra": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unityanalytics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.unitywebrequest": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unitywebrequestassetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.unitywebrequestaudio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.audio": "1.0.0"
}
},
"com.unity.modules.unitywebrequesttexture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.unitywebrequestwww": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.vehicles": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.video": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.vr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
},
"com.unity.modules.wind": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.xr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.subsystems": "1.0.0"
}
}
}
}

38
Project/ProjectSettings/PackageManagerSettings.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 61
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_ScopedRegistriesSettingsExpanded: 1
oneTimeWarningShown: 0
m_Registries:
- m_Id: main
m_Name:
m_Url: https://packages.unity.com
m_Scopes: []
m_IsDefault: 1
m_UserSelectedRegistryName:
m_UserAddingNewScopedRegistry: 0
m_RegistryInfoDraft:
m_ErrorMessage:
m_Original:
m_Id:
m_Name:
m_Url:
m_Scopes: []
m_IsDefault: 0
m_Modified: 0
m_Name:
m_Url:
m_Scopes:
-
m_SelectedScopeIndex: 0

10
Project/ProjectSettings/XRSettings.asset


{
"m_SettingKeys": [
"VR Device Disabled",
"VR Device User Alert"
],
"m_SettingValues": [
"False",
"False"
]
}

329
Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/Canvas.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6380077983862146057
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6380077983862146294}
- component: {fileID: 6380077983862146292}
- component: {fileID: 6380077983862146295}
m_Layer: 5
m_Name: RawImage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6380077983862146294
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077983862146057}
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: 6380077985063908494}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 150, y: -128}
m_SizeDelta: {x: 200, y: 152}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6380077983862146292
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077983862146057}
m_CullTransparentMesh: 0
--- !u!114 &6380077983862146295
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077983862146057}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 8400000, guid: 114608d5384404f89bff4b6f88432958, type: 2}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!1 &6380077984111303592
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6380077984111303593}
- component: {fileID: 6380077984111303575}
- component: {fileID: 6380077984111303574}
m_Layer: 5
m_Name: DebugTxt
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6380077984111303593
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077984111303592}
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: 6380077985063908494}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 179.2, y: -78.9}
m_SizeDelta: {x: 300, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6380077984111303575
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077984111303592}
m_CullTransparentMesh: 0
--- !u!114 &6380077984111303574
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077984111303592}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!1 &6380077985063908482
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6380077985063908494}
- component: {fileID: 6380077985063908481}
- component: {fileID: 6380077985063908480}
- component: {fileID: 6380077985063908483}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6380077985063908494
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077985063908482}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 6380077984111303593}
- {fileID: 6380077985557219673}
- {fileID: 6380077983862146294}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!223 &6380077985063908481
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077985063908482}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!114 &6380077985063908480
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077985063908482}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!114 &6380077985063908483
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077985063908482}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1 &6380077985557219672
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6380077985557219673}
- component: {fileID: 6380077985557219655}
- component: {fileID: 6380077985557219654}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6380077985557219673
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077985557219672}
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: 6380077985063908494}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 150, y: -230}
m_SizeDelta: {x: 160, y: 55.599976}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6380077985557219655
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077985557219672}
m_CullTransparentMesh: 0
--- !u!114 &6380077985557219654
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6380077985557219672}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 22
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 7
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'Agent View
(RenderTexture)'

7
Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/Canvas.prefab.meta


fileFormatVersion: 2
guid: e2aeaee87f7b0435ea6e2abcc16faf03
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/Crawler/Scenes/CrawlerGRAVEYARD.unity.meta


fileFormatVersion: 2
guid: 107f7bd9f46354507912c9f9c1e8f528
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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

7
Project/Assets/ML-Agents/Examples/Crawler/Prefabs/CreaturePlatform.prefab.meta


fileFormatVersion: 2
guid: ceb215c8c337148d4b7a279c1cbe8346
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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

13
Project/Assets/ML-Agents/Examples/Crawler/Scripts/CreatureAgent.cs.meta


fileFormatVersion: 2
guid: 9f550fc87a87f4a9d9d74e6122ce0f9e
timeCreated: 1525902546
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

465
Project/Assets/ML-Agents/Examples/Crawler/Scripts/CreatureAgent.cs


using System;
using UnityEngine;
using Unity.MLAgents;
using Unity.Barracuda;
using Unity.MLAgents.Actuators;
using Unity.MLAgentsExamples;
using Unity.MLAgents.Sensors;
using Random = UnityEngine.Random;
[RequireComponent(typeof(JointDriveController))] // Required to set joint forces
public class CreatureAgent : Agent
{
//The type of crawler behavior we want to use.
//This setting will determine how the agent is set up during initialization.
public enum CrawlerAgentBehaviorType
{
CrawlerDynamic,
CrawlerDynamicVariableSpeed,
CrawlerStatic,
CrawlerStaticVariableSpeed
}
[Tooltip(
"VariableSpeed - The agent will sample random speed magnitudes while training.\n" +
"Dynamic - The agent will run towards a target that changes position.\n" +
"Static - The agent will run towards a static target. "
)]
public CrawlerAgentBehaviorType typeOfCrawler;
//Crawler Brains
//A different brain will be used depending on the CrawlerAgentBehaviorType selected
[Header("NN Models")] public NNModel crawlerDyModel;
public NNModel crawlerDyVSModel;
public NNModel crawlerStModel;
public NNModel crawlerStVSModel;
[Header("Walk Speed")]
[Range(m_minWalkingSpeed, m_maxWalkingSpeed)]
[SerializeField]
[Tooltip(
"The speed the agent will try to match.\n\n" +
"TRAINING:\n" +
"For VariableSpeed envs, this value will randomize at the start of each training episode.\n" +
"Otherwise the agent will try to match the speed set here.\n\n" +
"INFERENCE:\n" +
"During inference, VariableSpeed agents will modify their behavior based on this value " +
"whereas the CrawlerDynamic & CrawlerStatic agents will run at the speed specified during training "
)]
//The walking speed to try and achieve
private float m_TargetWalkingSpeed = m_maxWalkingSpeed;
const float m_minWalkingSpeed = .01f; //The max walking speed
const float m_maxWalkingSpeed = 15; //The max walking speed
//The current target walking speed. Clamped because a value of zero will cause NaNs
public float TargetWalkingSpeed
{
get { return m_TargetWalkingSpeed; }
set { m_TargetWalkingSpeed = Mathf.Clamp(value, m_minWalkingSpeed, m_maxWalkingSpeed); }
}
//Should the agent sample a new goal velocity each episode?
//If true, TargetWalkingSpeed will be randomly set between 0.1 and m_maxWalkingSpeed in OnEpisodeBegin()
//If false, the goal velocity will be m_maxWalkingSpeed
private bool m_RandomizeWalkSpeedEachEpisode;
//The direction an agent will walk during training.
[Header("Target To Walk Towards")]
public Transform dynamicTargetPrefab; //Target prefab to use in Dynamic envs
public Transform staticTargetPrefab; //Target prefab to use in Static envs
public Transform m_Target; //Target the agent will walk towards during training.
[Header("Body Parts")] [Space(10)] public Transform body;
public Transform bodyMiddle;
public Transform body1;
public Transform leg0Upper;
public Transform leg0Lower;
public Transform leg1Upper;
public Transform leg1Lower;
public Transform leg2Upper;
public Transform leg2Lower;
public Transform leg3Upper;
public Transform leg3Lower;
public Transform leg4Upper;
public Transform leg4Lower;
public Transform leg5Upper;
public Transform leg5Lower;
//This will be used as a stabilized model space reference point for observations
//Because ragdolls can move erratically during training, using a stabilized reference transform improves learning
OrientationCubeController m_OrientationCube;
//The indicator graphic gameobject that points towards the target
DirectionIndicator m_DirectionIndicator;
JointDriveController m_JdController;
[Header("Foot Grounded Visualization")]
[Space(10)]
public bool useFootGroundedVisualization;
public MeshRenderer foot0;
public MeshRenderer foot1;
public MeshRenderer foot2;
public MeshRenderer foot3;
public Material groundedMaterial;
public Material unGroundedMaterial;
private Vector3 m_StartingPos; //starting position of the agent
public override void Initialize()
{
SetAgentType();
m_StartingPos = body.position;
m_OrientationCube = GetComponentInChildren<OrientationCubeController>();
m_DirectionIndicator = GetComponentInChildren<DirectionIndicator>();
m_JdController = GetComponent<JointDriveController>();
//Setup each body part
m_JdController.SetupBodyPart(body);
m_JdController.SetupBodyPart(bodyMiddle, false);
m_JdController.SetupBodyPart(body1, false);
m_JdController.SetupBodyPart(leg0Upper);
m_JdController.SetupBodyPart(leg0Lower);
m_JdController.SetupBodyPart(leg1Upper);
m_JdController.SetupBodyPart(leg1Lower);
m_JdController.SetupBodyPart(leg2Upper);
m_JdController.SetupBodyPart(leg2Lower);
m_JdController.SetupBodyPart(leg3Upper);
m_JdController.SetupBodyPart(leg3Lower);
m_JdController.SetupBodyPart(leg4Upper);
m_JdController.SetupBodyPart(leg4Lower);
m_JdController.SetupBodyPart(leg5Upper);
m_JdController.SetupBodyPart(leg5Lower);
}
/// <summary>
/// Spawns a target prefab at pos
/// </summary>
/// <param name="prefab"></param>
/// <param name="pos"></param>
void SpawnTarget(Transform prefab, Vector3 pos)
{
m_Target = Instantiate(prefab, pos, Quaternion.identity, transform);
}
/// <summary>
/// Set up the agent based on the typeOfCrawler
/// </summary>
void SetAgentType()
{
var behaviorParams = GetComponent<Unity.MLAgents.Policies.BehaviorParameters>();
switch (typeOfCrawler)
{
case CrawlerAgentBehaviorType.CrawlerDynamic:
{
behaviorParams.BehaviorName = "CrawlerDynamic"; //set behavior name
if (crawlerDyModel)
behaviorParams.Model = crawlerDyModel; //assign the model
m_RandomizeWalkSpeedEachEpisode = false; //do not randomize m_TargetWalkingSpeed during training
SpawnTarget(dynamicTargetPrefab, transform.position); //spawn target
break;
}
case CrawlerAgentBehaviorType.CrawlerDynamicVariableSpeed:
{
behaviorParams.BehaviorName = "CrawlerDynamicVariableSpeed"; //set behavior name
if (crawlerDyVSModel)
behaviorParams.Model = crawlerDyVSModel; //assign the model
m_RandomizeWalkSpeedEachEpisode = true; //randomize m_TargetWalkingSpeed during training
SpawnTarget(dynamicTargetPrefab, transform.position); //spawn target
break;
}
case CrawlerAgentBehaviorType.CrawlerStatic:
{
behaviorParams.BehaviorName = "CrawlerStatic"; //set behavior name
if (crawlerStModel)
behaviorParams.Model = crawlerStModel; //assign the model
m_RandomizeWalkSpeedEachEpisode = false; //do not randomize m_TargetWalkingSpeed during training
SpawnTarget(staticTargetPrefab, transform.TransformPoint(new Vector3(0, 0, 1000))); //spawn target
break;
}
case CrawlerAgentBehaviorType.CrawlerStaticVariableSpeed:
{
behaviorParams.BehaviorName = "CrawlerStaticVariableSpeed"; //set behavior name
if (crawlerStVSModel)
behaviorParams.Model = crawlerStVSModel; //assign the model
m_RandomizeWalkSpeedEachEpisode = true; //randomize m_TargetWalkingSpeed during training
SpawnTarget(staticTargetPrefab, transform.TransformPoint(new Vector3(0, 0, 1000))); //spawn target
break;
}
}
}
/// <summary>
/// Loop over body parts and reset them to initial conditions.
/// </summary>
public override void OnEpisodeBegin()
{
foreach (var bodyPart in m_JdController.bodyPartsDict.Values)
{
bodyPart.Reset(bodyPart);
}
//Random start rotation to help generalize
body.rotation = Quaternion.Euler(0, Random.Range(0.0f, 360.0f), 0);
UpdateOrientationObjects();
//Set our goal walking speed
TargetWalkingSpeed =
m_RandomizeWalkSpeedEachEpisode ? Random.Range(m_minWalkingSpeed, m_maxWalkingSpeed) : TargetWalkingSpeed;
}
/// <summary>
/// Add relevant information on each body part to observations.
/// </summary>
public void CollectObservationBodyPart(BodyPart bp, VectorSensor sensor)
{
//GROUND CHECK
sensor.AddObservation(bp.groundContact.touchingGround); // Is this bp touching the ground
if (bp.rb.transform != body)
{
sensor.AddObservation(bp.currentStrength / m_JdController.maxJointForceLimit);
}
}
/// <summary>
/// Loop over body parts to add them to observation.
/// </summary>
public override void CollectObservations(VectorSensor sensor)
{
var cubeForward = m_OrientationCube.transform.forward;
//velocity we want to match
var velGoal = cubeForward * TargetWalkingSpeed;
//ragdoll's avg vel
var avgVel = GetAvgVelocity();
// sensor.AddObservation((Vector3.Dot(cubeForward, body.forward) + 1) * .5F);
// sensor.AddObservation((Vector3.Dot(m_OrientationCube.transform.up, body.up) + 1) * .5F);
//current ragdoll velocity. normalized
sensor.AddObservation(Vector3.Distance(velGoal, avgVel));
//avg body vel relative to cube
sensor.AddObservation(m_OrientationCube.transform.InverseTransformDirection(avgVel));
//vel goal relative to cube
sensor.AddObservation(m_OrientationCube.transform.InverseTransformDirection(velGoal));
// //rotation delta
sensor.AddObservation(Quaternion.FromToRotation(body.forward, cubeForward));
//Add pos of target relative to orientation cube
sensor.AddObservation(m_OrientationCube.transform.InverseTransformPoint(m_Target.transform.position));
RaycastHit hit;
float maxRaycastDist = 10;
// if (Physics.Raycast(body.position, Vector3.down, out hit, maxRaycastDist))
if (Physics.Raycast(body.position, -body.up, out hit, maxRaycastDist))
{
sensor.AddObservation(hit.distance / maxRaycastDist);
}
else
sensor.AddObservation(1);
foreach (var bodyPart in m_JdController.bodyPartsList)
{
CollectObservationBodyPart(bodyPart, sensor);
}
}
public override void OnActionReceived(ActionBuffers actionBuffers)
{
// The dictionary with all the body parts in it are in the jdController
var bpDict = m_JdController.bodyPartsDict;
var continuousActions = actionBuffers.ContinuousActions;
var i = -1;
// Pick a new target joint rotation
bpDict[leg0Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
bpDict[leg1Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
bpDict[leg2Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
bpDict[leg3Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
bpDict[leg4Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
bpDict[leg5Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
bpDict[leg0Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
bpDict[leg1Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
bpDict[leg2Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
bpDict[leg3Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
bpDict[leg4Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
bpDict[leg5Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
// Update joint strength
bpDict[leg0Upper].SetJointStrength(continuousActions[++i]);
bpDict[leg1Upper].SetJointStrength(continuousActions[++i]);
bpDict[leg2Upper].SetJointStrength(continuousActions[++i]);
bpDict[leg3Upper].SetJointStrength(continuousActions[++i]);
bpDict[leg4Upper].SetJointStrength(continuousActions[++i]);
bpDict[leg5Upper].SetJointStrength(continuousActions[++i]);
bpDict[leg0Lower].SetJointStrength(continuousActions[++i]);
bpDict[leg1Lower].SetJointStrength(continuousActions[++i]);
bpDict[leg2Lower].SetJointStrength(continuousActions[++i]);
bpDict[leg3Lower].SetJointStrength(continuousActions[++i]);
bpDict[leg4Lower].SetJointStrength(continuousActions[++i]);
bpDict[leg5Lower].SetJointStrength(continuousActions[++i]);
//Reset if Worm fell through floor;
if (body.position.y < m_StartingPos.y - 5)
{
EndEpisode();
}
}
// public override void OnActionReceived(ActionBuffers actionBuffers)
// {
// // The dictionary with all the body parts in it are in the jdController
// var bpDict = m_JdController.bodyPartsDict;
//
// var continuousActions = actionBuffers.ContinuousActions;
// var i = -1;
// // Pick a new target joint rotation
// bpDict[leg0Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
// bpDict[leg1Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
// bpDict[leg2Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
// bpDict[leg3Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
// bpDict[leg0Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
// bpDict[leg1Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
// bpDict[leg2Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
// bpDict[leg3Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
//
// // Update joint strength
// bpDict[leg0Upper].SetJointStrength(continuousActions[++i]);
// bpDict[leg1Upper].SetJointStrength(continuousActions[++i]);
// bpDict[leg2Upper].SetJointStrength(continuousActions[++i]);
// bpDict[leg3Upper].SetJointStrength(continuousActions[++i]);
// bpDict[leg0Lower].SetJointStrength(continuousActions[++i]);
// bpDict[leg1Lower].SetJointStrength(continuousActions[++i]);
// bpDict[leg2Lower].SetJointStrength(continuousActions[++i]);
// bpDict[leg3Lower].SetJointStrength(continuousActions[++i]);
//
// //Reset if Worm fell through floor;
// if (body.position.y < m_StartingPos.y - 5)
// {
// EndEpisode();
// }
// }
// public override void OnActionReceived(ActionBuffers actionBuffers)
// {
// // The dictionary with all the body parts in it are in the jdController
// var bpDict = m_JdController.bodyPartsDict;
//
// var continuousActions = actionBuffers.ContinuousActions;
// var i = -1;
// // Pick a new target joint rotation
// bpDict[leg0Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
//// bpDict[leg1Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
// bpDict[leg2Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
//// bpDict[leg3Upper].SetJointTargetRotation(continuousActions[++i], continuousActions[++i], 0);
// bpDict[leg0Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
//// bpDict[leg1Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
// bpDict[leg2Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
//// bpDict[leg3Lower].SetJointTargetRotation(continuousActions[++i], 0, 0);
//
// // Update joint strength
// bpDict[leg0Upper].SetJointStrength(continuousActions[++i]);
//// bpDict[leg1Upper].SetJointStrength(continuousActions[++i]);
// bpDict[leg2Upper].SetJointStrength(continuousActions[++i]);
//// bpDict[leg3Upper].SetJointStrength(continuousActions[++i]);
// bpDict[leg0Lower].SetJointStrength(continuousActions[++i]);
//// bpDict[leg1Lower].SetJointStrength(continuousActions[++i]);
// bpDict[leg2Lower].SetJointStrength(continuousActions[++i]);
//// bpDict[leg3Lower].SetJointStrength(continuousActions[++i]);
// }
void FixedUpdate()
{
UpdateOrientationObjects();
// If enabled the feet will light up green when the foot is grounded.
// This is just a visualization and isn't necessary for function
if (useFootGroundedVisualization)
{
foot0.material = m_JdController.bodyPartsDict[leg0Lower].groundContact.touchingGround
? groundedMaterial
: unGroundedMaterial;
foot1.material = m_JdController.bodyPartsDict[leg1Lower].groundContact.touchingGround
? groundedMaterial
: unGroundedMaterial;
foot2.material = m_JdController.bodyPartsDict[leg2Lower].groundContact.touchingGround
? groundedMaterial
: unGroundedMaterial;
foot3.material = m_JdController.bodyPartsDict[leg3Lower].groundContact.touchingGround
? groundedMaterial
: unGroundedMaterial;
}
var cubeForward = m_OrientationCube.transform.forward;
// Set reward for this step according to mixture of the following elements.
// a. Match target speed
//This reward will approach 1 if it matches perfectly and approach zero as it deviates
var matchSpeedReward = GetMatchingVelocityReward(cubeForward * TargetWalkingSpeed, GetAvgVelocity());
// b. Rotation alignment with target direction.
//This reward will approach 1 if it faces the target direction perfectly and approach zero as it deviates
var lookAtTargetReward = (Vector3.Dot(cubeForward, body.forward) + 1) * .5F;
// AddReward(matchSpeedReward * lookAtTargetReward);
// var dontLayDownReward = (Vector3.Dot(m_OrientationCube.transform.up, body.up) + 1) * .5F;
var dontLayDownReward = Vector3.Dot(m_OrientationCube.transform.up, body.up);
AddReward(matchSpeedReward * lookAtTargetReward * dontLayDownReward);
}
/// <summary>
/// Update OrientationCube and DirectionIndicator
/// </summary>
void UpdateOrientationObjects()
{
m_OrientationCube.UpdateOrientation(body, m_Target);
if (m_DirectionIndicator)
{
m_DirectionIndicator.MatchOrientation(m_OrientationCube.transform);
}
}
/// <summary>
///Returns the average velocity of all of the body parts
///Using the velocity of the body only has shown to result in more erratic movement from the limbs
///Using the average helps prevent this erratic movement
/// </summary>
Vector3 GetAvgVelocity()
{
Vector3 velSum = Vector3.zero;
Vector3 avgVel = Vector3.zero;
//ALL RBS
int numOfRB = 0;
foreach (var item in m_JdController.bodyPartsList)
{
numOfRB++;
velSum += item.rb.velocity;
}
avgVel = velSum / numOfRB;
return avgVel;
}
/// <summary>
/// Normalized value of the difference in actual speed vs goal walking speed.
/// </summary>
public float GetMatchingVelocityReward(Vector3 velocityGoal, Vector3 actualVelocity)
{
//distance between our actual velocity and goal velocity
var velDeltaMagnitude = Mathf.Clamp(Vector3.Distance(actualVelocity, velocityGoal), 0, TargetWalkingSpeed);
//return the value on a declining sigmoid shaped curve that decays from 1 to 0
//This reward will approach 1 if it matches perfectly and approach zero as it deviates
return Mathf.Pow(1 - Mathf.Pow(velDeltaMagnitude / TargetWalkingSpeed, 2), 2);
}
/// <summary>
/// Agent touched the target
/// </summary>
public void TouchedTarget()
{
AddReward(1f);
}
}

1001
Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature2Legs.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature2Legs.nn.meta


fileFormatVersion: 2
guid: 7da1a25807a734bea87504fb16fa01ea
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerDynamicVariableSpeedUpsideDownPenGroundPen.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerDynamicVariableSpeedUpsideDownPenGroundPen.nn.meta


fileFormatVersion: 2
guid: b3d07320d22564caca58080db23a0e90
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature6Legs.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature6Legs.nn.meta


fileFormatVersion: 2
guid: f658581214f5a446986ebfa0de5884d6
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature6LegsOld.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/Crawler/TFModels/Creature6LegsOld.nn.meta


fileFormatVersion: 2
guid: 873e61595007a498081e505cf9c05a2e
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/Crawler/TFModels/CreatureMaster.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/Crawler/TFModels/CreatureMaster.nn.meta


fileFormatVersion: 2
guid: 4ed852db9b6714c93833898bc7e91f54
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

78
Project/Assets/ML-Agents/Examples/SharedAssets/Materials/MOON.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: MOON
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _Mode: 3
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 0
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 0, g: 0, b: 0, a: 0.21568628}
- _EmissionColor: {r: 0.61503774, g: 0.63782555, b: 0.6981132, a: 1}

8
Project/Assets/ML-Agents/Examples/SharedAssets/Materials/MOON.mat.meta


fileFormatVersion: 2
guid: 9c430da4bdf75438d89106f7f486c83c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

77
Project/Assets/ML-Agents/Examples/SharedAssets/Materials/ProjectileMat.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ProjectileMat
m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION _GLOSSYREFLECTIONS_OFF
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 0.9258982, b: 0, a: 1}
- _EmissionColor: {r: 1, g: 0.6018832, b: 0, a: 1}

10
Project/Assets/ML-Agents/Examples/SharedAssets/Materials/ProjectileMat.mat.meta


fileFormatVersion: 2
guid: b619b5e5be0fb4c5bb27daeccc4035c4
timeCreated: 1513128297
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

78
Project/Assets/ML-Agents/Examples/SharedAssets/Materials/WhiteEmissive.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: WhiteEmissive
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _Mode: 3
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 0
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 0, g: 0, b: 0, a: 0.21568628}
- _EmissionColor: {r: 0.49056602, g: 0.49056602, b: 0.49056602, a: 1}

8
Project/Assets/ML-Agents/Examples/SharedAssets/Materials/WhiteEmissive.mat.meta


fileFormatVersion: 2
guid: b0c79355837b24c03a76733e3629163d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/SharedAssets/Prefabs/PlayerCubeWithGun.prefab.meta


fileFormatVersion: 2
guid: 497c5a1fa56ff4204a66acfb42a8ebde
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7
Project/Assets/ML-Agents/Examples/SharedAssets/Prefabs/Projectile.prefab.meta


fileFormatVersion: 2
guid: 01e75f85d5a3c451b9a5bed7070be0a0
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

704
Project/Assets/ML-Agents/Examples/SharedAssets/Prefabs/PlayerCubeWithGun.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1876700408
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1876700409}
- component: {fileID: 1876700410}
m_Layer: 0
m_Name: Area Light (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1876700409
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1876700408}
m_LocalRotation: {x: -0, y: -0.7071068, z: 0.7071068, w: 0}
m_LocalPosition: {x: 0, y: 5, z: 2.06}
m_LocalScale: {x: 2, y: 0.5000005, z: 3}
m_Children: []
m_Father: {fileID: 2170513384791859414}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!108 &1876700410
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1876700408}
m_Enabled: 1
serializedVersion: 8
m_Type: 2
m_Color: {r: 1, g: 0.9212542, b: 0.3915094, a: 1}
m_Intensity: 15
m_Range: 7
m_SpotAngle: 125
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!1 &2170513383024431815
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513383024431812}
- component: {fileID: 2170513383024431810}
- component: {fileID: 2170513383024431813}
m_Layer: 0
m_Name: eye
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513383024431812
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383024431815}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalPosition: {x: 0.29999995, y: 0.07399994, z: 0.50040054}
m_LocalScale: {x: 0.29457998, y: 0.29457998, z: 0.29457998}
m_Children: []
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!33 &2170513383024431810
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383024431815}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2170513383024431813
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383024431815}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: f731be6866ce749fd8349e67ae81f76a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2170513383347468444
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513383347468445}
- component: {fileID: 2170513383347468443}
- component: {fileID: 2170513383347468442}
m_Layer: 0
m_Name: mouth
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513383347468445
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383347468444}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalPosition: {x: 0, y: -0.18299997, z: 0.50040054}
m_LocalScale: {x: 0.27602, y: 0.042489994, z: 0.13891}
m_Children: []
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!33 &2170513383347468443
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383347468444}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2170513383347468442
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383347468444}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: f731be6866ce749fd8349e67ae81f76a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2170513383808163268
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513383808163269}
- component: {fileID: 2170513383808163267}
- component: {fileID: 2170513383808163266}
m_Layer: 0
m_Name: AgentCube_Blue
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513383808163269
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383808163268}
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:
- {fileID: 2170513384853870151}
- {fileID: 2170513383024431812}
- {fileID: 2170513384254877933}
- {fileID: 2170513383347468445}
- {fileID: 2170513384182965506}
m_Father: {fileID: 2170513384791859414}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &2170513383808163267
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383808163268}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2170513383808163266
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383808163268}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c9fa44c2c3f8ce74ca39a3355ea42631, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2170513384182965509
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513384182965506}
- component: {fileID: 2170513384182965504}
- component: {fileID: 2170513384182965507}
m_Layer: 0
m_Name: Headband
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513384182965506
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384182965509}
m_LocalRotation: {x: -0, y: -0, z: 0.016506119, w: 0.9998638}
m_LocalPosition: {x: 0, y: 0.341, z: 0}
m_LocalScale: {x: 1.0441425, y: 0.19278127, z: 1.0441422}
m_Children: []
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: -179.99998, z: 1.8920001}
--- !u!33 &2170513384182965504
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384182965509}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2170513384182965507
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384182965509}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 04be259c590de46f69db4cbd1da877d5, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2170513384254877932
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513384254877933}
- component: {fileID: 2170513384254877931}
- component: {fileID: 2170513384254877930}
m_Layer: 0
m_Name: eye
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513384254877933
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384254877932}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalPosition: {x: -0.29999995, y: 0.07399994, z: 0.50040054}
m_LocalScale: {x: 0.29457998, y: 0.29457998, z: 0.29457998}
m_Children: []
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!33 &2170513384254877931
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384254877932}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2170513384254877930
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384254877932}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: f731be6866ce749fd8349e67ae81f76a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2170513384717669919
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513384717669916}
- component: {fileID: 2170513384717669917}
m_Layer: 0
m_Name: GUN
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513384717669916
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384717669919}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 1.02}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2170513384791859414}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2170513384717669917
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384717669919}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 975a5260e89274437b77fd60ca9c1ed1, type: 3}
m_Name:
m_EditorClassIdentifier:
initialized: 0
projectilePrefab: {fileID: 3911029810215854908, guid: 01e75f85d5a3c451b9a5bed7070be0a0,
type: 3}
numberOfProjectilesToPool: 25
projectileStartingPos: {fileID: 2170513384717669916}
projectileLaunchAngle: 5
shootingRate: 0.02
coolDownWait: 0
autoShootEnabled: 0
autoShootDistance: 33
useStandaloneInput: 0
shootKey: 106
--- !u!1 &2170513384791859417
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513384791859414}
- component: {fileID: 2170513384791859413}
- component: {fileID: 2170513384791859412}
- component: {fileID: 2170513384791859415}
- component: {fileID: 2170513384791859410}
m_Layer: 0
m_Name: PlayerCubeWithGun
m_TagString: agent
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513384791859414
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384791859417}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2170513383808163269}
- {fileID: 2170513384717669916}
- {fileID: 1876700409}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!54 &2170513384791859413
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384791859417}
serializedVersion: 2
m_Mass: 3
m_Drag: 0.05
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 80
m_CollisionDetection: 3
--- !u!65 &2170513384791859412
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384791859417}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &2170513384791859415
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384791859417}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eda0377c523784b2e979b7d192b272d7, type: 3}
m_Name:
m_EditorClassIdentifier:
maxAngularVel: 50
runningForceMode: 2
agentRunSpeed: 10
agentTerminalVel: 20
agentRunInAirSpeed: 7
dashBoostForce: 20
dashForceMode: 1
dashPressed: 0
agentIdleDragVelCoeff: 0.9
groundPoundForceMode: 2
groundPoundForce: 35
spinAttackSpeed: 20
agentRotationSpeed: 35
agentJumpVelocity: 25
agentFallingSpeed: 50
--- !u!114 &2170513384791859410
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384791859417}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 491a09f8a027b44ce87fc4c37f18547f, type: 3}
m_Name:
m_EditorClassIdentifier:
debugDrawGizmos: 0
hitGroundColliders:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
groundCheckBoxLocalPos: {x: 0, y: -0.52, z: 0}
groundCheckBoxSize: {x: 0.99, y: 0.1, z: 0.99}
isGrounded: 0
ungroundedTime: 0
groundedTime: 0
--- !u!1 &2170513384853870150
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513384853870151}
- component: {fileID: 2170513384853870148}
m_Layer: 0
m_Name: AgentCamera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &2170513384853870151
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384853870150}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.15}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &2170513384853870148
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384853870150}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294950911
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022

129
Project/Assets/ML-Agents/Examples/SharedAssets/Prefabs/Projectile.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3911029810215854908
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3911029810215854904}
- component: {fileID: 3911029810215854911}
- component: {fileID: 3911029810215854910}
- component: {fileID: 3911029810215854909}
- component: {fileID: 648473049}
- component: {fileID: 4341296992446652170}
m_Layer: 0
m_Name: Projectile
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3911029810215854904
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.8, z: 0}
m_LocalScale: {x: 0.4, y: 0.4, z: 0.4}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3911029810215854911
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &3911029810215854910
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: b619b5e5be0fb4c5bb27daeccc4035c4, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!65 &3911029810215854909
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &648473049
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 675ac467ea9374f16a31f2849d2cc769, type: 3}
m_Name:
m_EditorClassIdentifier:
aliveTime: 0
rb: {fileID: 0}
selfDestructNow: 0
maxTimeToLive: 3
pauseCollisionDetectionWaitTime: 0.1
projectileController: {fileID: 0}
--- !u!54 &4341296992446652170
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
serializedVersion: 2
m_Mass: 10
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 3

135
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/CollisionCallbacks.cs


using UnityEngine;
using Random = UnityEngine.Random;
using Unity.MLAgents;
using UnityEngine.Events;
namespace Unity.MLAgentsExamples
{
/// <summary>
/// Utility class to allow target placement and collision detection with an agent
/// Add this script to the target you want the agent to touch.
/// Callbacks will be triggered any time the target is touched with a collider tagged as 'tagToDetect'
/// </summary>
public class CollisionCallbacks : MonoBehaviour
{
[Header("Collider Tag To Detect")]
public string tagToDetect = "agent"; //collider tag to detect
[Header("Target Placement")]
public float spawnRadius; //The radius in which a target can be randomly spawned.
public bool respawnIfTouched; //Should the target respawn to a different position when touched
[Header("Target Fell Protection")]
public bool respawnIfFallsOffPlatform = true; //If the target falls off the platform, reset the position.
public float fallDistance = 5; //distance below the starting height that will trigger a respawn
private Vector3 m_startingPos; //the starting position of the target
private Agent m_agentTouching; //the agent currently touching the target
[System.Serializable]
public class TriggerEvent : UnityEvent<Collider>
{
}
[Header("Trigger Callbacks")]
public TriggerEvent onTriggerEnterEvent = new TriggerEvent();
public TriggerEvent onTriggerStayEvent = new TriggerEvent();
public TriggerEvent onTriggerExitEvent = new TriggerEvent();
[System.Serializable]
public class CollisionEvent : UnityEvent<Collision>
{
}
[Header("Collision Callbacks")]
public CollisionEvent onCollisionEnterEvent = new CollisionEvent();
public CollisionEvent onCollisionStayEvent = new CollisionEvent();
public CollisionEvent onCollisionExitEvent = new CollisionEvent();
// Start is called before the first frame update
void OnEnable()
{
m_startingPos = transform.position;
if (respawnIfTouched)
{
MoveTargetToRandomPosition();
}
}
void Update()
{
if (respawnIfFallsOffPlatform)
{
if (transform.position.y < m_startingPos.y - fallDistance)
{
Debug.Log($"{transform.name} Fell Off Platform");
MoveTargetToRandomPosition();
}
}
}
/// <summary>
/// Moves target to a random position within specified radius.
/// </summary>
public void MoveTargetToRandomPosition()
{
var newTargetPos = m_startingPos + (Random.insideUnitSphere * spawnRadius);
newTargetPos.y = m_startingPos.y;
transform.position = newTargetPos;
}
private void OnCollisionEnter(Collision col)
{
if (col.transform.CompareTag(tagToDetect))
{
onCollisionEnterEvent.Invoke(col);
if (respawnIfTouched)
{
MoveTargetToRandomPosition();
}
}
}
private void OnCollisionStay(Collision col)
{
if (col.transform.CompareTag(tagToDetect))
{
onCollisionStayEvent.Invoke(col);
}
}
private void OnCollisionExit(Collision col)
{
if (col.transform.CompareTag(tagToDetect))
{
onCollisionExitEvent.Invoke(col);
}
}
private void OnTriggerEnter(Collider col)
{
if (col.CompareTag(tagToDetect))
{
onTriggerEnterEvent.Invoke(col);
}
}
private void OnTriggerStay(Collider col)
{
if (col.CompareTag(tagToDetect))
{
onTriggerStayEvent.Invoke(col);
}
}
private void OnTriggerExit(Collider col)
{
if (col.CompareTag(tagToDetect))
{
onTriggerExitEvent.Invoke(col);
}
}
}
}

11
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/CollisionCallbacks.cs.meta


fileFormatVersion: 2
guid: 25d337b05a1dc4555b0a86615930e628
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

11
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AgentCubeMovement.cs.meta


fileFormatVersion: 2
guid: eda0377c523784b2e979b7d192b272d7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

11
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AgentCubeGroundCheck.cs.meta


fileFormatVersion: 2
guid: 491a09f8a027b44ce87fc4c37f18547f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

355
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AvgCenterOfMass.cs


using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Used for visualizing the average center of mass of a ragdoll
/// </summary>
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class AvgCenterOfMass : MonoBehaviour
{
[System.Serializable]
public class ShiftCom
{
public Rigidbody rb;
public Vector3 shiftComAmount;
}
/// <summary>
/// Enable to show a green spehere at the current center of mass.
/// </summary>
[Tooltip("Enable to show a green spehere at the current center of mass.")]
public bool active;
public bool showCOMGizmos = true;
public Vector3 avgCOMWorldSpace;
public Vector3 avgCOMVelocityWorldSpace;
public Vector3 previousAvgCOM;
public Color avgCOMColor = Color.green;
public Color bodyPartCOMColor = Color.yellow;
List<Rigidbody> rbList = new List<Rigidbody>();
public float totalMass;
[Tooltip("Visualize Relative Pos")]
public bool showBPPosRelToBody;
public bool useTransformPoint = true;
public bool useTransformVector;
public bool useTransformDir;
public bool showRBPos;
public bool showRelPosVectorOnly;
public bool showInverseTransformPointUnscaledRelToBody;
public bool showInverseTransformPointRelToBody;
public bool showInverseTransformVectorRelToBody;
public bool showInverseTransformDirRelToBody;
public Transform body_T;
[Tooltip("ShiftCom")] public bool updateShiftCom;
public List<ShiftCom> shiftComList = new List<ShiftCom>();
void OnEnable()
{
SetUpRigidbodies();
}
void SetUpRigidbodies()
{
rbList.Clear();
totalMass = 0;
foreach (var item in GetComponentsInChildren<Rigidbody>())
{
rbList.Add(item);
totalMass += item.mass;
}
foreach (var item in shiftComList)
{
item.rb.centerOfMass = item.shiftComAmount;
}
}
// void FixedUpdate()
// {
// if(Application.isPlaying)
// {
// avgCOMWorldSpace = Vector3.zero;
// foreach(var item in rbList)
// {
// if (item)
// {
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// }
// }
public Vector3 GetCoMWorldSpace()
{
Vector3 CoM = Vector3.zero;
avgCOMWorldSpace = Vector3.zero;
float c = 0f;
foreach (var item in rbList)
{
CoM += item.worldCenterOfMass * item.mass;
c += item.mass;
}
avgCOMWorldSpace = CoM / c;
avgCOMVelocityWorldSpace = (avgCOMWorldSpace - previousAvgCOM) / Time.fixedDeltaTime;
// Debug.DrawRay(avgCOMWorldSpace, avgCOMVelocityWorldSpace, Color.green,Time.fixedDeltaTime);
// Debug.DrawRay(avgCOMWorldSpace, Vector3.ProjectOnPlane( avgCOMVelocityWorldSpace, Vector3.up), Color.green,Time.fixedDeltaTime);
previousAvgCOM = avgCOMWorldSpace;
return avgCOMWorldSpace;
}
void FixedUpdate()
{
if (Application.isPlaying)
{
// avgCOMWorldSpace = Vector3.zero;
// foreach(var item in rbList)
// {
// if (item)
// {
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// if (active)
// {
GetCoMWorldSpace();
// }
// Vector3 CoM = Vector3.zero;
// avgCOMWorldSpace = Vector3.zero;
// float c = 0f;
//
// foreach(var item in rbList)
// {
// CoM += item.worldCenterOfMass * item.mass;
// c += item.mass;
// }
// avgCOMWorldSpace = CoM/c;
// avgCOMVelocityWorldSpace = previousAvgCOM - avgCOMWorldSpace;
// Debug.DrawRay(avgCOMWorldSpace, avgCOMVelocityWorldSpace, Color.green,Time.fixedDeltaTime);
//
// previousAvgCOM = avgCOMWorldSpace;
// // CoM /= c;
//
if (showBPPosRelToBody)
{
var pos = body_T.position;
Matrix4x4 bodyMatrix = body_T.localToWorldMatrix;
// get position from the last column
var bodyPos = new Vector3(bodyMatrix[0, 3], bodyMatrix[1, 3], bodyMatrix[2, 3]);
Debug.DrawRay(bodyPos, Vector3.up, Color.yellow, Time.fixedDeltaTime);
foreach (var rb in rbList)
{
if (showRBPos)
{
Debug.DrawRay(rb.position, Vector3.up, Color.green, Time.fixedDeltaTime);
}
if (rb.transform != body_T)
{
if (showRelPosVectorOnly)
{
var relPosVector = rb.position - body_T.position;
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
Debug.DrawRay(body_T.position + relPosVector, Vector3.up, Color.red, Time.fixedDeltaTime);
// Vector3 currentLocalPosRelToMatrix = bodyMatrix.inverse.MultiplyPoint(rb.position);
Vector3 currentLocalPosRelToMatrix = bodyMatrix.inverse.MultiplyVector(rb.position - bodyPos);
Debug.DrawRay(body_T.position + currentLocalPosRelToMatrix, Vector3.up, Color.green, Time.fixedDeltaTime);
}
if (showInverseTransformPointUnscaledRelToBody)
{
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformPointUnscaled(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformPointUnscaled(rb.transform.position), Vector3.up, Color.red,Time.fixedDeltaTime);
}
if (showInverseTransformPointRelToBody)
{
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red, Time.fixedDeltaTime);
}
if (showInverseTransformDirRelToBody)
{
Debug.DrawRay(body_T.InverseTransformDirection(rb.position), Vector3.up, Color.red, Time.fixedDeltaTime);
}
if (showInverseTransformVectorRelToBody)
{
Debug.DrawRay(body_T.position + body_T.InverseTransformVector(rb.position - body_T.position), Vector3.up, Color.red, Time.fixedDeltaTime);
}
// var localPosRelToBody = body.InverseTransformPoint(rb.position);
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + rb.transform.TransformVector(rb.transform.localPosition), Vector3.up, Color.cyan,Time.fixedDeltaTime);
// Debug.DrawRay(rb.transform.TransformPoint(rb.position), Vector3.up, Color.green,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformVector(rb.transform.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformDirection(rb.transform.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.TransformPoint(rb.transform.localPosition), Vector3.up, Color.red,Time.fixedDeltaTime);
if (useTransformPoint)
{
}
else if (useTransformVector)
{
}
else if (useTransformDir)
{
}
}
}
}
}
}
// private void OnDrawGizmosSelected()
private void OnDrawGizmos()
{
if (updateShiftCom)
{
foreach (var item in shiftComList)
{
item.rb.centerOfMass = item.shiftComAmount;
}
updateShiftCom = false;
}
if (!Application.isPlaying)
{
if (showCOMGizmos)
{
Vector3 CoM = Vector3.zero;
float c = 0f;
// avgCOMWorldSpace = Vector3.zero;
//SHOW BODY PART GIZMOS
foreach (var item in rbList)
{
// if (item)
// {
Gizmos.color = bodyPartCOMColor;
float drawCOMRadius = item.mass / totalMass;
Gizmos.DrawSphere(item.worldCenterOfMass, drawCOMRadius);
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
CoM += item.worldCenterOfMass * item.mass;
c += item.mass;
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
}
//DRAW AVG GIZMOS
avgCOMWorldSpace = CoM / c;
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
float avgCOMRadius = 0.5f; //radius of gizmo
Gizmos.color = avgCOMColor;
Gizmos.DrawWireSphere(avgCOMWorldSpace, avgCOMRadius);
}
}
else
{
if (showCOMGizmos)
{
// avgCOMWorldSpace = Vector3.zero;
//SHOW BODY PART GIZMOS
foreach (var item in rbList)
{
// if (item)
// {
Gizmos.color = bodyPartCOMColor;
float drawCOMRadius = item.mass / totalMass;
Gizmos.DrawSphere(item.worldCenterOfMass, drawCOMRadius);
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
}
//DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
float avgCOMGizmoRadius = 0.5f; //radius of gizmo
Gizmos.color = avgCOMColor;
Gizmos.DrawWireSphere(avgCOMWorldSpace, avgCOMGizmoRadius);
}
}
}
// {
// if(!Application.isPlaying)
// {
// if (showCOMGizmos)
// {
// avgCOMWorldSpace = Vector3.zero;
// //SHOW BODY PART GIZMOS
// foreach(var item in rbList)
// {
// if (item)
// {
// Gizmos.color = bodyPartCOMColor;
// float drawCOMRadius = item.mass/totalMass;
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// float avgCOMRadius = 0.1f; //radius of gizmo
// Gizmos.color = avgCOMColor;
// Gizmos.DrawSphere(avgCOMWorldSpace, avgCOMRadius);
// }
// }
// else
// {
// if (showCOMGizmos)
// {
// // avgCOMWorldSpace = Vector3.zero;
// //SHOW BODY PART GIZMOS
// foreach(var item in rbList)
// {
// if (item)
// {
// Gizmos.color = bodyPartCOMColor;
// float drawCOMRadius = item.mass/totalMass;
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
// // avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// // avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// float avgCOMGizmoRadius = 0.1f; //radius of gizmo
// Gizmos.color = avgCOMColor;
// Gizmos.DrawSphere(avgCOMWorldSpace, avgCOMGizmoRadius);
// }
// }
// }
}

11
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AvgCenterOfMass.cs.meta


fileFormatVersion: 2
guid: 1cc40aa097c194ebeb2fd5f564bde8e8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

84
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/Projectile.cs


using UnityEngine;
//This script handles the logic to determine whether an active projectile
//...should be remain active after it has been shot by an enemy
public class Projectile : MonoBehaviour
{
public float aliveTime;
[HideInInspector] public Rigidbody rb;
// private ObstacleTowerAgent agent;
public bool selfDestructNow;
public float maxTimeToLive = 3;
public float pauseCollisionDetectionWaitTime = .5f;
[HideInInspector] public ShootProjectiles projectileController;
void Awake()
{
rb = GetComponent<Rigidbody>();
// agent = FindObjectOfType<ObstacleTowerAgent>();
}
void OnEnable()
{
if (!rb)
{
rb = GetComponent<Rigidbody>();
}
aliveTime = 0;
selfDestructNow = false;
// if (agent)
// {
// agent.CompletedFloorAction += SelfDestruct;
// }
}
void OnDisable()
{
aliveTime = 0;
// if (agent)
// {
// agent.CompletedFloorAction -= SelfDestruct;
// }
}
//Turn the projectile off
void SelfDestruct()
{
gameObject.SetActive(false);
// rb.velocity = Vector3.zero;
// rb.angularVelocity = Vector3.zero;
}
void FixedUpdate()
{
// if (
// (agent && agent.IsDone()) //if the agent is done projectiles can die
// || aliveTime > maxTimeToLive //we lived too long. time to die
// )
if (aliveTime > maxTimeToLive) //we lived too long. time to die
{
selfDestructNow = true;
}
if (selfDestructNow)
{
SelfDestruct();
}
aliveTime += Time.fixedDeltaTime;
}
void OnCollisionEnter()
{
if (aliveTime > pauseCollisionDetectionWaitTime)
{
selfDestructNow = true;
}
}
}

11
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/Projectile.cs.meta


fileFormatVersion: 2
guid: 675ac467ea9374f16a31f2849d2cc769
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

142
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ShootProjectiles.cs


using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Logic for robot projectiles.
/// </summary>
public class ShootProjectiles : MonoBehaviour
{
public bool initialized; //has this robot been initialized
public GameObject projectilePrefab;
public int numberOfProjectilesToPool = 12;
private List<Projectile> projectilePoolList = new List<Projectile>(); //projectiles to shoot
public Transform projectileStartingPos; //the transform the projectile will originate from
public float projectileLaunchAngle = 25; //the angle at which the projectile will launch
public float shootingRate = .5f; //can shoot every shootingRate seconds. ex: .5 can shoot every .5 seconds
private float shootTimer;
public bool coolDownWait;
//for standalone projectiles
public bool autoShootEnabled;
public float autoShootDistance = 4;
public bool useStandaloneInput = false;
public KeyCode shootKey = KeyCode.Space;
void Start()
{
if (!initialized)
{
Initialize();
}
}
void OnEnable()
{
if (!initialized)
{
Initialize();
}
}
void Initialize()
{
projectilePoolList.Clear(); //clear list in case it's not empty
for (var i = 0; i < numberOfProjectilesToPool; i++)
{
GameObject obj = Instantiate(projectilePrefab, transform.position, Quaternion.identity);
Projectile p = obj.GetComponent<Projectile>();
projectilePoolList.Add(p);
p.transform.position = projectileStartingPos.position;
p.projectileController = this;
p.gameObject.SetActive(false);
}
initialized = true;
}
void Update()
{
if (Input.GetKey(shootKey))
{
Shoot(projectileStartingPos.position,
projectileStartingPos.TransformPoint(Vector3.forward * autoShootDistance));
}
}
void FixedUpdate()
{
coolDownWait = shootTimer > shootingRate ? false : true;
shootTimer += Time.fixedDeltaTime;
if (autoShootEnabled)
{
Shoot(projectileStartingPos.position,
projectileStartingPos.TransformPoint(Vector3.forward * autoShootDistance));
Debug.DrawRay(projectileStartingPos.TransformPoint(Vector3.forward * autoShootDistance), Vector3.up);
}
}
public void Shoot(Vector3 startPos, Vector3 targetPos)
{
if (coolDownWait)
{
return;
}
shootTimer = 0; //reset timer
//shoot first available projectile in the pool
foreach (var item in projectilePoolList)
{
if (!item.gameObject.activeInHierarchy)
{
LaunchProjectile(item.rb, startPos, targetPos); //shoot
break;
}
}
}
public void LaunchProjectile(Rigidbody rb, Vector3 startPos, Vector3 targetPos)
{
rb.transform.position = startPos;
rb.transform.rotation = Quaternion.identity;
rb.velocity = Vector3.zero;
rb.angularVelocity = Vector3.zero;
rb.gameObject.SetActive(true);
Vector3 p = targetPos;
float gravity = Physics.gravity.magnitude;
// Selected angle in radians
float angle = projectileLaunchAngle * Mathf.Deg2Rad;
// Positions of this object and the target on the same plane
Vector3 planarTarget = new Vector3(p.x, 0, p.z);
Vector3 planarPostion = new Vector3(startPos.x, 0, startPos.z);
// Planar distance between objects
float distance = Vector3.Distance(planarTarget, planarPostion);
// Distance along the y axis between objects
float yOffset = startPos.y - p.y;
float initialVelocity = (1 / Mathf.Cos(angle)) *
Mathf.Sqrt((0.5f * gravity * Mathf.Pow(distance, 2)) /
(distance * Mathf.Tan(angle) + yOffset));
Vector3 velocity = new Vector3(0, initialVelocity * Mathf.Sin(angle), initialVelocity * Mathf.Cos(angle));
// Rotate our velocity to match the direction between the two objects
float angleBetweenObjects =
Vector3.Angle(Vector3.forward, planarTarget - planarPostion) * (p.x > startPos.x ? 1 : -1);
Vector3 finalVelocity = Quaternion.AngleAxis(angleBetweenObjects, Vector3.up) * velocity;
if (!float.IsNaN(finalVelocity.x)) //NaN checked
{
rb.velocity = finalVelocity;
}
}
}

11
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ShootProjectiles.cs.meta


fileFormatVersion: 2
guid: 975a5260e89274437b77fd60ca9c1ed1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

32
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/RandomTorqueEveryXSec.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RandomTorqueEveryXSec : MonoBehaviour
{
public Vector3 maxTorque;
private Vector3 torqueToUse;
public float randomizeTorqueEveryXSec = 10;
public ForceMode forceMode;
private Rigidbody rb;
// Start is called before the first frame update
void OnEnable()
{
rb = GetComponent<Rigidbody>();
InvokeRepeating("SetRandomTorque", 0, randomizeTorqueEveryXSec);
}
void SetRandomTorque()
{
torqueToUse = new Vector3(Random.Range(-maxTorque.x, maxTorque.x), Random.Range(-maxTorque.y, maxTorque.y),
Random.Range(-maxTorque.z, maxTorque.z));
}
// Update is called once per frame
void FixedUpdate()
{
rb.AddRelativeTorque(torqueToUse, forceMode);
}
}

11
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/RandomTorqueEveryXSec.cs.meta


fileFormatVersion: 2
guid: 1d08fceed19554884bcef5f0c316ca2d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

81
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AgentCubeGroundCheck.cs


//Standardized ground check for the Agent Cube
using UnityEngine;
namespace MLAgents
{
/// <summary>
/// Perform Groundcheck using a Physics OverlapBox
/// </summary>
[DisallowMultipleComponent]
public class AgentCubeGroundCheck : MonoBehaviour
{
public bool debugDrawGizmos;
public Collider[] hitGroundColliders = new Collider[3];
public Vector3 groundCheckBoxLocalPos = new Vector3(0, -0.52f, 0);
public Vector3 groundCheckBoxSize = new Vector3(0.99f, 0.1f, 0.99f);
public bool isGrounded;
public float ungroundedTime; //amount of time agent hasn't been grounded
public float groundedTime; //amount of time agent has been grounded
void FixedUpdate()
{
DoGroundCheck();
if (!isGrounded)
{
ungroundedTime += Time.deltaTime;
groundedTime = 0;
}
else
{
groundedTime += Time.deltaTime;
ungroundedTime = 0;
}
}
/// <summary>
/// Does the ground check.
/// </summary>
/// <returns><c>true</c>, if the agent is on the ground,
/// <c>false</c> otherwise.</returns>
/// <param name="smallCheck"></param>
public void DoGroundCheck()
{
isGrounded = false;
if (Physics.OverlapBoxNonAlloc(
transform.TransformPoint(groundCheckBoxLocalPos),
groundCheckBoxSize / 2,
hitGroundColliders,
transform.rotation) > 0)
{
foreach (var col in hitGroundColliders)
{
if (col != null && col.transform != transform &&
(col.CompareTag("walkableSurface")
|| col.CompareTag("ground")
|| col.CompareTag("block")))
{
isGrounded = true; //then we're grounded
break;
}
}
}
//empty the array
for (int i = 0; i < hitGroundColliders.Length; i++)
{
hitGroundColliders[i] = null;
}
}
//Draw the Box Overlap as a gizmo to show where it currently is testing.
void OnDrawGizmos()
{
if (debugDrawGizmos)
{
Gizmos.color = Color.red;
Gizmos.matrix = transform.localToWorldMatrix;
Gizmos.DrawWireCube(groundCheckBoxLocalPos, groundCheckBoxSize);
}
}
}
}

206
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/AgentCubeMovement.cs


//Standardized movement controller for the Agent Cube
using System;
using Unity.Mathematics;
using UnityEngine;
namespace MLAgents
{
public class AgentCubeMovement : MonoBehaviour
{
[Header("RIGIDBODY")] public float maxAngularVel = 50;
[Header("RUNNING")] public ForceMode runningForceMode = ForceMode.Impulse;
//speed agent can run if grounded
public float agentRunSpeed = 10;
public float agentTerminalVel = 20;
//speed agent can run if not grounded
public float agentRunInAirSpeed = 7f;
[Header("DASH")]
public float dashBoostForce = 20f;
public ForceMode dashForceMode = ForceMode.Impulse;
public bool dashPressed;
[Header("IDLE")]
//coefficient used to dampen velocity when idle
//the purpose of this is to fine tune agent drag
//...and prevent the agent sliding around while grounded
//0 means it will instantly stop when grounded
//1 means no drag will be applied
public float agentIdleDragVelCoeff = .9f;
[Header("GROUND POUND")]
public ForceMode groundPoundForceMode = ForceMode.Impulse;
public float groundPoundForce = 35f;
[Header("SPIN ATTACK")]
public float spinAttackSpeed = 20f;
private bool spinAttack;
[Header("BODY ROTATION")]
//body rotation speed
public float agentRotationSpeed = 35f;
[Header("JUMPING")]
//upward jump velocity magnitude
public float agentJumpVelocity = 15f;
[Header("FALLING FORCE")]
//force applied to agent while falling
public float agentFallingSpeed = 50f;
private Camera cam;
private Vector3 lookDir;
private Rigidbody rb;
private AgentCubeGroundCheck groundCheck;
void Awake()
{
cam = Camera.main;
rb = GetComponent<Rigidbody>();
groundCheck = GetComponent<AgentCubeGroundCheck>();
rb.maxAngularVelocity = maxAngularVel;
}
void Update()
{
var camForward = cam.transform.forward;
camForward.y = 0;
var camRight = cam.transform.right;
lookDir = Vector3.zero;
lookDir += Input.GetKey(KeyCode.D) ? Vector3.right : Vector3.zero;
lookDir += Input.GetKey(KeyCode.W) ? Vector3.forward : Vector3.zero;
lookDir += Input.GetKey(KeyCode.A) ? Vector3.left : Vector3.zero;
lookDir += Input.GetKey(KeyCode.S) ? Vector3.back : Vector3.zero;
if (Input.GetKeyDown(KeyCode.Space))
{
if (groundCheck)
{
if (groundCheck.isGrounded)
{
Jump(rb);
}
else
{
rb.AddForce(Vector3.down * groundPoundForce, groundPoundForceMode);
}
}
}
spinAttack = Input.GetKey(KeyCode.H);
dashPressed = Input.GetKeyDown(KeyCode.K);
if (dashPressed)
{
// dashPressed = false;
// rb.AddForce(rb.transform.forward * dashBoostForce, dashForceMode);
rb.AddTorque(rb.transform.right * dashBoostForce, dashForceMode);
print("dashPressed");
}
// if (Input.GetKey(KeyCode.D))
// {
// discreteActionsOut[0] = 3;
// }
// else if (Input.GetKey(KeyCode.W))
// {
// discreteActionsOut[0] = 1;
// }
// else if (Input.GetKey(KeyCode.A))
// {
// discreteActionsOut[0] = 4;
// }
// else if (Input.GetKey(KeyCode.S))
// {
// discreteActionsOut[0] = 2;
// }
}
void FixedUpdate()
{
if (spinAttack)
{
// rb.AddTorque(Vector3.up * spinAttackSpeed);
rb.angularVelocity = Vector3.up * spinAttackSpeed;
}
if (lookDir != Vector3.zero)
{
var dir = cam.transform.TransformDirection(lookDir);
dir.y = 0;
var rot = quaternion.LookRotation(dir, Vector3.up);
if (!spinAttack)
{
rb.rotation = Quaternion.Lerp(rb.rotation, rot, agentRotationSpeed * Time.deltaTime);
}
// RunOnGround(rb, dir.normalized);
// var dirToGo = rb.transform.forward;
var dirToGo = dir;
// RunOnGround(rb, dirToGo);
if (!groundCheck.isGrounded)
{
// RunInAir(rb, dirToGo.normalized);
}
else
{
RunOnGround(rb, dirToGo.normalized);
}
// rb.MoveRotation(rb.rotation * Quaternion.AngleAxis(agentRotationSpeed, rotationAxis));
}
else //is idle
{
if (groundCheck && groundCheck.isGrounded && !dashPressed)
{
AddIdleDrag(rb);
}
}
if (groundCheck && !groundCheck.isGrounded)
{
AddFallingForce(rb);
}
}
public void Jump(Rigidbody rb)
{
Vector3 velToUse = rb.velocity;
velToUse.y = agentJumpVelocity;
rb.velocity = velToUse;
}
public void RotateBody(Rigidbody rb, Vector3 rotationAxis)
{
rb.MoveRotation(rb.rotation * Quaternion.AngleAxis(agentRotationSpeed, rotationAxis));
}
public void RunOnGround(Rigidbody rb, Vector3 dir)
{
var vel = rb.velocity.magnitude;
float adjustedSpeed = Mathf.Clamp(agentRunSpeed - vel, 0, agentTerminalVel);
rb.AddForce(dir.normalized * adjustedSpeed,
runningForceMode);
}
public void RunInAir(Rigidbody rb, Vector3 dir)
{
var vel = rb.velocity.magnitude;
float adjustedSpeed = Mathf.Clamp(agentRunInAirSpeed - vel, 0, agentTerminalVel);
rb.AddForce(dir.normalized * adjustedSpeed,
runningForceMode);
}
public void AddIdleDrag(Rigidbody rb)
{
rb.velocity *= agentIdleDragVelCoeff;
}
public void AddFallingForce(Rigidbody rb)
{
rb.AddForce(
Vector3.down * agentFallingSpeed, ForceMode.Acceleration);
}
}
}

12
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentGrid.cs.meta


fileFormatVersion: 2
guid: 09855e12d9d10488fbe0950607e9bd5c
timeCreated: 1506829537
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

519
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentGrid.cs


//Put this script on your blue cube.
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Sensors;
using Random = UnityEngine.Random;
public class PushAgentGrid : Agent
{
/// <summary>
/// The ground. The bounds are used to spawn the elements.
/// </summary>
public GameObject ground;
public GameObject area;
/// <summary>
/// The area bounds.
/// </summary>
[HideInInspector]
public Bounds areaBounds;
PushBlockSettings m_PushBlockSettings;
/// <summary>
/// The goal to push the block to.
/// </summary>
public GameObject goal;
/// <summary>
/// The block to be pushed to the goal.
/// </summary>
public GameObject block;
/// <summary>
/// Detects when the block touches the goal.
/// </summary>
// [HideInInspector]
// public GoalDetect goalDetect;
public bool useVectorObs;
Rigidbody m_BlockRb; //cached on initialization
Rigidbody m_AgentRb; //cached on initialization
Material m_GroundMaterial; //cached on Awake()
/// <summary>
/// We will be changing the ground material based on success/failue
/// </summary>
Renderer m_GroundRenderer;
EnvironmentParameters m_ResetParams;
public bool useAutoFocus = false;
public List<RayPerceptionSensorComponent3D> raySensorsList = new List<RayPerceptionSensorComponent3D>();
public float focusAngle = 90;
public bool canLookAround;
public float lookAngle = 0;
public float maxLookAngle = 45f;
// public float rayHeight = 0;
void Awake()
{
m_PushBlockSettings = FindObjectOfType<PushBlockSettings>();
}
public override void Initialize()
{
// goalDetect = block.GetComponent<GoalDetect>();
// goalDetect.agent = this;
// Cache the agent rigidbody
m_AgentRb = GetComponent<Rigidbody>();
// Cache the block rigidbody
m_BlockRb = block.GetComponent<Rigidbody>();
// Get the ground's bounds
areaBounds = ground.GetComponent<Collider>().bounds;
// Get the ground renderer so we can change the material when a goal is scored
m_GroundRenderer = ground.GetComponent<Renderer>();
// Starting material
m_GroundMaterial = m_GroundRenderer.material;
m_ResetParams = Academy.Instance.EnvironmentParameters;
SetResetParameters();
}
public override void CollectObservations(VectorSensor sensor)
{
if (useVectorObs)
{
var localVelocity = transform.InverseTransformDirection(m_AgentRb.velocity);
sensor.AddObservation(localVelocity.x);
sensor.AddObservation(localVelocity.z);
// sensor.AddObservation(transform.localRotation);
// sensor.AddObservation(transform.localPosition);
if (useAutoFocus)
{
sensor.AddObservation(focusAngle / 180);
// sensor.AddObservation(rayHeight);
}
if (canLookAround)
{
sensor.AddObservation(lookAngle / maxLookAngle);
// sensor.AddObservation(rayHeight);
}
}
}
/// <summary>
/// Use the ground's bounds to pick a random spawn position.
/// </summary>
public Vector3 GetRandomSpawnPos()
{
var foundNewSpawnLocation = false;
var randomSpawnPos = Vector3.zero;
while (foundNewSpawnLocation == false)
{
var randomPosX = Random.Range(-areaBounds.extents.x * m_PushBlockSettings.spawnAreaMarginMultiplier,
areaBounds.extents.x * m_PushBlockSettings.spawnAreaMarginMultiplier);
var randomPosZ = Random.Range(-areaBounds.extents.z * m_PushBlockSettings.spawnAreaMarginMultiplier,
areaBounds.extents.z * m_PushBlockSettings.spawnAreaMarginMultiplier);
randomSpawnPos = ground.transform.position + new Vector3(randomPosX, 1f, randomPosZ);
// if (Physics.CheckBox(randomSpawnPos, new Vector3(2.5f, 0.01f, 2.5f)) == false)
if (Physics.CheckBox(randomSpawnPos, new Vector3(.75f, 0.01f, .75f)) == false)
{
foundNewSpawnLocation = true;
}
}
return randomSpawnPos;
}
/// <summary>
/// Called when the agent moves the block into the goal.
/// </summary>
public void ScoredAGoal()
{
// We use a reward of 5.
AddReward(5f);
// By marking an agent as done AgentReset() will be called automatically.
EndEpisode();
// Swap ground material for a bit to indicate we scored.
StartCoroutine(GoalScoredSwapGroundMaterial(m_PushBlockSettings.goalScoredMaterial, 0.5f));
}
/// <summary>
/// Swap ground material, wait time seconds, then swap back to the regular material.
/// </summary>
IEnumerator GoalScoredSwapGroundMaterial(Material mat, float time)
{
m_GroundRenderer.material = mat;
yield return new WaitForSeconds(time); // Wait for 2 sec
m_GroundRenderer.material = m_GroundMaterial;
}
// /// <summary>
// /// Moves the agent according to the selected action.
// /// </summary>
// public void MoveAgent(ActionBuffers actionBuffers)
// {
// var dirToGo = Vector3.zero;
// var rotateDir = Vector3.zero;
//
//// var forwardAction = act[0];
//// var lateralAction = act[1];
//// var rotatedAction = act[2];
// var act = actionBuffers.ContinuousActions;
// dirToGo += transform.forward * act[0];
// dirToGo += transform.right * act[1];
//
// rotateDir = transform.up * act[2];
//// switch (action)
//// {
//// case 1:
//// dirToGo = transform.forward * 1f;
//// break;
//// case 2:
//// dirToGo = transform.forward * -1f;
//// break;
//// case 3:
//// rotateDir = transform.up * 1f;
//// break;
//// case 4:
//// rotateDir = transform.up * -1f;
//// break;
//// case 5:
//// dirToGo = transform.right * -0.75f;
//// break;
//// case 6:
//// dirToGo = transform.right * 0.75f;
//// break;
//// }
// transform.Rotate(rotateDir.normalized, Time.fixedDeltaTime * 200f);
// m_AgentRb.AddForce(dirToGo.normalized * m_PushBlockSettings.agentRunSpeed,
// ForceMode.VelocityChange);
//
//
//// if (canLookAround)
//// {
//// var angle = act[1];
//// switch (angle)
//// {
//// case 0:
//// lookAngle = 0;
//// break;
//// case 1:
//// lookAngle = maxLookAngle/3;
//// break;
//// case 2:
//// lookAngle = maxLookAngle/2;
//// break;
//// case 3:
//// lookAngle = maxLookAngle/1;
//// break;
//// case 4:
//// lookAngle = -maxLookAngle/3;
//// break;
//// case 5:
//// lookAngle = -maxLookAngle/2;
//// break;
//// case 6:
//// lookAngle = -maxLookAngle/1;
//// break;
//// }
////
//// foreach (var item in raySensorsList)
//// {
//// item.transform.localRotation = Quaternion.Euler(0,lookAngle,0);
//// }
//// }
//
//
// if (useAutoFocus)
// {
// focusAngle = Mathf.Lerp(0, 180, (act[3] + 1f) * 0.5f);
//// var focus = act[1];
//// var focusAngleTarget = act[1];
//// switch (focus)
//// {
//// case 0:
//// focusAngle = 0;
//// break;
//// case 1:
//// focusAngle = 30;
//// break;
//// case 2:
//// focusAngle = 60;
//// break;
//// case 3:
//// focusAngle = 90;
//// break;
//// case 4:
//// focusAngle = 120;
//// break;
//// case 5:
//// focusAngle = 180;
//// break;
//// }
//// Mathf.MoveTowards()
//// var height = act[2];
//// switch (height)
//// {
//// case 0:
//// rayHeight = 0;
//// break;
//// case 1:
//// rayHeight = 1;
//// break;
//// }
//
// foreach (var item in raySensorsList)
// {
// item.MaxRayDegrees = focusAngle;
//// item.StartVerticalOffset = rayHeight;
//// item.EndVerticalOffset = rayHeight;
// }
// }
// }
/// <summary>
/// Moves the agent according to the selected action.
/// </summary>
public void MoveAgent(ActionSegment<int> act)
{
var dirToGo = Vector3.zero;
var rotateDir = Vector3.zero;
var action = act[0];
switch (action)
{
case 1:
dirToGo = transform.forward * 1f;
break;
case 2:
dirToGo = transform.forward * -1f;
break;
case 3:
rotateDir = transform.up * 1f;
break;
case 4:
rotateDir = transform.up * -1f;
break;
case 5:
dirToGo = transform.right * -0.75f;
break;
case 6:
dirToGo = transform.right * 0.75f;
break;
}
transform.Rotate(rotateDir, Time.fixedDeltaTime * 200f);
m_AgentRb.AddForce(dirToGo * m_PushBlockSettings.agentRunSpeed,
ForceMode.VelocityChange);
if (canLookAround)
{
var angle = act[1];
switch (angle)
{
case 0:
lookAngle = 0;
break;
case 1:
lookAngle = maxLookAngle / 3;
break;
case 2:
lookAngle = maxLookAngle / 2;
break;
case 3:
lookAngle = maxLookAngle / 1;
break;
case 4:
lookAngle = -maxLookAngle / 3;
break;
case 5:
lookAngle = -maxLookAngle / 2;
break;
case 6:
lookAngle = -maxLookAngle / 1;
break;
}
foreach (var item in raySensorsList)
{
item.transform.localRotation = Quaternion.Euler(0, lookAngle, 0);
}
}
if (useAutoFocus)
{
var focus = act[1];
switch (focus)
{
case 0:
focusAngle = 15;
break;
case 1:
focusAngle = 30;
break;
case 2:
focusAngle = 60;
break;
case 3:
focusAngle = 90;
break;
case 4:
focusAngle = 120;
break;
case 5:
focusAngle = 180;
break;
}
// var height = act[2];
// switch (height)
// {
// case 0:
// rayHeight = 0;
// break;
// case 1:
// rayHeight = 1;
// break;
// }
foreach (var item in raySensorsList)
{
item.MaxRayDegrees = focusAngle;
// item.StartVerticalOffset = rayHeight;
// item.EndVerticalOffset = rayHeight;
}
}
}
/// <summary>
/// Called every step of the engine. Here the agent takes an action.
/// </summary>
public override void OnActionReceived(ActionBuffers actionBuffers)
{
// Move the agent using the action.
// MoveAgent(actionBuffers);
MoveAgent(actionBuffers.DiscreteActions);
// Penalty given each step to encourage agent to finish task quickly.
AddReward(-1f / MaxStep);
}
// /// <summary>
// /// Called every step of the engine. Here the agent takes an action.
// /// </summary>
// public override void OnActionReceived(ActionBuffers actionBuffers)
//
// {
// // Move the agent using the action.
// MoveAgent(actionBuffers.DiscreteActions);
//
// // Penalty given each step to encourage agent to finish task quickly.
// AddReward(-1f / MaxStep);
// }
public override void Heuristic(in ActionBuffers actionsOut)
{
var discreteActionsOut = actionsOut.DiscreteActions;
discreteActionsOut[0] = 0;
if (Input.GetKey(KeyCode.D))
{
discreteActionsOut[0] = 3;
}
else if (Input.GetKey(KeyCode.W))
{
discreteActionsOut[0] = 1;
}
else if (Input.GetKey(KeyCode.A))
{
discreteActionsOut[0] = 4;
}
else if (Input.GetKey(KeyCode.S))
{
discreteActionsOut[0] = 2;
}
}
/// <summary>
/// Resets the block position and velocities.
/// </summary>
void ResetBlock()
{
// Get a random position for the block.
block.transform.position = GetRandomSpawnPos();
// Reset block velocity back to zero.
m_BlockRb.velocity = Vector3.zero;
// Reset block angularVelocity back to zero.
m_BlockRb.angularVelocity = Vector3.zero;
}
/// <summary>
/// In the editor, if "Reset On Done" is checked then AgentReset() will be
/// called automatically anytime we mark done = true in an agent script.
/// </summary>
public override void OnEpisodeBegin()
{
var rotation = Random.Range(0, 4);
var rotationAngle = rotation * 90f;
area.transform.Rotate(new Vector3(0f, rotationAngle, 0f));
ResetBlock();
transform.position = GetRandomSpawnPos();
m_AgentRb.velocity = Vector3.zero;
m_AgentRb.angularVelocity = Vector3.zero;
SetResetParameters();
}
public void SetGroundMaterialFriction()
{
var groundCollider = ground.GetComponent<Collider>();
groundCollider.material.dynamicFriction = m_ResetParams.GetWithDefault("dynamic_friction", 0);
groundCollider.material.staticFriction = m_ResetParams.GetWithDefault("static_friction", 0);
}
public void OnCollisionEnter(Collision col)
{
if (col.gameObject.CompareTag("hazard"))
{
SetReward(-1f);
EndEpisode();
}
}
public void SetBlockProperties()
{
var scale = m_ResetParams.GetWithDefault("block_scale", 1.5f);
//Set the scale of the block
m_BlockRb.transform.localScale = new Vector3(scale, 0.75f, scale);
// Set the drag of the block
m_BlockRb.drag = m_ResetParams.GetWithDefault("block_drag", 0.5f);
}
void SetResetParameters()
{
SetGroundMaterialFriction();
SetBlockProperties();
}
}

7
Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockHard.prefab.meta


fileFormatVersion: 2
guid: 9f61863318eba452baefa644fe4ddf1e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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

1001
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockCombo.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockCombo.nn.meta


fileFormatVersion: 2
guid: 1d535a1ec2873417b9f8034ebddb50cb
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGrid.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGrid.nn.meta


fileFormatVersion: 2
guid: 9926a54a928a0470e989cba7fcc847a5
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGridHard.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGridHard.nn.meta


fileFormatVersion: 2
guid: 288f1a7ef03a6453db17323f12efbfd1
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockHardRays.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockHardRays.nn.meta


fileFormatVersion: 2
guid: 36c24f85361da47b6bdbec6de11b5a0c
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlock2Grids.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlock2Grids.nn.meta


fileFormatVersion: 2
guid: 5dbee4270f2684794b2e5668458d736c
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockComboStaticGrid.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockComboStaticGrid.nn.meta


fileFormatVersion: 2
guid: 8c585109c51aa454c8fde8c77545f357
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGridOnlyLatest.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockGridOnlyLatest.nn.meta


fileFormatVersion: 2
guid: 6088b393238c74c7f827fd0ae1e3b454
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存