Teaching the AI to use mana abilities
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Teaching the AI to use mana abilities
by zerker2000 » 12 Oct 2009, 01:43
I remember receiving an AI mana pool idea, can someone who knows how the AI works tell me where a mana counting method should be put?
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: Teaching the AI to use mana abilities
by DennisBergkamp » 12 Oct 2009, 03:08
Ah, this is very funky code, it can be found in ComputerUtil.canPayCost() and also check out ComputerUtil.getAvailableMana().
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Teaching the AI to use mana abilities
by zerker2000 » 12 Oct 2009, 03:30
Well, all the mana code I've found so far is quite funky, if it was up to me I'd just store mana costs as strings in oracle format and have manaCost.addMana subtract colored, then split, then colorless mana from the string in that order(and for an AI that uses only basic land abilities, I'd first subtract all colorless mana I can, then all n choice mana in increasing order). Also, I just looked at the code and found a mistype I planted when going through it: ComputerUtil.getAvailableMana should use getBasicMana instead of getManaAbility, and CardUtil.isMana should be exiled(removed from source) along with all auras("if (!CardUtil.isMana(c)) return false;") attached to it.
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: Teaching the AI to use mana abilities
by DennisBergkamp » 12 Oct 2009, 06:06
Ok cool, I've just made these changes.
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 19 guests