Developer Daniel Shumway has created an AI program which is capable of learning how to play Game Boy and Game Boy Color games. Named Piglet — but previously developed under the moniker WideEyes — it's a machine-learning AI built with Lua and designed to interact with the Visual Boy Advance emulator.
Inspired by the NES-playing AI PlayFun and the Twitch Plays Pokémon project, Piglet is quite convincing in how it learns. You can view a demo of precursor WideEyes — with comments from Shumway — below:
Shumway admits that the algorithm is "stupid", but outlines why it's so convincing:
This approach allows WideEyes to rapidly change its strategy whenever necessary. If WideEyes runs into a wall, it almost instantly changes its strategy. There's a constant high variance in what buttons WideEyes presses. I mention this a couple of times above, but a few of WideEyes algorithms are purposefully broken in ways that increase entropy over time. This introduces a natural decay into WideEye's memory that works pretty well to keep information changing in interesting ways. Because of this WideEyes is almost constantly forming patterns of some sort, which fits that random data into something that looks more deliberate than it is. WideEyes keeps track of its progress and doesn't reset back to the beginning of a level when it dies (it can savestate anywhere and correct its mistakes).
If that all sounds a bit too technical, Shumway has summed it up in a rather easier-to-understand fashion:
Imagine you're blindfolded, and handed a controller, and told to play a game. Every time you press a button something happens in the game, but you can't see that happening. Your only interface with the game is that you have a friend sitting next to you - and whenever something on the screen changes, he shouts in your ear, "Hey, something changed!" It works surprisingly well.
You can watch Piglet in action below, and this gives an insight into how the program learns to play games. It also makes us grateful that Shumway has tasked his AI with quite a harmless task — we just worry about when he decides to switch to "global domination mode" and it quickly decides that humans are its biggest threat.