Beispiel #1
0
    void GeneratePlayers()
    {
        GameObject players = new GameObject();

        players.name = "UnitContainer";
        Vector3 initialPosition             = new Vector3(6.5f, 0.0f, 5.0f);
        Vector3 initialEulerAngle           = new Vector3(0, 270, 0);
        int     agentSize                   = 11;
        List <NeuralNetworkPlayer> nnAgents = new List <NeuralNetworkPlayer>(agentSize);

        switch (GameManager.gameMode)
        {
        case GameManager.GameMode.AI_vs_AI:
            GenerateScriptedAIPlayers(ref nnAgents, ref players, initialPosition, initialEulerAngle, agentSize);
            break;

        case GameManager.GameMode.NeuralNetworkTraining:
            GeneratePlayersForNeuralNetworkTraining(ref nnAgents, ref players, initialPosition, initialEulerAngle, agentSize);
            break;

        default:
            break;
        }

        IgnoreCollisionBetweenUnits();
        evolutionManager.Initialize(nnAgents);
    }