AI Work/Combat Prediction
As part of my AI improvement work I'm now allowing the AI to activate spells/abilities during other phases. The very early work has quietly slipped into the SVN and you can now see the AI activating Tims (Prodigal Sorcerer) at the End of the Human's turn instead of during their main phase, at least when pinging players is concerned.
The new added responsiveness is pretty cool so far. I've already caught myself about to attack when the AI decides to Shatter an artifact during my main phase that I was going to use in combat.
The next thing I wanted to do was rewrite the Regeneration AI, since right now it "guesses" to regenerate things, and it would be much better to be responsive.
This is mostly for Sloth since I know he's worked the most in combat recently, but if anyone else happens to know feel free to chime in. So does anyone know if there is some type of combat destruction function right now?
Ideally, I would pass in a combatant. It would take creatures attacking/blocking it, plus a few other keywords into consideration (deathtouch, wither/infect, etc) and return true or false based on whether or not it would be destroyed. If it gets its toughness reduced to 0, that would actually return false, since that isn't destruction. But if it gets hit by deathtouch or lethal damage, then it would return true.
For blockers it might be a bit trickier because of Issue 77 (http://code.google.com/p/cardforge/issues/detail?id=77). Since we're really supposed to know the order damage is dealt to blockers, if we knew that information deciding if something would be destroyed would be much easier. Since we don't, we'd have to assume the creature we're checking is the first. Anyway, I'm rambling. If anyone has any suggestions or requests while I'm tweaking AIs feel free to add it here.
The new added responsiveness is pretty cool so far. I've already caught myself about to attack when the AI decides to Shatter an artifact during my main phase that I was going to use in combat.
The next thing I wanted to do was rewrite the Regeneration AI, since right now it "guesses" to regenerate things, and it would be much better to be responsive.
This is mostly for Sloth since I know he's worked the most in combat recently, but if anyone else happens to know feel free to chime in. So does anyone know if there is some type of combat destruction function right now?
Ideally, I would pass in a combatant. It would take creatures attacking/blocking it, plus a few other keywords into consideration (deathtouch, wither/infect, etc) and return true or false based on whether or not it would be destroyed. If it gets its toughness reduced to 0, that would actually return false, since that isn't destruction. But if it gets hit by deathtouch or lethal damage, then it would return true.
For blockers it might be a bit trickier because of Issue 77 (http://code.google.com/p/cardforge/issues/detail?id=77). Since we're really supposed to know the order damage is dealt to blockers, if we knew that information deciding if something would be destroyed would be much easier. Since we don't, we'd have to assume the creature we're checking is the first. Anyway, I'm rambling. If anyone has any suggestions or requests while I'm tweaking AIs feel free to add it here.