浏览代码

Some more tweaks

/develop/battlefoodcollector
Ervin Teng 4 年前
当前提交
8a8cd93b
共有 3 个文件被更改,包括 66 次插入40 次删除
  1. 60
      Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/BattleFoodArea.prefab
  2. 42
      Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/DeathmatchArea.prefab
  3. 4
      Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/BattleFoodAgent.cs

60
Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/BattleFoodArea.prefab


m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 5
VectorObservationSize: 4
m_Model: {fileID: 11400000, guid: 1d729ccfce8984433bd70af61870fb24, type: 3}
m_Model: {fileID: 11400000, guid: ab5b2af686f124006bdd14e53aeed779, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 0
MaxStep: 2000
cooldownTime: 0.5
cooldownTime: 0
timePenalty: 0
normalMaterial: {fileID: 2100000, guid: c9fa44c2c3f8ce74ca39a3355ea42631, type: 2}
badMaterial: {fileID: 2100000, guid: b0da1813c36914e678ba57f2790424e1, type: 2}
goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}

useVectorFrozenFlag: 0
useCooldownObs: 0
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &1495617568563208
GameObject:

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 5
VectorObservationSize: 4
m_Model: {fileID: 11400000, guid: 1d729ccfce8984433bd70af61870fb24, type: 3}
m_Model: {fileID: 11400000, guid: ab5b2af686f124006bdd14e53aeed779, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 0
MaxStep: 2000
cooldownTime: 0.5
cooldownTime: 0
timePenalty: 0
normalMaterial: {fileID: 2100000, guid: c9fa44c2c3f8ce74ca39a3355ea42631, type: 2}
badMaterial: {fileID: 2100000, guid: b0da1813c36914e678ba57f2790424e1, type: 2}
goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}

useVectorFrozenFlag: 0
useCooldownObs: 0
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &1574067311314706
GameObject:

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 5
VectorObservationSize: 4
m_Model: {fileID: 11400000, guid: 1d729ccfce8984433bd70af61870fb24, type: 3}
m_Model: {fileID: 11400000, guid: ab5b2af686f124006bdd14e53aeed779, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 0
MaxStep: 2000
cooldownTime: 0.5
cooldownTime: 0
timePenalty: 0
normalMaterial: {fileID: 2100000, guid: c9fa44c2c3f8ce74ca39a3355ea42631, type: 2}
badMaterial: {fileID: 2100000, guid: b0da1813c36914e678ba57f2790424e1, type: 2}
goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}

useVectorFrozenFlag: 0
useCooldownObs: 0
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &1617924810425504
GameObject:

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 5
VectorObservationSize: 4
m_Model: {fileID: 11400000, guid: 1d729ccfce8984433bd70af61870fb24, type: 3}
m_Model: {fileID: 11400000, guid: ab5b2af686f124006bdd14e53aeed779, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 0
MaxStep: 2000
cooldownTime: 0.5
cooldownTime: 0
timePenalty: 0
normalMaterial: {fileID: 2100000, guid: b0da1813c36914e678ba57f2790424e1, type: 2}
badMaterial: {fileID: 2100000, guid: c9fa44c2c3f8ce74ca39a3355ea42631, type: 2}
goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}

useVectorFrozenFlag: 0
useCooldownObs: 0
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &1688105343773098
GameObject:

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 5
VectorObservationSize: 4
m_Model: {fileID: 11400000, guid: 1d729ccfce8984433bd70af61870fb24, type: 3}
m_Model: {fileID: 11400000, guid: ab5b2af686f124006bdd14e53aeed779, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 0
MaxStep: 2000
cooldownTime: 0.5
cooldownTime: 0
timePenalty: 0
normalMaterial: {fileID: 2100000, guid: b0da1813c36914e678ba57f2790424e1, type: 2}
badMaterial: {fileID: 2100000, guid: c9fa44c2c3f8ce74ca39a3355ea42631, type: 2}
goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}

useVectorFrozenFlag: 0
useCooldownObs: 0
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &1729825611722018
GameObject:

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 5
VectorObservationSize: 4
m_Model: {fileID: 11400000, guid: 1d729ccfce8984433bd70af61870fb24, type: 3}
m_Model: {fileID: 11400000, guid: ab5b2af686f124006bdd14e53aeed779, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 0
MaxStep: 2000
cooldownTime: 0.5
cooldownTime: 0
timePenalty: 0
normalMaterial: {fileID: 2100000, guid: b0da1813c36914e678ba57f2790424e1, type: 2}
badMaterial: {fileID: 2100000, guid: c9fa44c2c3f8ce74ca39a3355ea42631, type: 2}
goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}

