Better Ai: Foreach training, reduced Eff on "levelingup" based on cards in hand/maxxed in 2nd main, added a selectAbility() call after lands are played and after all cards were searched if none were found to play. after much playtesting i found that if given the chance to find an ability BEFORE playing cards, Ai does dramatically better during a match, the same goes if its given a chance to find one after it looked for stuff to play.

with this change please try playing a few matchs against vanguards chosen and wraith feast, my 2 most favorate decks to fight now. youre in for a treat :)

keep in mind that even tho ive taught Ai Foreach in a somewhat crude manner it still does not understand how much mana it can gain from a foreach manaproducer, and this does not make it suddenly use dark ritual correctly. however this change was dramatic enough that i wanted it in for 14.1

this is also still under massive play testing, however no issues were found so far with it as it is presented here.
This commit is contained in:
omegablast2002@yahoo.com
2010-11-26 22:10:43 +00:00
parent 75345469ee
commit 3151dfd348
4 changed files with 82 additions and 10 deletions

View File

@@ -45,8 +45,10 @@ public:
class CmpAbilities { // compares Abilities efficiency
public:
bool operator()(AIAction * a1, AIAction * a2) const {
int e1 = a1->getEfficiency();
int e2 = a2->getEfficiency();
int e1 = 0;
e1 = a1->getEfficiency();
int e2 = 0;
e2 = a2->getEfficiency();
if (e1 == e2) return a1->id < a2->id;
return (e1 > e2);
}

View File

@@ -83,6 +83,8 @@ class MTGGameZone {
MTGCardInstance * findByName(string name);
int hasAbility(int ability); //returns 1 if one of the cards in the zone has the ability, 0 otherwise
int hasType(const char * value); //returns 1 if one of the cards in the zone has the type, 0 otherwise
int hasColor(int value); //returns 1 if one of the cards in the zone has the color, 0 otherwise
int hasX();
void setOwner(Player * player);
MTGCardInstance * lastCardDrawn;
static MTGGameZone * stringToZone(string zoneName, MTGCardInstance * source, MTGCardInstance * target);