Unity MlAgent

Hello everyone, take a look at this ML agent project I've developed in Unity. It's an AI-controlled game, where I've trained an agent using Unity ML-Agents.


Unity ML-Agents offer two distinct learning approaches:

- Reinforcement learning (based on rewards and penalties)

- Imitation learning (Learn by mirroring player actions)

My next focus: Learning Imitation learning.


This project was incredibly exciting for me because I had always been interested in learning about machine learning. However, at that time, it seemed quite complex and difficult to understand.


How does the agent know how to avoid obstacles?

The agent observes his own position and obstacle position. Like if I was playing this game I would see my player position and obstacle position. Then the agent made the decision and performs the action. Like we use arrow keys to move.


Here's the process: Think of the agent's actions like a curious child in a new game, experimenting with buttons and discovering outcomes. These actions, ranging from -1 to 1, affect the agent's x-axis position. Passing through goals, such as navigating obstacles, earns the agent rewards. Just as a child seeks rewards for good performance, the agent learns to repeat these actions for more rewards. On the flip side, hitting obstacles leads to penalties, teaching the agent to avoid them. Over time, similar to a child learning to walk by trial and error, the agent learns. We can apply this learned behavior in games, enabling the agent to engage with players like us.


I am impressed by the ability to learn a variety of skills through in-game development, including designing, machine learning, project management, etc. This was one of the reasons why I began my journey in game development.


Video Link:

https://youtu.be/VfXCLUXcDEM


If you want to learn more, here are some helpful links:

https://youtu.be/RANRz9oyzko

https://unity.com/products/machine-learning-agents


If you have any questions or want to know more information, feel free to leave a comment below. Additionally, if there is something I may have overlooked, please let me know in the comments.


Follow me for more, as I share my game development journey.


#unity #gamedevelopment #ai #machinelearning #agent

 

Comments

Popular Posts