MTG Forge does its best to figure out which creatures should attack but overall it does a pretty lousy job. The AI doesn’t even play spells or abilities during the combat phase, which should simplify the combat step. And the AI doesn’t to any planning, like it won’t attack into a bigger creature and then Shock it. With all of that said, determining what creatures should attack is still difficult.
In general the AI will attack with a creature if the creature cannot be blocked, like if the creature has flying or fear, or if the creature is the biggest on the board. The AI will also attack with creatures that can be “traded”, it will attack with a 2/2 if you have a 2/2. I’ve tried to randomize the attacking routine a little bit by not always attacking with all of the creatures, but that seems to just weaken the AI and make the games more of a landslide.
I’m playing around with a very simple attacking routine, such as the AI would attack with all of its creatures if it had the same number or more creatures in play. (If you had 2 creatures in play and the AI had 2, it would attack.)
That way the AI would at least attack more often and would be putting on the pressure even if some of the time it is completely stupid. I read an article awhile ago on magicthegathering.com that suggested that players in limited games should attack 95% of the time and I’m trying to apply that strategy to the AI.
The basic idea of attacking is to attack when it is beneficial, but defining “beneficial” is very hard. When I write the AI attack routine, I am defining “beneficial”.