A simple genetic algorithm was used to produce sequences of gamepad inputs for fighting Air Man in the NES game Mega Man 2. Fitness of each candidate solution was measured as Mega Man's health minus Air Man's health -- negative fitness means Mega Man died, and positive fitness means Air Man died.
Generation 0 started with completely random inputs, with the best solution having a fitness of -8 (i.e., Air Man had 8 health left when he killed Mega Man). Generation 10 produced the first solution where Mega Man wins (fitness = 4); Generation 13 produced an improvement over it (fitness = 8).
This video shows the best solutions found across selected generations. Notice how they each look roughly similar, though later generations manage to deal more damage to Air Man more quickly.
Music: Air Man Ga Taosenai by Team Nekokan
All Comments