浏览代码

added builder env. observing blocks pos

/hh-develop-walljump_rnd
Hunter 5 年前
当前提交
90457de5
共有 61 个文件被更改,包括 6858 次插入20 次删除
  1. 8
      UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Materials/GridMatHazard.mat
  2. 2
      UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Materials/GridMatMoveable.mat
  3. 32
      UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/RayPerception3D.cs
  4. 10
      UnitySDK/Assets/ML-Agents/Examples/WallJump/Scenes/WallJump.unity
  5. 10
      UnitySDK/Assets/ML-Agents/Examples/WallJump/Scripts/WallJumpAgent.cs
  6. 5
      UnitySDK/ProjectSettings/EditorBuildSettings.asset
  7. 2
      UnitySDK/csharp_timers.json
  8. 38
      config/trainer_config.yaml
  9. 2
      csharp_timers.json
  10. 9
      UnitySDK/Assets/ML-Agents/Examples/Builder.meta
  11. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Brains.meta
  12. 26
      UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderGrabLearning.asset
  13. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderGrabLearning.asset.meta
  14. 42
      UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderGrabPlayer.asset
  15. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderGrabPlayer.asset.meta
  16. 25
      UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderLearning.asset
  17. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderLearning.asset.meta
  18. 41
      UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderPlayer.asset
  19. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderPlayer.asset.meta
  20. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials.meta
  21. 77
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/TransparentWall.mat
  22. 10
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/TransparentWall.mat.meta
  23. 80
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourt.mat
  24. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourt.mat.meta
  25. 80
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourtFail.mat
  26. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourtFail.mat.meta
  27. 80
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourtSuccess.mat
  28. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourtSuccess.mat.meta
  29. 83
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpSky.mat
  30. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpSky.mat.meta
  31. 77
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/spawnVolumeMaterial.mat
  32. 10
      UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/spawnVolumeMaterial.mat.meta
  33. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Meshes.meta
  34. 1001
      UnitySDK/Assets/ML-Agents/Examples/Builder/Meshes/GoalArea.fbx
  35. 96
      UnitySDK/Assets/ML-Agents/Examples/Builder/Meshes/GoalArea.fbx.meta
  36. 1001
      UnitySDK/Assets/ML-Agents/Examples/Builder/Meshes/ShortBlock.fbx
  37. 96
      UnitySDK/Assets/ML-Agents/Examples/Builder/Meshes/ShortBlock.fbx.meta
  38. 10
      UnitySDK/Assets/ML-Agents/Examples/Builder/Prefabs.meta
  39. 1001
      UnitySDK/Assets/ML-Agents/Examples/Builder/Prefabs/BuilderArea.prefab
  40. 8
      UnitySDK/Assets/ML-Agents/Examples/Builder/Prefabs/BuilderArea.prefab.meta
  41. 10
      UnitySDK/Assets/ML-Agents/Examples/Builder/Scenes.meta
  42. 1001
      UnitySDK/Assets/ML-Agents/Examples/Builder/Scenes/Builder.unity
  43. 9
      UnitySDK/Assets/ML-Agents/Examples/Builder/Scenes/Builder.unity.meta
  44. 10
      UnitySDK/Assets/ML-Agents/Examples/Builder/Scripts.meta
  45. 14
      UnitySDK/Assets/ML-Agents/Examples/Builder/Scripts/BuilderAcademy.cs
  46. 13
      UnitySDK/Assets/ML-Agents/Examples/Builder/Scripts/BuilderAcademy.cs.meta
  47. 384
      UnitySDK/Assets/ML-Agents/Examples/Builder/Scripts/BuilderAgent.cs
  48. 13
      UnitySDK/Assets/ML-Agents/Examples/Builder/Scripts/BuilderAgent.cs.meta
  49. 10
      UnitySDK/Assets/ML-Agents/Examples/Builder/TFModels.meta
  50. 349
      UnitySDK/Assets/ML-Agents/Examples/Builder/TFModels/BigWallJumpLearning.nn
  51. 7
      UnitySDK/Assets/ML-Agents/Examples/Builder/TFModels/BigWallJumpLearning.nn.meta
  52. 1001
      UnitySDK/Assets/ML-Agents/Examples/Builder/TFModels/SmallWallJumpLearning.nn
  53. 7
      UnitySDK/Assets/ML-Agents/Examples/Builder/TFModels/SmallWallJumpLearning.nn.meta

