Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learn Unity ML-Agents ??? Fundamentals of Unity Machine Learning

You're reading from  Learn Unity ML-Agents ??? Fundamentals of Unity Machine Learning

Product type Book
Published in Jun 2018
Publisher Packt
ISBN-13 9781789138139
Pages 204 pages
Edition 1st Edition
Languages

Carnivore: the hunter

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:

  1. Open the CreatureAgent script in your favorite coding editor.
  2. 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
...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}