Artificial intelligence project builds A Puzzling Present

AI system called ANGELINA is back with a very playable Android/PC game.

Back in March, Ars wrote about PhD student Michael Cook and his artificial intelligence machine called Angelina. Angelina was special because she was creating games from scratch with little help from her human counterparts. By dividing the concept of a computer game up into three defined “species,” or sub-tasks—maps, layouts, and rulesets—Cook and his compatriots at Imperial College in London helped their system auto-generate some simple platformer games.

On Friday, however, Cook released a game called A Puzzling Present which shows off the much of the hard work Cook's put into Angelina (a tail-recursive acronym for "A Novel Game-Evolving Labrat I've Named ANGELINA"). Instead of a simple platformer with maps and obstacles, the latest games by Angelina now include new mechanics for the player (in this particular seasonal game, the character is Santa Claus) at each level. For example, in World 1 of A Puzzling Present, hitting x (or a touch-screen b key in the mobile version) gives Santa an anti-gravity power that sends him to the top of the screen and hitting x again sends him back down. In the second World, hitting x gives Santa an elasticity function, which causes him to bounce ever faster against the surroundings above and below him. These mechanics, Cook says, were created artificially by ANGELINA for this particular game as part of a new system he developed called Mechanic Miner.

Mining for fun

On his blog, Cook laid out how Mechanic Miner works: start with a level you can't normally solve (because of a randomly-generated and damningly high wall, for example), invent a new mechanic that could help solve this level (like the ability to jump very high, or bounce off walls), and then test the level for playability.

Cook says he hadn't planned on building Mechanic Miner back in March. But creating the system became possible when he discovered flixel-android—a Java port of a game library called Flixel—which allows Angelina to bridge the gap between Java (which Angelina understands) and ActionScript (which platform games are written in). “It was really a way of letting ANGELINA make changes to a game directly, and then be able to see what effect those changes had, by simulating the game,” Cook told Ars in an e-mail.

The result is something a little closer to a game a human might be interested in investing an entire train commute in playing. Whereas before Angelina generated rulesets that defined the way the players obstacles appear in the games, Cook says his Miner is trying to replace that parameter with “something more flexible and much more interesting.”

Polling the humans

If you play A Puzzling Present on a PC or on your Android phone (available for free from the Google Play store!) you'll also notice that after each level a screen comes up asking how enjoyable and how difficult the level was. Cook said in March Angelina had trouble assessing level difficultly. While he experimented with having her “interact” with Twitter, A Puzzling Present is partly a way of collecting feedback that Cook can use to hone Angelina's knowledge of difficulty in a level. “Mechanic Miner lets ANGELINA simulate games in much finer detail,” Cook said. “It can now model things like the player's reaction time, for instance.”

This audience polling may be key to the evolution of Angelina. Cook explained:

“There's no human involved between finding a mechanic and designing levels for it—once it's found a potential game mechanic, it can start making levels right away. So you have to think carefully about what kind of level designer the system should have. Should it make long levels? Levels that need quick reaction time? Lots of thinking? Jumps? No jumps?

“In A Puzzling Present, all the mechanics use the same level designer. But I'm hoping the data from the game will show that mechanics can be very different and need very different level designers to take advantage of them. So it's still early days for ANGELINA's difficulty assessment...In the final game, the worlds and levels are randomized, so we can interpret the data better and with less bias. So you won't know what's coming next—but it'll help ANGELINA know better for the future!”

Humans and game bots, working together

After playing the finished product of A Puzzling Present on my Android phone for 20 or 30 minutes (the levels go by very quickly), I was quite surprised at how much more the addition of a single game mechanic in each world held my interest. The earlier platformers created by Angelina were cute and novel, but a little too uniform. So does this mean the end is nigh for game developers, especially those who work on quick and easy mobile phone games? Cook, at least, is of the opinion that nothing could be further from the truth.

“Actually I think Mechanic Miner is the first bit of research from the ANGELINA project that could really benefit the mainstream industry, rather than threaten it! If this technology was built into tools given to designers... it could suggest new game concepts or alterations to levels...[Wi]th Mechanic Miner, ANGELINA is more independent of humans than it has been previously. It's suggested mechanics to me that I wouldn't have thought of. It's found exploits in my code and used them to design levels I couldn't have dreamed of. That's fascinating stuff, and if we can create software that can actually suggest things that are novel to humans, then that's really exciting.”

Cook also reminded us that Angelina still doesn't create themes, art, or the music that polish off the games she creates. Humans are responsible for the graphics and the adorable crunch of the snow under Santa's feet as you walk around in A Puzzling Present.

