浏览代码

add portal observation tag and agents die if touch portal

/develop/superpush/int/hunter
HH 4 年前
当前提交
9f7dfc06
共有 10 个文件被更改,包括 33 次插入3058 次删除
  1. 7
      Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/DungeonEscapeAgent.prefab
  2. 6
      Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/DungeonEscapePlatform.prefab
  3. 25
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/DungeonEscapeEnvController.cs
  4. 8
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentEscape.cs
  5. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockZombie.onnx
  6. 14
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockZombie.onnx.meta
  7. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockgrid-7499953.onnx
  8. 14
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockgrid-7499953.onnx.meta
  9. 14
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/DungeonEscapeRays.onnx.meta
  10. 1001
      Project/Assets/ML-Agents/Examples/PushBlock/TFModels/DungeonEscapeRays.onnx

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


- dragon
- key
- lock
m_RaysPerDirection: 9
m_MaxRayDegrees: 120
- portal
m_RaysPerDirection: 7
m_MaxRayDegrees: 60
m_SphereCastRadius: 0.5
m_RayLength: 40
m_RayLayerMask:

VectorActionDescriptions: []
VectorActionSpaceType: 0
hasUpgradedBrainParametersWithActionSpec: 1
m_Model: {fileID: 11400000, guid: 96c6fde84ac654b129311fafdd96119d, type: 3}
m_Model: {fileID: 11400000, guid: 3fa61361f23fd46e9b78326f45cb98ce, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: PushBlock

6
Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/DungeonEscapePlatform.prefab


m_Modification:
m_TransformParent: {fileID: 2512227112770887927}
m_Modifications:
- target: {fileID: 4796904010917588665, guid: f3c5280e4ae094a9a9b8b6702630c941,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 3fa61361f23fd46e9b78326f45cb98ce,
type: 3}
- target: {fileID: 4828233698206621445, guid: f3c5280e4ae094a9a9b8b6702630c941,
type: 3}
propertyPath: m_Name

25
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/DungeonEscapeEnvController.cs


public List<PlayerInfo> AgentsList = new List<PlayerInfo>();
public List<DragonInfo> DragonsList = new List<DragonInfo>();
private Dictionary<PushAgentEscape, PlayerInfo> m_PlayerDict = new Dictionary<PushAgentEscape, PlayerInfo>();
private int m_NumberOfRemainingBlocks;
private int m_NumberOfRemainingPlayers;
public GameObject Key;
private SimpleMultiAgentGroup m_AgentGroup;

// Starting material
m_GroundMaterial = m_GroundRenderer.material;
m_PushBlockSettings = FindObjectOfType<PushBlockSettings>();
//Reset Players Remaining
m_NumberOfRemainingPlayers = AgentsList.Count;
//Hide The Key
Key.SetActive(false);

// m_AgentGroup.AddGroupReward(-0.5f / MaxEnvironmentSteps);
}
public void UnlockBlock(Transform blockT)
public void TouchedHazard(PushAgentEscape agent)
{
m_NumberOfRemainingPlayers--;
agent.EndEpisode();
agent.gameObject.SetActive(false);
if (m_NumberOfRemainingPlayers == 0 || agent.IHaveAKey)
{
m_AgentGroup.EndGroupEpisode();
ResetScene();
}
}
public void UnlockDoor()
{
m_AgentGroup.AddGroupReward(1f);
StartCoroutine(GoalScoredSwapGroundMaterial(m_PushBlockSettings.goalScoredMaterial, 0.5f));

public void KilledByBaddie(PushAgentEscape agent, Collision baddieCol)
{
baddieCol.gameObject.SetActive(false);
m_NumberOfRemainingPlayers--;
agent.EndEpisode();
agent.gameObject.SetActive(false);
print($"{baddieCol.gameObject.name} ate {agent.transform.name}");

//Reset counter
m_ResetTimer = 0;
//Reset Players Remaining
m_NumberOfRemainingPlayers = AgentsList.Count;
//Random platform rot
var rotation = Random.Range(0, 4);

8
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentEscape.cs


{
MyKey.SetActive(false);
IHaveAKey = false;
m_GameController.UnlockBlock(col.transform);
m_GameController.UnlockDoor();
}
}
if (col.transform.CompareTag("dragon"))

IHaveAKey = false;
}
if (col.transform.CompareTag("portal"))
{
m_GameController.TouchedHazard(this);
// MyKey.SetActive(false);
// IHaveAKey = false;
}
}

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

14
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockZombie.onnx.meta


fileFormatVersion: 2
guid: 9a4ea4894b7fb49859cfa9c16652b207
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3}
optimizeModel: 1
forceArbitraryBatchSize: 1
treatErrorsAsWarnings: 0

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

14
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockgrid-7499953.onnx.meta


fileFormatVersion: 2
guid: 92ab7655c543b4bedb2982bb00ca6ba4
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3}
optimizeModel: 1
forceArbitraryBatchSize: 1
treatErrorsAsWarnings: 0

14
Project/Assets/ML-Agents/Examples/PushBlock/TFModels/DungeonEscapeRays.onnx.meta


fileFormatVersion: 2
guid: d3a99ac5727974e74aff28ed240e9a46
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3}
optimizeModel: 1
forceArbitraryBatchSize: 1
treatErrorsAsWarnings: 0

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

正在加载...
取消
保存