8
UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Materials/GridMatHazard.mat


m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: GridMatMoveable
m_Name: GridMatHazard
m_Shader: {fileID: 4800000, guid: bbecf177c38d84ff08d7c683c116affd, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4

- _GlossyReflections: 1
- _GridSize: 1
- _LineOffset: 0.5
- _LineSize: 0.05
- _LineSize: 0.1
- _LineWidth: 0.1
- _Metallic: 0
- _Mode: 0

- _ZWrite: 1
- _transparency: 1
m_Colors:
- _CellColor: {r: 0.9254902, g: 0.9372549, b: 0.9411765, a: 1}
- _CellColor: {r: 0.74509805, g: 0.22745098, b: 0.15294118, a: 1}
- _LineColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
- _LineColor: {r: 0.5882353, g: 0.17956656, b: 0.12074303, a: 1}
- _MainColor: {r: 1, g: 1, b: 1, a: 1}
- _SelectedColor: {r: 0.1586206, g: 1, b: 0, a: 1}

2
UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Materials/GridMatMoveable.mat


- _GlossyReflections: 1
- _GridSize: 1
- _LineOffset: 0.5
- _LineSize: 0.05
- _LineSize: 0.1
- _LineWidth: 0.1
- _Metallic: 0
- _Mode: 0

32
UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/RayPerception3D.cs


using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace MLAgents

/// </summary>
public class RayPerception3D : RayPerception
{
Vector3 m_EndPosition;
public Vector3 m_EndPosition;
public float gizmoSphereRadius = .5f;
public float sphereCastRadius = .5f;
public float gizmoSphereDrawDist = 2f;
public float[] rayAnglesForDebug;
/// <summary>

// along with object distance.
foreach (var angle in rayAngles)
{
m_EndPosition = transform.TransformDirection(
Vector3 startPos = transform.TransformPoint(new Vector3(0f, startOffset, 0f));
m_EndPosition = transform.TransformPoint(
m_EndPosition.y = endOffset;
m_EndPosition.y += endOffset;
Vector3 castDir = m_EndPosition - startPos;
Debug.DrawRay(transform.position + new Vector3(0f, startOffset, 0f),
Debug.DrawRay(startPos,
castDir, Color.cyan, 0.01f, true);
Debug.DrawRay(startPos,
Debug.DrawRay(m_EndPosition,
Vector3.up, Color.green, 0.01f, true);
if (Physics.SphereCast(transform.position +
new Vector3(0f, startOffset, 0f), 0.5f,
m_EndPosition, out m_Hit, rayDistance))
// if (Physics.SphereCast(startPos, sphereCastRadius,
// m_EndPosition, out m_Hit, rayDistance))
if (Physics.SphereCast(startPos, sphereCastRadius,
castDir, out m_Hit, rayDistance))
if (drawSphereGizmos)
{
Debug.DrawRay(m_Hit.point,
m_Hit.normal, Color.green, 0.01f, true);
}
for (var i = 0; i < detectableObjects.Length; i++)
{
if (m_Hit.collider.gameObject.CompareTag(detectableObjects[i]))

{
var pos = transform.TransformPoint(
PolarToCartesian(gizmoSphereDrawDist, angle));
Gizmos.DrawWireSphere(pos, gizmoSphereRadius);
Gizmos.DrawWireSphere(pos, sphereCastRadius);
}
}
}

10
UnitySDK/Assets/ML-Agents/Examples/WallJump/Scenes/WallJump.unity


propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 114092229367912210, guid: 54e3af627216447f790531de496099f0,
type: 2}
propertyPath: drawSphereGizmos
value: 0
objectReference: {fileID: 0}
- target: {fileID: 23418352498320674, guid: 54e3af627216447f790531de496099f0,
type: 2}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: eaad04b0e0dec42229c9cb00a981d7ac, type: 2}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 54e3af627216447f790531de496099f0, type: 2}
m_IsPrefabParent: 0

10
UnitySDK/Assets/ML-Agents/Examples/WallJump/Scripts/WallJumpAgent.cs


AgentCubeGroundCheck m_groundCheck;
AgentCubeMovement m_agentMovement;
public override void InitializeAgent()
{
m_groundCheck = GetComponent<AgentCubeGroundCheck>();

AddVectorObs(m_AgentRb.velocity/m_agentMovement.agentRunSpeed); //normalized vel
AddVectorObs(m_AgentRb.angularVelocity/m_AgentRb.maxAngularVelocity); //normalized angVel
AddVectorObs(m_AgentRb.transform.forward); //help with orientation
}
/// <summary>

rotateDir = -transform.up ;
else if (rotateDirAction == 2)
rotateDir = transform.up;
//handle jumping
if (jumpAction == 1)

if(m_AgentRb.position.y < -1 || m_ShortBlockRb.position.y < -1 || hazardRb.position.y < -1)
{
SetReward(-1f);
// ResetBlock(m_ShortBlockRb);
// ResetBlock(hazardRb);
void OnCollisionEnter(Collision col)
{

5
UnitySDK/ProjectSettings/EditorBuildSettings.asset


m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
- enabled: 0
- enabled: 1
path: Assets/ML-Agents/Examples/Builder/Scenes/Builder.unity
guid: 76883e42ee0224c40aa53ae7f2886a34

2
UnitySDK/csharp_timers.json


{"count":1,"self":336.08376319999996,"total":336.224354,"children":{"AgentResetIfDone":{"count":55,"self":0.0032559999999999998,"total":0.0032559999999999998,"children":null},"AgentSendState":{"count":55,"self":0.046099,"total":0.119173,"children":{"CollectObservations":{"count":456,"self":0.073074,"total":0.073074,"children":null}}},"BrainDecideAction":{"count":55,"self":0.003511,"total":0.003511,"children":null},"AcademyStep":{"count":55,"self":0.004344,"total":0.004344,"children":null},"AgentAct":{"count":55,"self":0.0085449999999999988,"total":0.0085449999999999988,"children":null}}}
{"count":1,"self":159.04896,"total":159.115523,"children":{"AgentResetIfDone":{"count":76,"self":0.007153,"total":0.007153,"children":null},"AgentSendState":{"count":76,"self":0.01151,"total":0.026241999999999998,"children":{"CollectObservations":{"count":26,"self":0.014731999999999999,"total":0.014731999999999999,"children":null}}},"BrainDecideAction":{"count":76,"self":0.0063419999999999995,"total":0.0063419999999999995,"children":null},"AcademyStep":{"count":76,"self":0.004124,"total":0.004124,"children":null},"AgentAct":{"count":76,"self":0.014031,"total":0.014031,"children":null}}}

38
config/trainer_config.yaml


gamma: 0.99
encoding_size: 256
BuilderGrabLearning:
normalize: true
num_epoch: 8
time_horizon: 1000
batch_size: 512
buffer_size: 4096
max_steps: 2.0e6
summary_freq: 3000
num_layers: 2
hidden_units: 128
reward_signals:
extrinsic:
strength: 1.0
gamma: 0.99
curiosity:
strength: 0.02
gamma: 0.99
encoding_size: 256
BuilderLearning:
normalize: true
num_epoch: 8
time_horizon: 1000
batch_size: 512
buffer_size: 4096
max_steps: 1.0e6
summary_freq: 3000
num_layers: 2
hidden_units: 128
reward_signals:
extrinsic:
strength: 1.0
gamma: 0.99
curiosity:
strength: 0.02
gamma: 0.99
encoding_size: 256
StrikerLearning:
max_steps: 5.0e5
learning_rate: 1e-3

2
csharp_timers.json


{"count":1,"self":375.14826239999996,"total":8686.488904,"children":{"AgentResetIfDone":{"count":414663,"self":4.5990952,"total":4.599095,"children":null},"AgentSendState":{"count":414663,"self":37.254604799999996,"total":161.11343,"children":{"CollectObservations":{"count":3317304,"self":123.8588288,"total":123.858824,"children":null}}},"BrainDecideAction":{"count":414663,"self":8115.9315455999995,"total":8115.931369,"children":null},"AcademyStep":{"count":414663,"self":2.635214,"total":2.635214,"children":null},"AgentAct":{"count":414663,"self":27.058908799999998,"total":27.058909999999997,"children":null}}}
{"count":1,"self":12.6202968,"total":13.332101999999999,"children":{"AgentResetIfDone":{"count":597,"self":0.008901,"total":0.008901,"children":null},"AgentSendState":{"count":597,"self":0.125016,"total":0.663338,"children":{"CollectObservations":{"count":12537,"self":0.538322,"total":0.538322,"children":null}}},"BrainDecideAction":{"count":597,"self":0.037295999999999996,"total":0.037295999999999996,"children":null}}}

9
UnitySDK/Assets/ML-Agents/Examples/Builder.meta


fileFormatVersion: 2
guid: 4c3057c8e836f46faa237a925692c28b
folderAsset: yes
timeCreated: 1520964896
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Brains.meta


fileFormatVersion: 2
guid: 8c540b48301a44dfbb5adbaa886d438c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

26
UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderGrabLearning.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b23992c8eb17439887f5e944bf04a40, type: 3}
m_Name: BuilderGrabLearning
m_EditorClassIdentifier:
brainParameters:
vectorObservationSize: 116
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000200000002000000
cameraResolutions: []
vectorActionDescriptions:
-
-
-
-
vectorActionSpaceType: 0
model: {fileID: 0}
inferenceDevice: 0

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderGrabLearning.asset.meta


fileFormatVersion: 2
guid: 09b301c4d57ee4c9a8b3ab5df67a731d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

42
UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderGrabPlayer.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e9bda8f3cf1492fa74926a530f6f70, type: 3}
m_Name: BuilderGrabPlayer
m_EditorClassIdentifier:
brainParameters:
vectorObservationSize: 116
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000200000002000000
cameraResolutions: []
vectorActionDescriptions:
-
-
-
-
vectorActionSpaceType: 0
keyContinuousPlayerActions: []
axisContinuousPlayerActions: []
discretePlayerActions:
- key: 119
branchIndex: 0
value: 1
- key: 115
branchIndex: 0
value: 2
- key: 100
branchIndex: 1
value: 2
- key: 97
branchIndex: 1
value: 1
- key: 32
branchIndex: 2
value: 1

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderGrabPlayer.asset.meta


fileFormatVersion: 2
guid: 2dba5fcc186c841a9bfeaab90014d19b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

25
UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderLearning.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b23992c8eb17439887f5e944bf04a40, type: 3}
m_Name: BuilderLearning
m_EditorClassIdentifier:
brainParameters:
vectorObservationSize: 55
numStackedVectorObservations: 1
vectorActionSize: 030000000300000002000000
cameraResolutions: []
vectorActionDescriptions:
-
-
-
vectorActionSpaceType: 0
model: {fileID: 0}
inferenceDevice: 0

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderLearning.asset.meta


fileFormatVersion: 2
guid: 72576241dcdae4d49886287779d4d05a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

41
UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderPlayer.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e9bda8f3cf1492fa74926a530f6f70, type: 3}
m_Name: BuilderPlayer
m_EditorClassIdentifier:
brainParameters:
vectorObservationSize: 55
numStackedVectorObservations: 1
vectorActionSize: 030000000300000002000000
cameraResolutions: []
vectorActionDescriptions:
-
-
-
vectorActionSpaceType: 0
keyContinuousPlayerActions: []
axisContinuousPlayerActions: []
discretePlayerActions:
- key: 119
branchIndex: 0
value: 1
- key: 115
branchIndex: 0
value: 2
- key: 100
branchIndex: 1
value: 2
- key: 97
branchIndex: 1
value: 1
- key: 32
branchIndex: 2
value: 1

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Brains/BuilderPlayer.asset.meta


fileFormatVersion: 2
guid: 62ef42924f6c94874ae412fc1b98cd8c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials.meta


fileFormatVersion: 2
guid: 1cb769070b9a7437089f26292d7c214a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

77
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/TransparentWall.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TransparentWall
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHABLEND_ON
m_LightmapFlags: 4
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: 1
- _Metallic: 0
- _Mode: 2
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 5
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 0.56228375, g: 0.76044035, b: 0.9558824, a: 0.603}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

10
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/TransparentWall.mat.meta


fileFormatVersion: 2
guid: 6b1d1f428bd4343b2b7dad1546c21774
timeCreated: 1506376733
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

80
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourt.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: WallJumpCourt
m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
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: 2800000, guid: df56124da2726af4d8dcb3bd5896d323, type: 3}
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}
- _SpecGlossMap:
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.75
- _GlossyReflections: 1
- _Metallic: 0.2
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourt.mat.meta


fileFormatVersion: 2
guid: d262f221a71d64353ad17e8be3974041
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

80
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourtFail.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: WallJumpCourtFail
m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
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: 2800000, guid: c862c84b87cc1314fac7392d5df40a0a, type: 3}
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}
- _SpecGlossMap:
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.75
- _GlossyReflections: 1
- _Metallic: 0.2
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourtFail.mat.meta


fileFormatVersion: 2
guid: 4787c2670d1934df795144e49bbead07
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

80
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourtSuccess.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: WallJumpCourtSuccess
m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
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: 2800000, guid: 6555bb88673eebc4a87d2111c3157de4, type: 3}
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}
- _SpecGlossMap:
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.75
- _GlossyReflections: 1
- _Metallic: 0.2
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpCourtSuccess.mat.meta


fileFormatVersion: 2
guid: cf46b1d019f084e90b4baa46bb3e0377
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

