Here it is! Some things to remember/notice:
- I have not implemented mana loss/burn at end of phases nor the “one land per turn” rule. This is why you see the AI playing 4 mountains on its first turn and piling up mana.
- Phases are not completely implemented. This is why the AI always plays everything at upkeep.
- The AI seems to always tap its lands whenever it can.. I have no direct explanation for this. That’s completely emergent behavior 😛
I also found a bug where the AI gets stuck into an infinite “thinking loop”. It happens mostly on the first upkeep of the game, about 50% of the games. Because many rules are not implemented, this is where the AI can play a lot of things and “think” the most.
Next stop: being able to write functional tests using the AI (i.e. pitching AIs against each other in automated tests). This will help me find problems and will guarantee that the AI keeps working as I do changes.
Edit: Ok, I’m kinda disappointed by the readability of the video in blog format… Go check the video on youtube if you want to read the text 🙂 Here’s a rundown of what’s happening:
- As the main player, I pass most of the time. I discard when needed.
- The computer immediately plays its 4 mountains and 3 shocks on the first opportunity it has (he’s an aggressive guy), leaving me with 14 life.
- For the rest of the game, the computer will play Shock when it draws it.