# Machine Learning in games

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/)
- [Machine Learning in games](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/02-ml-in-games/)
- [Install Unity and the project](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/03-install/)
- [The Dr Arm game](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/04-the-dr-arm-game/)
- [Machine Learning in Unity](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/05-machine-learning-in-unity/)
- [The Unity project](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/06-the-unity-project/)
- [Objects and Components](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/07-objects-and-components/)
- [Training our ML agents](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/08-training-our-ml-agents/)
- [Optimizations](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/09-optimizations/)
- [Summary](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/10-summary/)
- [Next Steps](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/_next-steps/)

## The problem
Machine Learning has many potential applications across various platforms. One use case is implementing realistic behavior for non-player characters (NPCs) in video games. In this learning path, we will utilize the Unity Machine Learning Agents toolkit to build an “AI brain” for NPCs in a game.

Creating rich, realistic AI for games is challenging, especially as project complexity increases. Traditional solutions often require extensive specialized coding and tools. Machine learning avoids the need for specialized code and instead leverages a generic approach to building smart AI-powered opponents with varying levels of difficulty.

## The project
This learning path uses a Unity game template to implement AI for a fighting game with two characters. The characters battle in a 3D arena. One fighter is controlled by the human player, while the other is controlled by the AI brain we are creating.

![Image Alt Text:ML Gameplay](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/using_unity_machine_learning_agents/images/ml-gameplay.png "Figure 1. Our fighting game with AI opponent")  
Figure 1. Our fighting game with AI opponent

## How does this game template and its AI work?
Machine learning applications are built in two stages:

First, a *model* (neural network) is trained in the *training* stage.

Next, this trained model is used at runtime in the final application (the game) to make smart decisions and actions. This is the *inference* stage.

Inference usually runs on a different platform than the one used for training the model. The system and hardware requirements for these stages are very different.

The Unity game template in this learning path uses the Unity Machine Learning (ML) Agents toolkit. This toolkit provides tools for both training and inference. It also supports two types of machine learning: *Imitation Learning* and *Reinforcement Learning*.

Imitation Learning uses an “expert” for the AI to learn from, while Reinforcement Learning uses rewards and punishments. This learning path focuses on Reinforcement Learning.

Click on the next step for information about installing the necessary tools.