And for longer games, with narrative arc, Cook says humanity is an irreplaceable factor in creating a game that connects with people. “We'll always enjoy ANGELINA's work, but when I read things like Edmund McMillen's postmortem of The Binding of Isaac in which he talks about his relationship with religion and how it affected his work—that's something uniquely important. I feel like the game is a bit richer because it had that person's input into it. Even if I can't really feel the difference, it's all wrapped up in the culture surrounding that particular game.”

Such a fun little game, could you just have Angelina stop assuming we all have transhuman reflexes. Spawning over murderous mistletoe and having to dodge it isn't all that pleasant. But, a wonderfully well made game; much better than anything I could accomplish.

Did world one. The levels were more than a bit clunky, and two of them kill you before you can even react (they were hard to survive at the beginning even during restarts). Almost all the puzzles were conceptually super simple.

Of course this is still not unimpressive for AI generated stuff, but it's not going to put even mediocre Newgrounds flash developers out of business. When you play it, enjoy it for the stay of what it may be rather than expecting something super.

Such a fun little game, could you just have Angelina stop assuming we all have transhuman reflexes. Spawning over murderous mistletoe and having to dodge it isn't all that pleasant. But, a wonderfully well made game; much better than anything I could accomplish.

There's a little bug in the generation at the moment that really irritated me - I noticed it late and decided not to fix it to get feedback. The issue was that ANGELINA understands reflexes, but at the start of a simulation gets a 'free move', so to speak - it makes an action with zero reaction time, as if humans would be able to instantly notice when the game begins.

I'm getting mixed responses - some people like it! But overall I think I'll put in a fix for it in future.

Just beat it. World three is the best, you should have made it world one because it is the most conventional and easy to grasp and the levels are the most enjoyable. It makes it easier for people to jump in and enjoy the concept.

The bounce mechanic for world two is awful to control with sloppy android touch controls. It convinced me that this isn't a friendly AI, but an evil one that will send a robot back in time to kill my mother. Way hard levels and messy mechanic.

Where is the AI? Way over the top headline for what is actually happening.

The game and levels were AI generated, which is exactly what the headline says.

Apparently I wasn't clear, the thing generating the levels is not AI. It's a procedural learning system. There is a huge difference.

You are aware that procedural learning is a form of AI. AI is a very broad field, covering many different types and approaches to computer intelligence. Something doesn't need to pass the Turing test to be called AI.

It's pretty bad, but the science behind it is interesting. I got some jittery graphics, which I blame on my phone (or rather the ROM -- it's a Gingerbread-only phone, running a Jelly Bean ROM using the Froyo kernel; this works surprisingly well for most things but gaming isn't recommended) but also the touch controls were very unresponsive. A challenging game is one thing, but when it's challenging not your skill but your ability to interact with it, then it becomes a problem for me.

Very interesting concept. I played it on my PC and found the second world's mechanic (the bouncy one) the most novel and engaging.

My worry is that humans can be almost perversely clever both in terms of designing and playing levels for games like this, and it's going to be a daunting task to produce a simulator that can come even close to testing all the tricky ways somebody could either design or play a level.

I found that for each mechanic, ANGELINA was able to generate roughly 2-3 novel, interesting levels. A human designer, when presented with the same mechanics, could easily generate dozens or even hundreds - that's still a long way to go before the AI is producing compelling levels. Either ANGELINA needs to get a whole lot smarter at generating the levels, or needs a lot more work deciding when it's created a distinct level that plays differently than previously created ones (many of the gravity-flipping levels simply involve walking around the outside of the map, for example). This would allow it to try many more permutations without burdening the creator with the equally-daunting task of hand-testing hundreds of bland, repetitive levels to find the interesting ones. I'm not sure how the current code generates and rejects levels, but assuming the program can identify distinct levels that require unique solve patterns it could conceivably generate millions of levels to find 10 good ones without much trouble.

I actually feel that evolving new mechanics, as is done here, is perhaps the method where applying an AI has more mileage. It seems to me that a computer would have an easier time coming up with novel abilities/powers that a human wouldn't have thought of, which a human designer could then use to build interesting levels.

Where is the AI? Way over the top headline for what is actually happening.

The game and levels were AI generated, which is exactly what the headline says.

Apparently I wasn't clear, the thing generating the levels is not AI. It's a procedural learning system. There is a huge difference.

It's a multiobjective computational evolution system, as part of a larger evolutionary system (backed by other techniques here or there). It's certainly under the purview of AI, unless you feel that the 'general intelligence' stuff is the only "real" AI (which some do) - I certainly can't be of use if that's the case.

In particular, ANGELINA is part of research into computational creativity - using AI techniques to further human creativity, and investigate the design of systems that can be creative without human assistance.

