My group is creating a breakout clone in Unity and training a neural network to play the game using software called ML-Agents. This is my first time using Unity and it’s been a blast! It really feels like a playground. I can only imagine how difficult programming a physics engine and then linking that with graphics is, but with unity it’s all abstracted away to the point that you can assign physics to sprites or models you’ve created in a graphical user interface. Luckily I took cs 450 last semester which has helped me tremendously in understanding the graphics sprites we’ve created, the use of the cameras for rendering our scene, 3d space, 2d and 3d vectors, and just generally interacting with software that partially abstracts code to a GUI. Although data structures and algorithms are very interesting to me, its been incredibly fun to use coding and software to create something more tangible with Unity and C#.
In my opinion one thing that could be changed to improve Unity is the sort of double actions you sometimes have to take in your code and the GUI. For instance, when I need to link a script or gameObject to another script, I declare a variable in the script but then have to go into the GUI and physically drag the script icon into a slot that appears in the script or gameObject component, otherwise a null reference error is produced. I think a better solution is to handle the pathing in code even if that means having to specify a more complicated path. This may be possible, but as far as I can tell what I described is a common accepted approach.
Our project uses AI directly in the form of a neural network. We use the ML-Agents API to train a neural network. It’s been a very interesting process. When you work with ML-Agents you don’t work directly with the ML algorithms, you essentially set observations in C# scripts and tweak “hyper parameters” until you get the desired result. This is a sometimes frustrating process that sometimes seems to be more of an art than a science, but ultimately leads you to think perhaps more deeply about the problem than you might otherwise.
Leave a Reply