Insights From The Blog

How Unity is Democratising AI: Unity ML-Agents is a Game Changer

Artificial Intelligence (AI) is one of the fastest growing and exciting areas of software development, with it being reckoned that over the next ten years AI-powered machines and software are likely to start to untethering from human supervision, embarking on the path as true sentient systems. And this rise is being powered by Unity ML-agents.

Unity ML-Agents is a plugin for the Unity game engine that allows us to create or use pre-made environments and to train agents within that environment. The system has been developed by developers of Unity engine, which is now becoming an even more flexible solution with release of the ML Agent Toolkit.

The Unity Machine Learning Agents (ML-Agents) toolkit is an open-source plugin for the Unity that enables games and simulations to serve as environments for training intelligent in-game agents. Using the toolkit, these agents can be trained using reinforcement learning, imitation learning or other machine learning methods through a simple-to-use Python application programming interface (API). 

These agents can be trained within the software environment to perform an array of tasks such as including controlling non-player character (NPC) behaviour automated testing of game builds and evaluating different game design decisions prior to the games release. The use of ML-Agents has accelerated how training is carried out in game development and reinforced learning (RL) and self-play and, in doing so, has taken AI forward in a huge leap.

This aspect of gaming is an important step forward in self-play and provides a learning environment analogous to how humans structure competition. Self-play in game allows operating agents within it with a good degree of creativity, which is generally independent of the initial conditions usually set by the programmers. The agent is simply given the rules of the particular game and told what constitutes it winning or losing, and then allowed to run.

Over multiple goes, the agent starts to modify its behaviour to try and win. In this way, the game engine effectively learns and adapts. But it can go further too; in the case of adversarial games, the agent can contend with not only the bespoke dynamics of the game environment, but also another – also possibly intelligent – agent. The Unity ML-Agent has three interacting components:

  • the learning component that contains the Unity scene and the environment elements
  • the Python API that contains the RL algorithms, and
  • the external communicator that connects these two elements.

These three components form the core of the ML-agent and allow the actors to enter the decision-making process and to make decisions based on the environment in which it is operating.

The ML-Agent opens up huge possibilities in machine learning and, with that, it becomes exciting times for AI in gaming as well as deep reinforcement learning and the field of robotics in general. Using Unity as a simulation and development platform, the toolkit enables the augmentation of learning environments to support detailed sensory and physical complexity.

Uptake of the ML-Agent will provide compelling cognitive challenges to developers, and support dynamic multi-agent interaction and drive, and that will only be a good thing for the AI possibilities that the system brings. 

The ML-Agent in Unity is bringing AI-driven development to a much more diverse audience, and allowing anyone with the desire to delve into AI and game development, and that can only be a positive.