Trying to find the balance in creating a thriving world was one of the challenges you originally faced in the original terrarium. In fact, the most challenging creature to write was no surprise: the carnivore. The carnivore is at the top of the food chain and its purpose is to consume herbivores. Not unlike the real world, this will actually help in our training of both agents. In order to add our carnivore creature, we will first need to add some code to our CreatureAgent script. Follow this exercise to modify the CreatureAgent script for carnivores:
- Open the CreatureAgent script in your favorite coding editor.
- Modify the AgentAction method and uncomment the Attack and Defend actions as follows:
public override void AgentAction(float[] vectorAction,
string textAction) {
//Action Space 7 float
// 0 = Move
// 1 = Eat
...