latest
This commit is contained in:
@ -54,24 +54,29 @@ public class NPC : Agent, ICharacter
|
||||
sensor.AddObservation(Condition.HealthPoints);
|
||||
sensor.AddObservation(Condition.ArmourPoints);
|
||||
sensor.AddObservation(Condition.Ammunition);
|
||||
sensor.AddObservation((int)NPC_State.State);
|
||||
sensor.AddObservation((int) NPC_State.State);
|
||||
|
||||
var candidates = moveController.getPointsCandidate();
|
||||
foreach (var point in candidates)
|
||||
{
|
||||
bufferSensor.AppendObservation(new float[] {
|
||||
var parray = new float[]
|
||||
{
|
||||
//1 position in navpointId
|
||||
(float)moveController.currentPosition.PointId,
|
||||
(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,
|
||||
GameManager.IsCloserToFlagFromNextNavPoint(point, transform.position) == true ? 1 : 0,
|
||||
//5 EnemyVsNavPointDistance
|
||||
GameManager.IsCloserToEnemyThanToNextNavPoint(point,transform.position, AgentCharacter.Team)==true?1:0
|
||||
});
|
||||
|
||||
GameManager.IsCloserToEnemyThanToNextNavPoint(point, transform.position, AgentCharacter.Team) == true
|
||||
? 1
|
||||
: 0
|
||||
};
|
||||
var _parray = string.Join(" ", parray);
|
||||
Debug.Log("OBS: " + _parray);
|
||||
bufferSensor.AppendObservation(parray);
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,6 +95,9 @@ public class NPC : Agent, ICharacter
|
||||
{
|
||||
moveController.MoveToRandomPoint();
|
||||
NPC_State = RunningState;
|
||||
} else if (actions.DiscreteActions[0] == 2)
|
||||
{
|
||||
moveController.MoveToPointById(actions.DiscreteActions[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user