We have looked extensively at external or extrinsic rewards for several chapters now and how techniques can be used to optimize and encourage them for agents. Now, it may seem like the easy way to go in order to modify an agent's behavior is by altering its extrinsic rewards or in essence its reward functions. However, this can be prone to difficulties, and this can often alter training performance for the worse, which is what we witnessed when we added Curriculum Learning (CL) to a couple of agents in the previous section. Of course, even if we make the training worse, we now have a number of techniques up our sleeves such as Transfer Learning (TL), also known as Imitation Learning (IL); Curiosity; and CL, to help us correct things.
In the next exercise, we are going to look to add further individuality to our agents by adding additional extrinsic rewards. Open up the previous exercise example we were just working on and follow along:
- From the menu, select Window | Asset Store. This will take you to the Unity Asset Store, which is an excellent resource for helper assets. While most of these assets are paid, honestly, the price compared to comparable developer tools is minimal, and there are several free and very excellent assets that you can start using to enhance your training environments. The Asset Store is one of the best and worst things about Unity, so if you do purchase assets, be sure to read the reviews and forum posts. Any good asset will typically have its own forum if it is developer-focused, artistic assets much less so.
- In the search bar, enter toony tiny people and press the Enter key or click the Search button. This will display the search results.
- Select the result called Toony Tiny People Demo by Polygon Blacksmith and select it. It will appear as shown in this screenshot:
- Click the red Download button and, after the asset has downloaded, the button will change to Import, as shown in the preceding screenshot. Click the Import button to import the assets. When you are prompted by the Import dialog, make sure everything is selected and click Import.
- Select and expand all the agent objects in Hierarchy. This includes RedStriker, BlueStriker, RedGoalie, and BlueGoalie.
- Open the Assets | TooyTinyPeople | TT_demo | prefabs folder in the Project window.
- Select and drag the TT_demo_Female prefab from the preceding folder and drop it into the RedStriker agent object in the Hierarchy window. Select the cube object just beneath the agent and disable it in the inspector. Continue to do this for the other agents according to the following list:
- TT_demo_female -> RedStriker
- TT_demo_male_A -> BlueStriker
- TT_demo_police -> BlueGoalie
- TT_demo_zombie -> RedGoalie
This is further demonstrated in this screenshot:
- Make sure to also reset the new agent model's Transform Position and Orientation to [0,0,0], as shown in the following screenshot:
- Save the scene and project.
At this point, you can run the scene in training and watch the new agent models move around, but there isn't much point. The agents will still act the same, so what we need to do next is set additional extrinsic rewards based on some arbitrary personality, which we will define in the next section.