83
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpSky.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: WallJumpSky
m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _SUNDISK_HIGH_QUALITY
m_LightmapFlags: 4
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:
- _AtmosphereThickness: 1
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Exposure: 1.3
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SunDisk: 2
- _SunSize: 0.04
- _SunSizeConvergence: 5
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _GroundColor: {r: 0.369, g: 0.349, b: 0.341, a: 1}
- _SkyTint: {r: 0.5, g: 0.5, b: 0.5, a: 1}

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/WallJumpSky.mat.meta


fileFormatVersion: 2
guid: dbdbf4ef580b2404887a5d5e7ec217fd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

77
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/spawnVolumeMaterial.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: spawnVolumeMaterial
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHABLEND_ON
m_LightmapFlags: 4
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: 1
- _Metallic: 0
- _Mode: 2
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 5
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 0, g: 0.83448315, b: 1, a: 0.303}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

10
UnitySDK/Assets/ML-Agents/Examples/Builder/Materials/spawnVolumeMaterial.mat.meta


fileFormatVersion: 2
guid: f0d1d9390709a4c07b4f45dfbcd93c11
timeCreated: 1506376733
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Meshes.meta


fileFormatVersion: 2
guid: 3743a6d257b5d4f11b1bdfa5e9977ecd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
UnitySDK/Assets/ML-Agents/Examples/Builder/Meshes/GoalArea.fbx
文件差异内容过多而无法显示
查看文件

96
UnitySDK/Assets/ML-Agents/Examples/Builder/Meshes/GoalArea.fbx.meta


fileFormatVersion: 2
guid: 613f11617ab6b47098a6a89387b36346
ModelImporter:
serializedVersion: 22
fileIDToRecycleName:
100000: //RootNode
400000: //RootNode
2100000: rep_Checkers
2300000: //RootNode
3300000: //RootNode
4300000: GoalArea
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: rep_Checkers
second: {fileID: 2100000, guid: 36c7baa347d68f347a9aa9698aa1bcdd, type: 2}
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 1
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
importAnimation: 1
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

1001
UnitySDK/Assets/ML-Agents/Examples/Builder/Meshes/ShortBlock.fbx
文件差异内容过多而无法显示
查看文件

96
UnitySDK/Assets/ML-Agents/Examples/Builder/Meshes/ShortBlock.fbx.meta


fileFormatVersion: 2
guid: 5035188ac5c8c4fc68008e34ca58f35a
ModelImporter:
serializedVersion: 22
fileIDToRecycleName:
100000: //RootNode
400000: //RootNode
2100000: rep_GraySG
2300000: //RootNode
3300000: //RootNode
4300000: ShortBlock
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: rep_GraySG
second: {fileID: 2100000, guid: 5eba48b0898adc441946e5c501f88fdd, type: 2}
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 1
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
importAnimation: 1
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

10
UnitySDK/Assets/ML-Agents/Examples/Builder/Prefabs.meta


fileFormatVersion: 2
guid: 6d5ccb4fda6b1421cb3337e91c444605
folderAsset: yes
timeCreated: 1517535133
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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

8
UnitySDK/Assets/ML-Agents/Examples/Builder/Prefabs/BuilderArea.prefab.meta