useVectorFrozenFlag: 0
useCooldownObs: 0
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &5100791406091554310
GameObject:

42
Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/DeathmatchArea.prefab


VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: c3663bdb64b8847e797e1fb545c1aefb, type: 3}
m_Model: {fileID: 11400000, guid: b84b83364388e47148b8d06ab84467d8, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 2000
MaxStep: 10000
area: {fileID: 7136043490825593518}
turnSpeed: 300
moveSpeed: 2

contribute: 1
useVectorObs: 1
useVectorFrozenFlag: 0
useCooldownObs: 1
freezeTime: 10000
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &1495617568563208
GameObject:

VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: c3663bdb64b8847e797e1fb545c1aefb, type: 3}
m_Model: {fileID: 11400000, guid: b84b83364388e47148b8d06ab84467d8, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 2000
MaxStep: 10000
area: {fileID: 7136043490825593518}
turnSpeed: 300
moveSpeed: 2

contribute: 1
useVectorObs: 1
useVectorFrozenFlag: 0
useCooldownObs: 1
freezeTime: 10000
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &1574067311314706
GameObject:

VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: c3663bdb64b8847e797e1fb545c1aefb, type: 3}
m_Model: {fileID: 11400000, guid: b84b83364388e47148b8d06ab84467d8, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 2000
MaxStep: 10000
area: {fileID: 7136043490825593518}
turnSpeed: 300
moveSpeed: 2

contribute: 1
useVectorObs: 1
useVectorFrozenFlag: 0
useCooldownObs: 1
freezeTime: 10000
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &1617924810425504
GameObject:

VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: c3663bdb64b8847e797e1fb545c1aefb, type: 3}
m_Model: {fileID: 11400000, guid: b84b83364388e47148b8d06ab84467d8, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 2000
MaxStep: 10000
area: {fileID: 2458225129383339183}
turnSpeed: 300
moveSpeed: 2

contribute: 1
useVectorObs: 1
useVectorFrozenFlag: 0
useCooldownObs: 1
freezeTime: 10000
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &1688105343773098
GameObject:

VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: c3663bdb64b8847e797e1fb545c1aefb, type: 3}
m_Model: {fileID: 11400000, guid: b84b83364388e47148b8d06ab84467d8, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 2000
MaxStep: 10000
area: {fileID: 2458225129383339183}
turnSpeed: 300
moveSpeed: 2

contribute: 1
useVectorObs: 1
useVectorFrozenFlag: 0
useCooldownObs: 1
freezeTime: 10000
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &1729825611722018
GameObject:

m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &2786020641414061466
Transform:
m_ObjectHideFlags: 0

m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &1033199660069568188
Transform:
m_ObjectHideFlags: 0

VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: c3663bdb64b8847e797e1fb545c1aefb, type: 3}
m_Model: {fileID: 11400000, guid: b84b83364388e47148b8d06ab84467d8, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: BattleFoodCollector

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 2000
MaxStep: 10000
area: {fileID: 2458225129383339183}
turnSpeed: 300
moveSpeed: 2

contribute: 1
useVectorObs: 1
useVectorFrozenFlag: 0
useCooldownObs: 1
freezeTime: 10000
areaScoring: {fileID: 8193433416055547570}
--- !u!1 &5100791406091554310
GameObject:

m_EditorClassIdentifier:
agents: []
listArea: []
WinningScore: 1
WinningScore: 3
foodScore: 0
freezeScore: 1
scoreText: {fileID: 0}

4
Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/BattleFoodAgent.cs


public bool useVectorFrozenFlag;
public bool useCooldownObs = true;
public float freezeTime = 10f;
public BattleFoodScoring areaScoring;
EnvironmentParameters m_ResetParams;

AddReward(timePenalty);
m_Shoot = false;
if (Time.time > m_FrozenTime + 10f && m_Frozen)
if (Time.time > m_FrozenTime + freezeTime && m_Frozen)
{
Unfreeze();
}

正在加载...
取消
保存