Merge branch 'krazerleo/core/1' of https://gitea.gavt45.ru/gav/real-shooter into krazerleo/core/1
This commit is contained in:
@ -70,7 +70,14 @@ public class NPC : Agent, ICharacter
|
||||
|
||||
public override void CollectObservations(VectorSensor sensor)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
var candidates = moveController.GetPointsCandidate();
|
||||
=======
|
||||
sensor.AddObservation(Condition.HealthPoints);
|
||||
sensor.AddObservation(Condition.ArmourPoints);
|
||||
sensor.AddObservation(Condition.Ammunition);
|
||||
sensor.AddObservation((int) NPC_State.State);
|
||||
>>>>>>> 351fa8ee12c499a0374be71a192a5f288611f467
|
||||
|
||||
//common sensors
|
||||
sensor.AddObservation(GameManager.IsHaveSeenByEnemy(AgentCharacter.Team.GetOppositeTeam(),
|
||||
@ -93,6 +100,7 @@ public class NPC : Agent, ICharacter
|
||||
//point sensors
|
||||
foreach (var point in candidates)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
bufferSensor.AppendObservation(new float[] {
|
||||
point.DeathAttr,
|
||||
(int)point.navType,
|
||||
@ -104,6 +112,35 @@ public class NPC : Agent, ICharacter
|
||||
GameManager.IsHaveSeenByEnemy(AgentCharacter.Team.GetOppositeTeam(),
|
||||
point.Position).ToInt()
|
||||
});
|
||||
=======
|
||||
var parray = new float[]
|
||||
{
|
||||
//1 position in navpointId
|
||||
(float) moveController.currentPosition.PointId,
|
||||
//2 distance to flag
|
||||
moveController.currentPosition.FlagDistance,
|
||||
//3 death count in point
|
||||
moveController.currentPosition.DeathAttr,
|
||||
//4 flagEnemyDistance
|
||||
GameManager.IsCloserToFlagFromNextNavPoint(point, transform.position) == true ? 1 : 0,
|
||||
//5 EnemyVsNavPointDistance
|
||||
GameManager.IsCloserToEnemyThanToNextNavPoint(point, transform.position, AgentCharacter.Team) == true
|
||||
? 1
|
||||
: 0
|
||||
};
|
||||
// var _parray = string.Join(" ", parray);
|
||||
// Debug.Log("OBS: " + _parray);
|
||||
bufferSensor.AppendObservation(parray);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Heuristic(in ActionBuffers actionsOut)
|
||||
{
|
||||
var discreteActionsOut = actionsOut.DiscreteActions;
|
||||
if (Input.GetKeyDown(KeyCode.W))
|
||||
{
|
||||
discreteActionsOut[0] = 1;
|
||||
>>>>>>> 351fa8ee12c499a0374be71a192a5f288611f467
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,6 +149,7 @@ public class NPC : Agent, ICharacter
|
||||
var result = actions.DiscreteActions;
|
||||
if (result[0] == 0)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
if (navPointIdDict[moveController.PointStartID].navType != NavPointType.Cover)
|
||||
return;
|
||||
NpcState = CoverState;
|
||||
@ -147,6 +185,13 @@ public class NPC : Agent, ICharacter
|
||||
case 1: moveController.ReturnToStartPoint(); NpcState = RunningState; break;
|
||||
default: throw new ArgumentException("Undefined Action recieved");
|
||||
}
|
||||
=======
|
||||
moveController.MoveToRandomPoint();
|
||||
NPC_State = RunningState;
|
||||
} else if (actions.DiscreteActions[0] == 2)
|
||||
{
|
||||
moveController.MoveToPointById(actions.DiscreteActions[1]);
|
||||
>>>>>>> 351fa8ee12c499a0374be71a192a5f288611f467
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
Reference in New Issue
Block a user