When I run the training AI the Continuous Actions and Discrete Actions always return the same outcome, and the AI does not seem to learn any thing from that. Am I missing something?
public override void OnActionReceived(ActionBuffers actions)
{
Debug.Log("Move X:" + actions.ContinuousActions[0]);
Debug.Log("Move Y:" +actions.ContinuousActions[1]);
Debug.Log("Rotate:" + actions.ContinuousActions[2]);
if (!moveLock)
{
controller.HorizontalMovement(actions.ContinuousActions[0], actions.ContinuousActions[1]);
}
controller.HorizontalRotation(actions.ContinuousActions[2]);
//Jump
Debug.Log("jumpAction:" + actions.DiscreteActions[0]);
int jumpAction = actions.DiscreteActions[0];
if (jumpAction == 0&& !jumpLock)
{
if (controller.JumpAction())
{
AddReward(-0.1f);
}
}
Debug.Log("LeftHandAttack:" + actions.DiscreteActions[1]);
//Left Hand Attack
int LHandAction = actions.DiscreteActions[1];
if (LHandAction==0)
{
controller.LeftHandAttack();
}
Debug.Log("RightHandAttack:" + actions.DiscreteActions[2]);
//Right Hand Attack
int RHandAction = actions.DiscreteActions[2];
if (RHandAction == 0)
{
controller.RightHandAttack();
}
Debug.Log(".Sprint:" + actions.DiscreteActions[3]);
//.Sprint
int dashAction = actions.DiscreteActions[3];
if (dashAction == 0 &&!dashLock)
{
controller.SprintAction();
}
}