Jonathan Byrne

Stuff and things about Jonathan Byrne

0
August 21, 2012

Game A.I.

This was a bit of fun using evolutionary algorithms to evolve some game AI. Toribash is a turn based fighting game where the user must specify the joint positions in order to complete a move. There are no predefined attacks or defenses, the user must create them. As all the limb positions can be represented as a list of integer values this made it a good application for a genetic algorithm:



Initially the algorithm worked out that going for the head awarded the most points.



This progressed to full decapitations as soon as the algorithm built up some momentum.



The algorithm focused on the midriff more when using the sword as it got more points for dismemberment:



Once this approach had been optimised further it led to maximum dismemberment:



If you can get it to do one move then why not multiple moves? Here we can see an evolved combo move. The algorithm tended to go for a large primary hit and then get in one or two sly digs afterwards.



This is by far my favorite combo, the algorithm spends the first two moves positioning itself correctly for the killer blow. They say delayed gratification is one of the first hallmarks intelligence and academic achievement, so hopefully this is a good sign for this approach 🙂