fileFormatVersion: 2
guid: 68da4ca0f66774fb9bdb9a9817d6be88
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

10
UnitySDK/Assets/ML-Agents/Examples/Builder/Scenes.meta


fileFormatVersion: 2
guid: fe61cc9c46581441396b7442c7036543
folderAsset: yes
timeCreated: 1517446674
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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

9
UnitySDK/Assets/ML-Agents/Examples/Builder/Scenes/Builder.unity.meta


fileFormatVersion: 2
guid: 76883e42ee0224c40aa53ae7f2886a34
timeCreated: 1506808980
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

10
UnitySDK/Assets/ML-Agents/Examples/Builder/Scripts.meta


fileFormatVersion: 2
guid: 0690f77a5e8e14d87b4b714517ad55d1
folderAsset: yes
timeCreated: 1517445791
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

14
UnitySDK/Assets/ML-Agents/Examples/Builder/Scripts/BuilderAcademy.cs


using UnityEngine;
using MLAgents;
public class BuilderAcademy : Academy
{
[Header("Specific to WallJump")]
//when a goal is scored the ground will use this material for a few seconds.
public Material goalScoredMaterial;
//when fail, the ground will use this material for a few seconds.
public Material failMaterial;
public Material grabbedMaterial;
public Material notGrabbedMaterial;
public float heightRewardCoeff = .01f;
}

13
UnitySDK/Assets/ML-Agents/Examples/Builder/Scripts/BuilderAcademy.cs.meta


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

384
UnitySDK/Assets/ML-Agents/Examples/Builder/Scripts/BuilderAgent.cs