It's pretty bad, but the science behind it is interesting. I got some jittery graphics, which I blame on my phone (or rather the ROM -- it's a Gingerbread-only phone, running a Jelly Bean ROM using the Froyo kernel; this works surprisingly well for most things but gaming isn't recommended) but also the touch controls were very unresponsive. A challenging game is one thing, but when it's challenging not your skill but your ability to interact with it, then it becomes a problem for me.

Yeah, I hold my hand up there. This is my first time working with Android - don't blame the designer for my mistakes!

Just beat it. World three is the best, you should have made it world one because it is the most conventional and easy to grasp and the levels are the most enjoyable. It makes it easier for people to jump in and enjoy the concept.

Hey! The worlds are randomised so I'm not sure which one you mean (I'm going to guess gravity-flipping though - it's my favourite).

Quote:

The bounce mechanic for world two is awful to control with sloppy android touch controls. It convinced me that this isn't a friendly AI, but an evil one that will send a robot back in time to kill my mother. Way hard levels and messy mechanic.

Bounce is a funny one. I was very pleased the system found it (it's rather unusual) but it shows a weakness in the way it evaluates mechanics. I knew that it would only find 'functional' mechanics rather than fun/interesting ones - bouncing is a good example of that weakness coming through.

Very interesting concept. I played it on my PC and found the second world's mechanic (the bouncy one) the most novel and engaging.

Excellent! I like that everyone has different opinions - it shows how hard it is for a human to find a 'best' mechanic, let alone an AI!

Quote:

My worry is that humans can be almost perversely clever both in terms of designing and playing levels for games like this, and it's going to be a daunting task to produce a simulator that can come even close to testing all the tricky ways somebody could either design or play a level.

I agree. One of the reasons the levels are so small is because I tried to get ANGELINA to search as many potential pathways as possible, to really try and flush out all possible routes through the level. It mostly works - there are two levels you can finish without using the mechanic I think (one is my fault, the other is ANGELINA's).

Quote:

I'm not sure how the current code generates and rejects levels, but assuming the program can identify distinct levels that require unique solve patterns it could conceivably generate millions of levels to find 10 good ones without much trouble.

Distinctness of solution is something I've been thinking about lately, yes. The holy grail here might be to detect playing styles among humans, and match them to levels - there's some great work at ITU Copenhagen on this sort of topic, actually.

Quote:

I actually feel that evolving new mechanics, as is done here, is perhaps the method where applying an AI has more mileage. It seems to me that a computer would have an easier time coming up with novel abilities/powers that a human wouldn't have thought of, which a human designer could then use to build interesting levels.

Yeah, I think I agree. The interesting thing - and the reason I bundled MM with a level designer - is that the simulation-based nature of the system means that it can 'understand' the mechanic and build levels that use it without being told anything about it beforehand. It's really powerful, even if the mechanics are simple right now. I hope to present a more impressive proof of this in 2013!

It's a good game. Several levels were silly (3/4s of the level inaccessible, with Santa starting almost beside the box). I lucked out, though, and had one complex, and dare I say "well-designed", level that tempted me to try a very frustrating bouncy-jump through the killhedge. I finally gave up and realized the long way around didn't even require the jumping mechanic I had been gifted with.

Spoiler: show

Are the plans to use this AI technique to brute-force good level design (or interesting mechanics) by crowdsourcing the results, then hand-picking quality levels for a release product?

Also, is it possible to (for instance) force Santa in the bottom-right corner and the box in the top-left, and ask the AI to make possible levels? That strikes me as a good way to cheat some interesting results out of the system.

Just beat it. World three is the best, you should have made it world one because it is the most conventional and easy to grasp and the levels are the most enjoyable. It makes it easier for people to jump in and enjoy the concept.

Hey! The worlds are randomised so I'm not sure which one you mean (I'm going to guess gravity-flipping though - it's my favourite).

Quote:

The bounce mechanic for world two is awful to control with sloppy android touch controls. It convinced me that this isn't a friendly AI, but an evil one that will send a robot back in time to kill my mother. Way hard levels and messy mechanic.

Bounce is a funny one. I was very pleased the system found it (it's rather unusual) but it shows a weakness in the way it evaluates mechanics. I knew that it would only find 'functional' mechanics rather than fun/interesting ones - bouncing is a good example of that weakness coming through.

It's all good - it just means more work to do!

Oh, my world three was the one that lets you toggle a super high jump. It was the most approachable and the levels were the most conventional (and had a larger variety of paths). I think it's just the least frustrating way to bring a new user into what's going on.

The bounce is a clever idea (fun/interesting), but it was just very difficult to control and a few of the levels I beat without even ever activating it.

And I will ditto the fellow earlier who pointed out that a lot of the gravity flip levels had pretty much the same solution of mostly moving around the edge of the level to avoid the obstacles and sliding in easy.

Really interesting stuff. I'll be interested to see what happens in the future.

Look, that's only if we get the funding for the titanium-encased robot research. To be honest, I think it'll be 2026 at the earliest, the EU's really been cutting its budget for murderous-synthetic-life research.

It's a good game. Several levels were silly (3/4s of the level inaccessible, with Santa starting almost beside the box). I lucked out, though, and had one complex, and dare I say "well-designed", level that tempted me to try a very frustrating bouncy-jump through the killhedge. I finally gave up and realized the long way around didn't even require the jumping mechanic I had been gifted with.

Yeah that's one of the no-power solutions. That's actually my fault. ANGELINA had an earlier build of the platform game. In the Android release version I made the hitboxes on the holly smaller, so you can hurdle it. My fault, not the AI's! I feel bad...

Quote:

Are the plans to use this AI technique to brute-force good level design (or interesting mechanics) by crowdsourcing the results, then hand-picking quality levels for a release product?

It's an option I've looked into. ANGELINA has a Twitter feed - @angelinasgames - but crowdsourcing is tricky. We may look to automated playtesting where ANGELINA sends out builds automatically to a handpicked group of humans. But overall I want ANGELINA to be independent, so that's my primary focus.

Quote:

Also, is it possible to (for instance) force Santa in the bottom-right corner and the box in the top-left, and ask the AI to make possible levels? That strikes me as a good way to cheat some interesting results out of the system.

It is. It's something I'll be using in 2013 to chain levels together and make larger games out of it (i.e. put the exit in the top right on one level, and the start in the top left of the next level, and glue them together side by side). Very insightful of you!

I just played through all three worlds. It's definitely interesting, though I'm used to much harder platformers like VVVVVV (one of my favorites) and Super Meat Boy so all of the levels were trivial (on a PC at least, it might be harder with touchscreen controls). I agree with the commenter above who said that the new mechanics were more interesting than the levels themselves. I could see someone making a really neat little platformer with the bouncing mechanic. This does look like an interesting way to come up with new ideas for humans rather than taking over all of game design.

How is this anything "new" more than a slightly more advanced version of the numerous random dungeon games since 1980's Rouge? Even with the side-scrolling element, I remember seeing randomly generated scrolling level game stuff from some Iowa State comsci students back in the early 1990s.

How is this anything "new" more than a slightly more advanced version of the numerous random dungeon games since 1980's Rouge? Even with the side-scrolling element, I remember seeing randomly generated scrolling level game stuff from some Iowa State comsci students back in the early 1990s.

Hey there!

First you might enjoy the full project site: www.gamesbyangelina.org. This is a small part of a larger project that is looking at automated, autonomous game design.

Second: focus more on the mechanics than the levels. ANGELINA is inspecting, altering and testing game code to discover new ways for a player to interact and solve problems. It's more independent than our previous attempts. The level designer can design levels tha use these mechanics, even though it has never seen that particular mechanic before!

Where is the AI? Way over the top headline for what is actually happening.

The game and levels were AI generated, which is exactly what the headline says.

Apparently I wasn't clear, the thing generating the levels is not AI. It's a procedural learning system. There is a huge difference.

You are aware that procedural learning is a form of AI. AI is a very broad field, covering many different types and approaches to computer intelligence. Something doesn't need to pass the Turing test to be called AI.

No, AI is the set of things that we haven't figured out how to get computers to do yet. Everything else is a search algorithm. That's why true AI will never happen: as we figure it out, no one wants to call it AI anymore.

When I hear a fellow developer say we should use "AI" to solve a particular problem, I mentally substitute "magic pixie dust" and behave accordingly. If, however, they suggest a particular approach, say simple hill climbing or even genetic programming, we can have a serious discussion.

Where is the AI? Way over the top headline for what is actually happening.

The game and levels were AI generated, which is exactly what the headline says.

Apparently I wasn't clear, the thing generating the levels is not AI. It's a procedural learning system. There is a huge difference.

You are aware that procedural learning is a form of AI. AI is a very broad field, covering many different types and approaches to computer intelligence. Something doesn't need to pass the Turing test to be called AI.

No, AI is the set of things that we haven't figured out how to get computers to do yet. Everything else is a search algorithm. That's why true AI will never happen: as we figure it out, no one wants to call it AI anymore.

When I hear a fellow developer say we should use "AI" to solve a particular problem, I mentally substitute "magic pixie dust" and behave accordingly. If, however, they suggest a particular approach, say simple hill climbing or even genetic programming, we can have a serious discussion.

That's because you chose to have a narrow definition of the word (acronym) "AI". Your definition is by no means universal. "AI" is a pretty common term in many university courses/research projects covering a far wider range of methods and goals.