Using Neural Networks in the Game Engine for Artificial Learning

Jean-Francois Gallant writes:

After getting the result I want with Molecular and waiting for a “mesher” be available in Blender , I’m starting to have fun (and try something new) with Neural Network and Genetic algorithm. All my curiosity coming from my brother that talk to me about learning machine algorithm. I found a popular tutorial about this on internet. So from that , I’m starting to code a python module with Cython. What I learn is it’s more difficult to find good parameters , right inputs to feed to the module and how to ” reward ” good behaviors then code the module itself. I get some difficulty at this time to understand all this the first time. I do a lot of try at each new type of simulation but when you start to get result it’s very impressive. In all videos , all “players” learn by itself. No pre-programming behaviors. For example: in the pole balancing video , each players are rewarded on how long the pole stay straight and how far it’s stay from the border. In p acman video , how many yellow point they catch and how far they stay away from ghost. For quadruped and biped video it’s about how far they can go without the body touch the ground.

The goal of this is when you get the result you want , you are be able to save the trained network in a file and re-use it where you want (game) and not to have to training it again each time. For now saving and loading network in a file function is not avalaible ( but can be coded on python side ).

Here is a couple of link about my test about this.

Links

Video of biped try to walk

Video of quadruped try to walk

Video of carts and pole balancing

Video of pacmans and ghosts (co-evolution where the progress of one help to the other to progress further )

Video of tanks try to catch points

Advertisement