浏览代码
Merge pull request #4741 from Unity-Technologies/walljump-pushblock
Merge pull request #4741 from Unity-Technologies/walljump-pushblock
Add WalljumpPushblock env/goal-conditioning/new
GitHub
4 年前
当前提交
8cf3b93b
共有 51 个文件被更改,包括 10359 次插入 和 0 次删除
-
9Project/Assets/ML-Agents/Examples/WallJumpAndPushblock.meta
-
69config/ppo/WJPB.yaml
-
8Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials.meta
-
78Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/TransparentWall.mat
-
10Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/TransparentWall.mat.meta
-
80Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/WallJumpCourt.mat
-
8Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/WallJumpCourt.mat.meta
-
80Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/WallJumpCourtFail.mat
-
8Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/WallJumpCourtFail.mat.meta
-
80Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/WallJumpCourtSuccess.mat
-
8Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/WallJumpCourtSuccess.mat.meta
-
83Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/WallJumpSky.mat
-
8Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/WallJumpSky.mat.meta
-
77Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/spawnVolumeMaterial.mat
-
10Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials/spawnVolumeMaterial.mat.meta
-
8Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Meshes.meta
-
1001Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Meshes/GoalArea.fbx
-
96Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Meshes/GoalArea.fbx.meta
-
1001Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Meshes/ShortBlock.fbx
-
96Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Meshes/ShortBlock.fbx.meta
-
10Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Prefabs.meta
-
1001Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Prefabs/WallJumpandPushblockArea.prefab
-
9Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Prefabs/WallJumpandPushblockArea.prefab.meta
-
10Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scenes.meta
-
1001Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scenes/WallJumpAndPushblock.unity
-
9Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scenes/WallJumpAndPushblock.unity.meta
-
10Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scripts.meta
-
342Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scripts/WJPBAgent.cs
-
11Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scripts/WJPBAgent.cs.meta
-
26Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scripts/WJPBGoalDetect.cs
-
11Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scripts/WJPBGoalDetect.cs.meta
-
14Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scripts/WJPBSettings.cs
-
11Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scripts/WJPBSettings.cs.meta
-
10Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels.meta
-
1001Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/BigWallJump.nn
-
11Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/BigWallJump.nn.meta
-
1001Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/SmallWallJump.nn
-
11Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/SmallWallJump.nn.meta
-
1001Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/WJPB-32499994.onnx
-
13Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/WJPB-32499994.onnx.meta
-
1001Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/WJPB-4999918.onnx
-
13Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/WJPB-4999918.onnx.meta
-
1001Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/cloud.onnx
-
13Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/cloud.onnx.meta
|
|||
fileFormatVersion: 2 |
|||
guid: fb445c13fe9f243e1ab588fce6354929 |
|||
folderAsset: yes |
|||
timeCreated: 1520964896 |
|||
licenseType: Free |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
behaviors: |
|||
WJPB: |
|||
trainer_type: ppo |
|||
hyperparameters: |
|||
batch_size: 128 |
|||
buffer_size: 2048 |
|||
learning_rate: 0.0003 |
|||
beta: 0.005 |
|||
epsilon: 0.2 |
|||
lambd: 0.95 |
|||
num_epoch: 3 |
|||
learning_rate_schedule: linear |
|||
network_settings: |
|||
normalize: false |
|||
hidden_units: 512 |
|||
num_layers: 2 |
|||
vis_encode_type: simple |
|||
reward_signals: |
|||
extrinsic: |
|||
gamma: 0.99 |
|||
strength: 1.0 |
|||
keep_checkpoints: 5 |
|||
max_steps: 50000000 |
|||
time_horizon: 128 |
|||
summary_freq: 20000 |
|||
threaded: true |
|||
environment_parameters: |
|||
big_wall_height: |
|||
curriculum: |
|||
- name: Lesson0 # The '-' is important as this is a list |
|||
completion_criteria: |
|||
measure: progress |
|||
behavior: WJPB |
|||
signal_smoothing: true |
|||
min_lesson_length: 100 |
|||
threshold: 0.05 |
|||
value: |
|||
sampler_type: uniform |
|||
sampler_parameters: |
|||
min_value: 0.0 |
|||
max_value: 4.0 |
|||
- name: Lesson1 # This is the start of the second lesson |
|||
completion_criteria: |
|||
measure: progress |
|||
behavior: WJPB |
|||
signal_smoothing: true |
|||
min_lesson_length: 100 |
|||
threshold: 0.1 |
|||
value: |
|||
sampler_type: uniform |
|||
sampler_parameters: |
|||
min_value: 4.0 |
|||
max_value: 7.0 |
|||
- name: Lesson2 |
|||
completion_criteria: |
|||
measure: progress |
|||
behavior: WJPB |
|||
signal_smoothing: true |
|||
min_lesson_length: 100 |
|||
threshold: 0.5 |
|||
value: |
|||
sampler_type: uniform |
|||
sampler_parameters: |
|||
min_value: 6.0 |
|||
max_value: 8.0 |
|||
- name: Lesson3 |
|||
value: 8.0 |
|||
env_settings: |
|||
num_envs: 4 |
|
|||
fileFormatVersion: 2 |
|||
guid: 84bf11f49563948329c8cbd9708fa71d |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: 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} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3c02e1437a353423faeefff3afed88c3 |
|||
timeCreated: 1506376733 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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} |
|
|||
fileFormatVersion: 2 |
|||
guid: 8eabd529a9b20480b95ed5371c96db8f |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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} |
|
|||
fileFormatVersion: 2 |
|||
guid: a53fc6233e6a343189b057014f1a948c |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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} |
|
|||
fileFormatVersion: 2 |
|||
guid: a5510de83e44f4596872fec8e7b34a12 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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} |
|
|||
fileFormatVersion: 2 |
|||
guid: a1d954e72bb784ca398bdfc716f6bb55 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4051274fbcad74bc3be5e838c7476092 |
|||
timeCreated: 1506376733 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 6a51b18ad7d024e19bc3d9e50b808855 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Meshes/GoalArea.fbx
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 690335095cd2c4560833e126d49130fe |
|||
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
Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Meshes/ShortBlock.fbx
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 81640008a0d42439f881cd59c3145571 |
|||
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: |
|
|||
fileFormatVersion: 2 |
|||
guid: 6b3d228f6035943038305ffb95ef9fb4 |
|||
folderAsset: yes |
|||
timeCreated: 1517535133 |
|||
licenseType: Free |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Prefabs/WallJumpandPushblockArea.prefab
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: c35df6d2c99224b0faeaaaff199cbd4e |
|||
timeCreated: 1520541093 |
|||
licenseType: Free |
|||
NativeFormatImporter: |
|||
mainObjectFileID: 100100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 98bc2664251504d59abfb38f03e52dfc |
|||
folderAsset: yes |
|||
timeCreated: 1517446674 |
|||
licenseType: Free |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scenes/WallJumpAndPushblock.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: a67c8be1763a2414fa40cc64bc56036f |
|||
timeCreated: 1506808980 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: d8548877ac8cf47f7b24d6d9bca20d21 |
|||
folderAsset: yes |
|||
timeCreated: 1517445791 |
|||
licenseType: Free |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
//Put this script on your blue cube.
|
|||
|
|||
using System.Collections; |
|||
using UnityEngine; |
|||
using Unity.MLAgents; |
|||
using Unity.Barracuda; |
|||
using Unity.MLAgents.Actuators; |
|||
using Unity.MLAgents.Sensors; |
|||
using Unity.MLAgentsExamples; |
|||
|
|||
public class WJPBAgent : Agent |
|||
{ |
|||
// Depending on this value, the agent will have different goals
|
|||
int m_Goal; |
|||
|
|||
public GameObject ground; |
|||
public GameObject spawnArea; |
|||
Bounds m_SpawnAreaBounds; |
|||
|
|||
|
|||
public GameObject wallJumpGoal; |
|||
public GameObject pushBlockGoal; |
|||
public GameObject shortBlock; |
|||
public GameObject wall; |
|||
public int goals; |
|||
Rigidbody m_ShortBlockRb; |
|||
Rigidbody m_AgentRb; |
|||
public Material goalMaterial; |
|||
public Material nonGoalMaterial; |
|||
Renderer m_PushRenderer; |
|||
Renderer m_WallRenderer; |
|||
WJPBSettings m_WJPBSettings; |
|||
|
|||
public float jumpingTime; |
|||
public float jumpTime; |
|||
// This is a downward force applied when falling to make jumps look
|
|||
// less floaty
|
|||
public float fallingForce; |
|||
// Use to check the coliding objects
|
|||
public Collider[] hitGroundColliders = new Collider[3]; |
|||
Vector3 m_JumpTargetPos; |
|||
Vector3 m_JumpStartingPos; |
|||
|
|||
[HideInInspector] |
|||
public WJPBGoalDetect goalDetect; |
|||
float[] m_GoalOneHot; |
|||
|
|||
|
|||
EnvironmentParameters m_ResetParams; |
|||
|
|||
public override void Initialize() |
|||
{ |
|||
m_WJPBSettings = FindObjectOfType<WJPBSettings>(); |
|||
// One-hot encoding of the goal
|
|||
m_WallRenderer = wallJumpGoal.GetComponent<Renderer>(); |
|||
m_PushRenderer = pushBlockGoal.GetComponent<Renderer>(); |
|||
|
|||
m_Goal = Random.Range(0, goals); |
|||
//m_Goal = 0;
|
|||
m_GoalOneHot = new float[goals]; |
|||
if (m_Goal == 0) |
|||
{ |
|||
m_WallRenderer.material = goalMaterial; |
|||
m_PushRenderer.material = nonGoalMaterial; |
|||
} |
|||
else |
|||
{ |
|||
m_WallRenderer.material = nonGoalMaterial; |
|||
m_PushRenderer.material = goalMaterial; |
|||
} |
|||
|
|||
System.Array.Clear(m_GoalOneHot, 0, m_GoalOneHot.Length); |
|||
m_GoalOneHot[m_Goal] = 1; |
|||
|
|||
goalDetect = shortBlock.GetComponent<WJPBGoalDetect>(); |
|||
goalDetect.agent = this; |
|||
|
|||
|
|||
m_AgentRb = GetComponent<Rigidbody>(); |
|||
m_ShortBlockRb = shortBlock.GetComponent<Rigidbody>(); |
|||
m_SpawnAreaBounds = spawnArea.GetComponent<Collider>().bounds; |
|||
|
|||
spawnArea.SetActive(false); |
|||
|
|||
m_ResetParams = Academy.Instance.EnvironmentParameters; |
|||
|
|||
} |
|||
|
|||
// Begin the jump sequence
|
|||
public void Jump() |
|||
{ |
|||
jumpingTime = 0.2f; |
|||
m_JumpStartingPos = m_AgentRb.position; |
|||
} |
|||
|
|||
/// <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 bool DoGroundCheck(bool smallCheck) |
|||
{ |
|||
if (!smallCheck) |
|||
{ |
|||
hitGroundColliders = new Collider[3]; |
|||
var o = gameObject; |
|||
Physics.OverlapBoxNonAlloc( |
|||
o.transform.position + new Vector3(0, -0.05f, 0), |
|||
new Vector3(0.95f / 2f, 0.5f, 0.95f / 2f), |
|||
hitGroundColliders, |
|||
o.transform.rotation); |
|||
var grounded = false; |
|||
foreach (var col in hitGroundColliders) |
|||
{ |
|||
if (col != null && col.transform != transform && |
|||
(col.CompareTag("walkableSurface") || |
|||
col.CompareTag("block") || |
|||
col.CompareTag("wall"))) |
|||
{ |
|||
grounded = true; //then we're grounded
|
|||
break; |
|||
} |
|||
} |
|||
return grounded; |
|||
} |
|||
else |
|||
{ |
|||
RaycastHit hit; |
|||
Physics.Raycast(transform.position + new Vector3(0, -0.05f, 0), -Vector3.up, out hit, |
|||
1f); |
|||
|
|||
if (hit.collider != null && |
|||
(hit.collider.CompareTag("walkableSurface") || |
|||
hit.collider.CompareTag("block") || |
|||
hit.collider.CompareTag("wall")) |
|||
&& hit.normal.y > 0.95f) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Moves a rigidbody towards a position smoothly.
|
|||
/// </summary>
|
|||
/// <param name="targetPos">Target position.</param>
|
|||
/// <param name="rb">The rigidbody to be moved.</param>
|
|||
/// <param name="targetVel">The velocity to target during the
|
|||
/// motion.</param>
|
|||
/// <param name="maxVel">The maximum velocity posible.</param>
|
|||
void MoveTowards( |
|||
Vector3 targetPos, Rigidbody rb, float targetVel, float maxVel) |
|||
{ |
|||
var moveToPos = targetPos - rb.worldCenterOfMass; |
|||
var velocityTarget = Time.fixedDeltaTime * targetVel * moveToPos; |
|||
if (float.IsNaN(velocityTarget.x) == false) |
|||
{ |
|||
rb.velocity = Vector3.MoveTowards( |
|||
rb.velocity, velocityTarget, maxVel); |
|||
} |
|||
} |
|||
|
|||
public override void CollectObservations(VectorSensor sensor) |
|||
{ |
|||
var agentPos = m_AgentRb.position - ground.transform.position; |
|||
|
|||
sensor.AddObservation(agentPos / 20f); |
|||
sensor.AddObservation(DoGroundCheck(true) ? 1 : 0); |
|||
sensor.AddObservation(m_GoalOneHot); |
|||
} |
|||
|
|||
/// <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 randomPosZ = Random.Range(-m_SpawnAreaBounds.extents.z, |
|||
m_SpawnAreaBounds.extents.z); |
|||
|
|||
var randomSpawnPos = spawnArea.transform.position + |
|||
new Vector3(randomPosX, 0.45f, randomPosZ - 2f); |
|||
return randomSpawnPos; |
|||
} |
|||
|
|||
public void MoveAgent(ActionSegment<int> act) |
|||
{ |
|||
AddReward(-0.0005f); |
|||
var smallGrounded = DoGroundCheck(true); |
|||
var largeGrounded = DoGroundCheck(false); |
|||
|
|||
var dirToGo = Vector3.zero; |
|||
var rotateDir = Vector3.zero; |
|||
var dirToGoForwardAction = act[0]; |
|||
var rotateDirAction = act[1]; |
|||
var dirToGoSideAction = act[2]; |
|||
var jumpAction = act[3]; |
|||
|
|||
if (dirToGoForwardAction == 1) |
|||
dirToGo = (largeGrounded ? 1f : 0.5f) * 1f * transform.forward; |
|||
else if (dirToGoForwardAction == 2) |
|||
dirToGo = (largeGrounded ? 1f : 0.5f) * -1f * transform.forward; |
|||
if (rotateDirAction == 1) |
|||
rotateDir = transform.up * -1f; |
|||
else if (rotateDirAction == 2) |
|||
rotateDir = transform.up * 1f; |
|||
if (dirToGoSideAction == 1) |
|||
dirToGo = (largeGrounded ? 1f : 0.5f) * -0.6f * transform.right; |
|||
else if (dirToGoSideAction == 2) |
|||
dirToGo = (largeGrounded ? 1f : 0.5f) * 0.6f * transform.right; |
|||
if (jumpAction == 1) |
|||
if ((jumpingTime <= 0f) && smallGrounded) |
|||
{ |
|||
Jump(); |
|||
} |
|||
|
|||
transform.Rotate(rotateDir, Time.fixedDeltaTime * 300f); |
|||
m_AgentRb.AddForce(dirToGo * m_WJPBSettings.agentRunSpeed, |
|||
ForceMode.VelocityChange); |
|||
|
|||
if (jumpingTime > 0f) |
|||
{ |
|||
m_JumpTargetPos = |
|||
new Vector3(m_AgentRb.position.x, |
|||
m_JumpStartingPos.y + m_WJPBSettings.agentJumpHeight, |
|||
m_AgentRb.position.z) + dirToGo; |
|||
MoveTowards(m_JumpTargetPos, m_AgentRb, m_WJPBSettings.agentJumpVelocity, |
|||
m_WJPBSettings.agentJumpVelocityMaxChange); |
|||
} |
|||
|
|||
if (!(jumpingTime > 0f) && !largeGrounded) |
|||
{ |
|||
m_AgentRb.AddForce( |
|||
Vector3.down * fallingForce, ForceMode.Acceleration); |
|||
} |
|||
jumpingTime -= Time.fixedDeltaTime; |
|||
} |
|||
|
|||
public override void OnActionReceived(ActionBuffers actionBuffers) |
|||
|
|||
{ |
|||
MoveAgent(actionBuffers.DiscreteActions); |
|||
if ((!Physics.Raycast(m_AgentRb.position, Vector3.down, 20)) |
|||
|| (!Physics.Raycast(m_ShortBlockRb.position, Vector3.down, 20))) |
|||
{ |
|||
SetReward(-1f); |
|||
EndEpisode(); |
|||
ResetBlock(m_ShortBlockRb); |
|||
} |
|||
} |
|||
|
|||
public override void Heuristic(in ActionBuffers actionsOut) |
|||
{ |
|||
var discreteActionsOut = actionsOut.DiscreteActions; |
|||
discreteActionsOut.Clear(); |
|||
if (Input.GetKey(KeyCode.D)) |
|||
{ |
|||
discreteActionsOut[1] = 2; |
|||
} |
|||
if (Input.GetKey(KeyCode.W)) |
|||
{ |
|||
discreteActionsOut[0] = 1; |
|||
} |
|||
if (Input.GetKey(KeyCode.A)) |
|||
{ |
|||
discreteActionsOut[1] = 1; |
|||
} |
|||
if (Input.GetKey(KeyCode.S)) |
|||
{ |
|||
discreteActionsOut[0] = 2; |
|||
} |
|||
discreteActionsOut[3] = Input.GetKey(KeyCode.Space) ? 1 : 0; |
|||
} |
|||
|
|||
// Detect when the agent hits the goal
|
|||
void OnTriggerStay(Collider col) |
|||
{ |
|||
if (col.gameObject.CompareTag("walljumpgoal") && DoGroundCheck(true)) |
|||
{ |
|||
// ending the episode so the agent doesnt get stuck over the wall
|
|||
if (m_Goal == 0) |
|||
{ |
|||
SetReward(1f); |
|||
EndEpisode(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
public void ScoredAGoal() |
|||
{ |
|||
if (m_Goal == 1) |
|||
{ |
|||
SetReward(1f); |
|||
EndEpisode(); |
|||
} |
|||
} |
|||
|
|||
|
|||
//Reset the orange block position
|
|||
void ResetBlock(Rigidbody blockRb) |
|||
{ |
|||
blockRb.transform.position = GetRandomSpawnPos(); |
|||
blockRb.velocity = Vector3.zero; |
|||
blockRb.angularVelocity = Vector3.zero; |
|||
m_ShortBlockRb.drag = 0.5f; |
|||
} |
|||
|
|||
public override void OnEpisodeBegin() |
|||
{ |
|||
ResetBlock(m_ShortBlockRb); |
|||
transform.localPosition = new Vector3( |
|||
18 * (Random.value - 0.5f), 1, -12); |
|||
m_Goal = Random.Range(0, goals); |
|||
//m_Goal = 0;
|
|||
System.Array.Clear(m_GoalOneHot, 0, m_GoalOneHot.Length); |
|||
m_GoalOneHot[m_Goal] = 1; |
|||
if (m_Goal == 0) |
|||
{ |
|||
m_WallRenderer.material = goalMaterial; |
|||
m_PushRenderer.material = nonGoalMaterial; |
|||
} |
|||
else |
|||
{ |
|||
m_WallRenderer.material = nonGoalMaterial; |
|||
m_PushRenderer.material = goalMaterial; |
|||
} |
|||
|
|||
var height = m_ResetParams.GetWithDefault("big_wall_height", 8); |
|||
var localScale = wall.transform.localScale; |
|||
localScale = new Vector3( |
|||
localScale.x, |
|||
height, |
|||
localScale.z); |
|||
wall.transform.localScale = localScale; |
|||
m_AgentRb.velocity = default(Vector3); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 27444f4d0864d410d88a30874ae845b4 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
//Detect when the orange block has touched the goal.
|
|||
//Detect when the orange block has touched an obstacle.
|
|||
//Put this script onto the orange block. There's nothing you need to set in the editor.
|
|||
//Make sure the goal is tagged with "goal" in the editor.
|
|||
|
|||
using UnityEngine; |
|||
|
|||
public class WJPBGoalDetect : MonoBehaviour |
|||
{ |
|||
/// <summary>
|
|||
/// The associated agent.
|
|||
/// This will be set by the agent script on Initialization.
|
|||
/// Don't need to manually set.
|
|||
/// </summary>
|
|||
[HideInInspector] |
|||
public WJPBAgent agent; //
|
|||
|
|||
void OnTriggerEnter(Collider col) |
|||
{ |
|||
// Touched goal.
|
|||
if (col.gameObject.CompareTag("pushblockgoal")) |
|||
{ |
|||
agent.ScoredAGoal(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: add3e4ac55d6546068c09db441825045 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
|
|||
public class WJPBSettings : MonoBehaviour |
|||
{ |
|||
[Header("Specific to WallJump")] |
|||
public float agentRunSpeed; |
|||
public float agentJumpHeight; |
|||
|
|||
[HideInInspector] |
|||
public float agentJumpVelocity = 777; |
|||
[HideInInspector] |
|||
public float agentJumpVelocityMaxChange = 10; |
|||
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: a6afcd2bf5d9a4c739386b2eca5241cb |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 91444bcaed65044a2af9565214dce241 |
|||
folderAsset: yes |
|||
timeCreated: 1517539094 |
|||
licenseType: Free |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/BigWallJump.nn
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 11fc5cb1f5b0f4ae39a36e2db65ca275 |
|||
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/WallJumpAndPushblock/TFModels/SmallWallJump.nn
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 7162ecb3cfbfc4b47b0278585fbaed90 |
|||
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/WallJumpAndPushblock/TFModels/WJPB-32499994.onnx
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 960b1933b6ec84fcb83c0c79668a4ee8 |
|||
ScriptedImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3} |
|||
optimizeModel: 1 |
|||
forceArbitraryBatchSize: 1 |
|||
treatErrorsAsWarnings: 0 |
1001
Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/WJPB-4999918.onnx
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 84bee0873d0be4a56b46a9884553728d |
|||
ScriptedImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3} |
|||
optimizeModel: 1 |
|||
forceArbitraryBatchSize: 1 |
|||
treatErrorsAsWarnings: 0 |
1001
Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/cloud.onnx
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 15e1a204928a14cfa910f8c51edaf85f |
|||
ScriptedImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3} |
|||
optimizeModel: 1 |
|||
forceArbitraryBatchSize: 1 |
|||
treatErrorsAsWarnings: 0 |
撰写
预览
正在加载...
取消
保存
Reference in new issue