Setting up ML-Agents

At the time of writing this book, ML-Agents is developed and shipped as a GitHub project. It is likely that as the product matures, it will be shipped as its own asset package, but currently, it is not.

Therefore, we first need to export ML-Agents as an asset package. Open up a new Unity Editor session to an ML-Agents or Unity SDK project, and follow these steps:

  1. Locate the ML-Agents folder in the Project window, and select it.
  2. From the menu, select Assets | Export Package.
  3. Be sure that all of the folder contents are highlighted, as shown in the following Exporting package dialog excerpt:

Exporting ML-Agents as an asset package
  1. Be sure to uncheck the Include dependencies checkbox, as shown in the preceding excerpt. As long as you have the proper root folder selected, all of the dependencies that we need should get packaged.
  2. Click on the Export... button in the dialog, and then choose and save the asset file to a location that you will easily be able to find later.
  3. Open the Unity Editor to the project that we started in the last exercise.
  4. From the menu, select Assets | Import Package | Custom Package. Locate the package that we just exported and import it into the new test project.
  5. Locate the project window and create a new folder called HoDLG in the Assets root, and, then, inside that new folder, create new folders called Brains, Prefabs, and Scripts, as shown in the following screenshot:

Creating new project folders
  1. Creating these folders is the standard way of laying the foundation for a new asset, example, or project. You can now close the old ML-Agents Unity SDK project, as we no longer need it.

Now that we have ML-Agents imported and the foundations laid for our test game, we can move on to adding the learning parts of ML-Agents for testing.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset