Create an intelligent game experience
Creating responsive and intelligent virtual players and non-playable game characters is hard. Especially when the game is complex. To create intelligent behaviors, developers have had to resort to writing tons of code or using highly specialized tools.
With Unity Machine Learning Agents (ML-Agents), you are no longer “coding” emergent behaviors, but rather teaching intelligent agents to “learn” through a combination of deep reinforcement learning and imitation learning. Using ML-Agents allows developers to create more compelling gameplay and an enhanced game experience.
Create realistic and complex AI environments to train models
Advancement of artificial intelligence (AI) research depends on figuring out tough problems in existing environments using current benchmarks for training AI models. However, as these challenges are “solved,” the need for novel environments arises. But creating such environments is often time-intensive and requires specialized domain knowledge.
Using Unity and the ML-Agents toolkit, you can create AI environments that are physically, visually, and cognitively rich. You can use them for benchmarking as well as researching new algorithms and methods.
How Unity ML-Agents works
Integrate the ML-Agents Unity package.
Connect your integrated Unity project and start training the agents to learn the right behaviour.
When training is complete, embed the trained agent model back into your Unity project.
Need to scale up your training?
An ML-Agents cloud offering will be available later this year that will enable ML-Agents users to train on a scalable cloud infrastructure. With this cloud offering you will be able to submit many concurrent training sessions or easily scale out a training session across many machines for faster results.
If you are currently using ML-Agents and need help with scaling and managing experiments, sign up for a preview access.
Faster training times with JamCity Snoopy Pop
We partnered with JamCity to train an agent for their bubble shooter Snoopy Pop. One of the challenges with training an agent to play Snoopy Pop is the large volume of gameplay data to learn effective behaviors and strategies. Additionally, most games in development are constantly evolving, so training times need to be reasonably fast. We introduced various features in ML-Agents like Asynchronous Environments, Generative Adversarial Imitation Learning (GAIL), and Soft Actor-Critic to solve these problems.
Millions of natural-feeling, procedurally generated monsters
In Source of Madness, an action rogue-lite game created by Carry Castle, you traverse an ever-changing dynamic world, battling new procedurally generated monsters each playthrough, brought to life by a powerful machine-learning AI.
Creating the enemy monsters involved several challenges for the small team:
- The physics controlling the monsters is unusual
- There are millions of variations of monsters
- The monsters needed to look natural
Using the ML-Agents toolkit – and, specifically, deep reinforcement learning – the team trained and created a neural network model that produced the right behavior. Then, using the Unity Inference Engine, they embedded the model into the game.
Check out these ML-Agents videos
Kart Racing Game with Machine Learning in Unity! (Tutorial)
Learn how to implement Unity’s machine learning toolkit ML Agents into Unity’s Kart Racing Game project. Reinforcement learning is used to train the AI agent to travel around the track autonomously by “seeing” with raycasts and steering to avoid obstacles.
Intelligent agents flying airplanes
This project shows how reinforcement learning via Unity ML-Agents was used to teach planes to fly. The airplanes fly freely in space using raycast for vision. This project also uses imitation learning to train the agents.
AI learns soccer
Two different artificial neural networks battle each other in a simple game of soccer using deep reinforcement learning to train neural networks. The soccer game is included in the ML-Agents framework, available on GitHub.
AI learns to park a car
An AI learns to park a car in a parking lot in a 3D physics simulation implemented using Unity ML-Agents. The AI consists of a deep neural network with three hidden layers of 128 neurons each. It is trained with the proximal policy optimization (PPO) algorithm, a reinforcement learning approach.
Metallic waste collection robot
AI learns to play a game with an Xbox controller
See how a video game learned to play itself using a gamepad, the Unity platform and ML-Agents toolkit. The experiment inserts hardware into the reinforcement learning scenario.
AI learns to land a rocket
In this project, a neural network is trained to land a rocket on a platform using Unity Physics. It is trained with proximal policy optimization (PPO) using PyTorch and runs on Google Cloud. Training took about 15 million steps.
This project uses ML-Agents to stabilize a satellite rotating through one axis. AI controls two satellite engines, which can be on or off. The session starts with a rotating satellite. It took two hours of ML-Agents learning for the satellite to achieve the goal stabilizing, stopping its rotation and calibrating its position.
Hide/Escape – Avoidance of Pursuing Enemies
Inspired by the stealth game genre, this project was designed to train an agent to successfully run and hide from a traditional AI that patrols from room to room. A second variation was created to train against a faster AI using curriculum learning.
Pass the Butter/Pancake Bot
This project’s goal was to automate the task of making breakfast. Using machine learning, an agent flips a pancake from a pan to a plate and a robot dodges obstacles to deliver the butter.
From the blog
Learn how to implement ML-Agents
We’ve partnered with Immersive Limit to create an online course that teaches you how to implement ML-Agents through exercises, code walkthroughs, and helpful discussions.
Tap the community
Ask questions, find answers, and connect with other Unity ML-Agents experts and experimenters, including Unity staff.
File support issues on our github page
Explore our ecosystem
Check out Unity’s AI and machine learning products and learn how they can help you solve diverse problems.
Unity Computer Vision
Get perfectly labeled, high-quality data for computer vision training at a fraction of the cost.
Prototype, test, and train your robots in high-fidelity, realistic simulations before deploying them to the real world.
Harness the power of cloud to run millions of simulations to generate training data for machine learning, test and validate AI algorithms, or evaluate and optimize modeled systems.