Neural network and Genetic Algorithms in Unity3D

preview_player
Показать описание
Survival of the Fittest is a 3D racing game. It takes place on an endless track filled with obstacles. This game will be played by: a scripted AI, a player, and a learning neural network. When the game begins, every player starts positioned alongside of each other. They keep going forward avoiding obstacles in their way, they can collect yellow balls for extra points. Last player to crash wins.

The world takes a place on a never-ending track which sides are blocked off by walls leaving the only option to go forward. The world is made up of procedurally generated regions which contain obstacles (walls) and yellow balls, each of these are randomly generated. Some of the walls will be pre-set, but activated randomly.

Neural Network Setup:
• 7 inputs
o Ray cast in front of the AI.
o Ray cast 90 degrees on each side of the front.
o Ray cast 45 degrees on each side of the front.
o Ray cast 7.5 degrees on each side of the front.
o Each ray cast returns a reversed distance of an object it has hit.
• 2 outputs
o Steer Left.
o Steer Right.
o Each output (between 0-1) multiplied by Maximum Rotation.

Genetic Algorithm:
• Mutation rate 0.1.
• Crossover rate 1.
• Perpetuation is set to 0.3.
• Uses Elitism selection function.
• Keeps 2 alphas from previous generation.
• Picks the best 3 genomes used for mating.
• Total population is 11.

Github link:

Research Documents Link:
Рекомендации по теме
Комментарии
Автор

I have played around with other Unity AI examples and this one works really well. I do seem to be having problems with null references when AudioManager tries to play sounds. But I am commenting that code out for now. Thanks for all your hard work !!!!

stevecoxiscool
Автор

thank you for sharing this code, can i ask if you where to make the network more complicated does that mean adding more inputs or ?

Mentalarray
Автор

im sorry, i am new at unity 3D, i have a problem when i play your scene, it says that the compiler error because of this "Failed to get socket connection from UnityShaderCompiler.exe shader compiler! C:/Program
UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object, Object[], String)", can i please get an answer for this problem so i can run your game in my laptop?

ariyandikesuma
Автор

awesome, can i use this as my refrence for my essay ? if thats ok, it'll be so much help for me

ariyandikesuma
Автор

whats going on, Im not turning the volume up to stupid levels to find out :/

st_ProCactus
join shbcf.ru