NOTE: FOR FASTER AI LEARNING, USE TURBO MODE!
AI LEARNS TO PLAY A PLATFORM GAME ================================ ABOUT: This project demonstrates an AI’s ability to learn how to navigate a simple platform level as quickly as possible. There are three different levels that you can choose for the AI to try, and you may also choose to only see the best of the generation by moving the slider. Enjoy! ==== HOW IT WORKS: The type of AI I chose for this game is called evolutionary AI. Evolutionary AI is based off of natural organisms who adapt to their surroundings by evolving over time. On the first generation, all of the players are programmed with a random set of instructions to complete the level — comparable to an organism’s DNA. They are all very bad at playing, but the best ones are removed using a “fitness function.” In this game, the fitness is determined by three factors: - how far they got - how long it took them to get there - whether or not they fell before completing the level. From there, the AIs with the best fitnesses are kept, and the others are deleted (comparable to an organism surviving or dying). Then each of the ten algorithms that were kept create a copy of themselves (like an organism reproducing) and are given random differences (like an organism mutating). Finally, the process is repeated until the AI finds the optimal strategy! ========================= CREDITS: Thanks to pexels.com for the thumbnail image. All art (if you would call it that, lol) and code are by me, but I heard about the concept elsewhere.