//Put this script on your blue cube.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MLAgents;
using Random = UnityEngine.Random;
[RequireComponent(typeof(AgentCubeGroundCheck))] // Required for groundcheck
public class BuilderAgent : Agent
{
// Depending on this value, the wall will have different height
int m_Configuration;
public GameObject ground;
public GameObject spawnArea;
Bounds m_SpawnAreaBounds;
Material m_GroundMaterial;
Renderer m_GroundRenderer;
BuilderAcademy m_Academy;
RayPerception m_RayPer;
string[] m_DetectableObjects;
Rigidbody m_AgentRb;
public List<Rigidbody> buildingBlocksList = new List<Rigidbody>();
//Groundcheck
AgentCubeGroundCheck m_groundCheck;
AgentCubeMovement m_agentMovement;
public bool grabbingItem;
public Rigidbody grabbedItemRb;
public Collider grabbedItemCol;
private Transform m_AreaTransform;
public override void InitializeAgent()
{
m_AreaTransform = transform.parent;
m_groundCheck = GetComponent<AgentCubeGroundCheck>();
m_Academy = FindObjectOfType<BuilderAcademy>();
m_agentMovement = FindObjectOfType<AgentCubeMovement>();
m_RayPer = GetComponent<RayPerception>();
m_Configuration = Random.Range(0, 5);
m_DetectableObjects = new[] { "block" };
m_SpawnAreaBounds = spawnArea.GetComponent<Collider>().bounds;
m_GroundRenderer = ground.GetComponent<Renderer>();
m_AgentRb = GetComponent<Rigidbody>();
m_GroundMaterial = m_GroundRenderer.material;
spawnArea.SetActive(false);
}
public override void CollectObservations()
{
var rayDistance = 20f;
float[] rayAngles = { 0f, 45f, 90f, 135f, 180f, 110f, 70f };
AddVectorObs(m_RayPer.Perceive(
rayDistance, rayAngles, m_DetectableObjects, 0f, 0f));
AddVectorObs(m_RayPer.Perceive(
rayDistance, rayAngles, m_DetectableObjects, 1.5f, 0f));
// AddVectorObs(m_RayPer.Perceive(
// rayDistance, rayAngles, m_DetectableObjects, 2.5f, 2.5f));
var agentPos = m_AgentRb.position - ground.transform.position;
AddVectorObs(agentPos / 20f); //help with orientation
AddVectorObs(m_groundCheck.isGrounded);
AddVectorObs(m_AgentRb.velocity/m_agentMovement.agentRunSpeed); //normalized vel
AddVectorObs(m_AgentRb.angularVelocity/m_AgentRb.maxAngularVelocity); //normalized angVel
AddVectorObs(m_AgentRb.transform.forward); //help with orientation
AddVectorObs(grabbingItem);
foreach (var item in buildingBlocksList)
{
var blockPos = item.position - ground.transform.position;
AddVectorObs(blockPos / 20f); //help with orientation
}
}
/// <summary>
/// Gets a random spawn position in the spawningArea.
/// </summary>
/// <returns>The random spawn position.</returns>
public Vector3 GetRandomSpawnPos()
{
var randomPosX = Random.Range(-m_SpawnAreaBounds.extents.x,
m_SpawnAreaBounds.extents.x);
var randomPosY = Random.Range(-m_SpawnAreaBounds.extents.y,
m_SpawnAreaBounds.extents.y);
var randomPosZ = Random.Range(-m_SpawnAreaBounds.extents.z,
m_SpawnAreaBounds.extents.z);
var randomSpawnPos = spawnArea.transform.position +
new Vector3(randomPosX, randomPosY, randomPosZ);
return randomSpawnPos;
}
/// <summary>
/// Changes the color of the ground for a moment
/// </summary>
/// <returns>The Enumerator to be used in a Coroutine</returns>
/// <param name="mat">The material to be swaped.</param>
/// <param name="time">The time the material will remain.</param>
IEnumerator GoalScoredSwapGroundMaterial(Material mat, float time)
{
m_GroundRenderer.material = mat;
yield return new WaitForSeconds(time);
m_GroundRenderer.material = m_GroundMaterial;
}
public void MoveAgent(float[] act)
{
AddReward(-0.0005f); //hurry up
var dirToGo = Vector3.zero;
var rotateDir = Vector3.zero;
var dirToGoForwardAction = (int)act[0];
var rotateDirAction = (int)act[1];
var jumpAction = (int)act[2];
if (dirToGoForwardAction == 1)
dirToGo += transform.forward;
else if (dirToGoForwardAction == 2)
dirToGo += -transform.forward;
if (rotateDirAction == 1)
rotateDir = -transform.up ;
else if (rotateDirAction == 2)
rotateDir = transform.up;
var grabOrReleaseAction = (int)act[3];
if (grabOrReleaseAction == 1)
{
if(grabbingItem)
{
ReleaseBlock();
}
else
{
GrabBlock();
}
}
//handle jumping
if (jumpAction == 1)
{
if (m_groundCheck.isGrounded)
{
m_agentMovement.Jump(m_AgentRb);
}
}
//handle body rotation
if (rotateDir != Vector3.zero)
{
m_agentMovement.RotateBody(m_AgentRb, rotateDir);
}
//handle running
if (dirToGo != Vector3.zero)
{
if (!m_groundCheck.isGrounded)
{
m_agentMovement.RunInAir(m_AgentRb, dirToGo.normalized);
}
else
{
m_agentMovement.RunOnGround(m_AgentRb, dirToGo.normalized);
}
}
//handle idle drag
if (m_groundCheck.isGrounded && dirToGo == Vector3.zero)
{
m_agentMovement.AddIdleDrag(m_AgentRb);
}
//handle falling forces
if (!m_groundCheck.isGrounded)
{
m_agentMovement.AddFallingForce(m_AgentRb);
}
}
bool AllBlockOnPlatform()
{
foreach (var item in buildingBlocksList)
{
if (item.position.y < ground.transform.position.y -1)
{
return false;
}
}
return true;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.G))
{
if(grabbingItem)
{
ReleaseBlock();
}
else
{
GrabBlock();
}
}
}
public override void AgentAction(float[] vectorAction, string textAction)
{
if (IsDone())
{
return;
}
MoveAgent(vectorAction);
if (m_AgentRb.position.y < ground.transform.position.y -1|| !AllBlockOnPlatform())
{
SetReward(-1f);
StartCoroutine(
GoalScoredSwapGroundMaterial(m_Academy.failMaterial, .5f));
Done();
}
if (m_groundCheck.isGrounded)
{
AddReward((m_AgentRb.transform.localPosition.y - 1) * m_Academy.heightRewardCoeff);
}
}
void ResetAllBlocks()
{
foreach (var item in buildingBlocksList)
{
ResetBlock(item);
}
}
void GrabBlock()
{
RaycastHit hit;
if (Physics.Raycast(m_AgentRb.position, transform.forward, out hit, 1f))
{
if (hit.collider.gameObject.CompareTag("block"))
{
hit.rigidbody.isKinematic = true;
hit.transform.SetParent(transform);
grabbedItemRb = hit.transform.GetComponent<Rigidbody>();
grabbedItemCol = hit.collider;
hit.collider.enabled = false;
grabbingItem = true;
hit.transform.GetComponent<Renderer>().material = m_Academy.grabbedMaterial;
print("GRABBED");
}
}
}
void ReleaseBlock()
{
if (grabbedItemRb)
{
ResetBlock(grabbedItemRb);
}
print("RELEASED");
grabbedItemRb = null;
grabbedItemCol = null;
grabbingItem = false;
}
// void OnCollisionEnter(Collision col)
// {
// if (col.gameObject.CompareTag("hazard"))
// {
// SetReward(-1f);
// StartCoroutine(
// GoalScoredSwapGroundMaterial(m_Academy.failMaterial, .5f));
// Done();
// }
// }
// // Detect when the agent hits the goal
// void OnTriggerStay(Collider col)
// {
// if (IsDone())
// {
// return;
// }
// if (col.gameObject.CompareTag("goal") && m_groundCheck.isGrounded)
// {
// SetReward(1f);
//// ResetBlock(m_ShortBlockRb);
//// ResetBlock(hazardRb);
// StartCoroutine(
// GoalScoredSwapGroundMaterial(m_Academy.goalScoredMaterial, .5f));
// Done();
// }
// }
//Reset the orange block position
void ResetBlock(Rigidbody blockRb)
{
blockRb.transform.SetParent(m_AreaTransform);
blockRb.velocity = Vector3.zero;
blockRb.angularVelocity = Vector3.zero;
blockRb.isKinematic = false;
blockRb.transform.GetComponent<Renderer>().material = m_Academy.notGrabbedMaterial;
blockRb.GetComponent<Collider>().enabled = true;
}
public override void AgentReset()
{
ResetAllBlocks();
foreach (var item in buildingBlocksList)
{
item.transform.position = GetRandomSpawnPos();
}
transform.localPosition = new Vector3(
18 * (Random.value - 0.5f), 1, 0);
m_Configuration = Random.Range(0, 5);
m_AgentRb.velocity = Vector3.zero;
}
// private void FixedUpdate()
// {
// if (m_Configuration != -1)
// {
// ConfigureAgent(m_Configuration);
// m_Configuration = -1;
// }
// }
// /// <summary>
// /// Configures the agent. Given an integer config, the wall will have
// /// different height and a different brain will be assigned to the agent.
// /// </summary>
// /// <param name="config">Config.
// /// If 0 : No wall and noWallBrain.
// /// If 1: Small wall and smallWallBrain.
// /// Other : Tall wall and BigWallBrain. </param>
// void ConfigureAgent(int config)
// {
// var localScale = wall.transform.localScale;
// if (config == 0)
// {
// localScale = new Vector3(
// localScale.x,
// m_Academy.resetParameters["no_wall_height"],
// localScale.z);
// wall.transform.localScale = localScale;
// GiveBrain(noWallBrain);
// }
// else if (config == 1)
// {
// localScale = new Vector3(
// localScale.x,
// m_Academy.resetParameters["small_wall_height"],
// localScale.z);
// wall.transform.localScale = localScale;
// GiveBrain(smallWallBrain);
// }
// else
// {
// var height =
// m_Academy.resetParameters["big_wall_min_height"] +
// Random.value * (m_Academy.resetParameters["big_wall_max_height"] -
// m_Academy.resetParameters["big_wall_min_height"]);
// localScale = new Vector3(
// localScale.x,
// height,
// localScale.z);
// wall.transform.localScale = localScale;
// GiveBrain(bigWallBrain);
// }
// }
}

13
UnitySDK/Assets/ML-Agents/Examples/Builder/Scripts/BuilderAgent.cs.meta


fileFormatVersion: 2
guid: 86ea711499d0b46ee9b10c31f7d37aac
timeCreated: 1517445814
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

10
UnitySDK/Assets/ML-Agents/Examples/Builder/TFModels.meta


fileFormatVersion: 2
guid: 02bbb60ad9ea542c9bd18e0648190313
folderAsset: yes
timeCreated: 1517539094