KreuzKummelll / HeroKnight-ML

A 2D platform that uses MLAgents for AI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HeroKnight-ML

A 2D platform that uses MLAgents for AI

Idea:

The idea to start this training environment comes from Immersive Limit's platformer challenge. Immersive Limit

Process:

Using reference from Hummingbird ML Tutorial I turned the basic HeroKnight.cs script into a HeroKnightAgent.cs. Compare HeroKnight.cs with HeroKnightAgent.cs to see the few changes that had to take place.

Issues:

  1. The first issue I ran into during training was that after the agent moved left and right a few times, all of the sudden, the agent would be stuck jumping up and down and turning left and right, but not moving left-right. After considering the .config file as a culprit, I realized that the bug was coded into the roll animation. The HeroKnight.cs script is a MonoBehaviour and it is able to link to an animation event. In this case, the last frame of the roll animation would call a funciton in HeroKnight.cs to set m_rolling to false, which would then allow left-right movement to take place. Yet because HeroKnight.cs became HeroKnightAgent.cs and the MonoBehaviour became Agent, the animation event was unlinked, thus no longer called the said function to set m_rolling to false. To fix this I removed all notions of rolling for now.
  2. Training ... more info to come

Packages:

Hero Knight - Pixel Art

2D Pixel Item Asset Pack

Cinemachine 2.6.3 MLAgents 1.0.6 2D Tilemap Editor 1.0.0

About

A 2D platform that uses MLAgents for AI


Languages

Language:C# 99.3%Language:Python 0.4%Language:HLSL 0.1%Language:ShaderLab 0.1%Language:Objective-C++ 0.0%Language:C 0.0%