It is currently 27 Apr 2024, 06:28
   
Text Size

Question about mana abilities with cost

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Question about mana abilities with cost

Postby excessum » 15 Sep 2014, 03:50

I noticed that ComputerUtilMana.getAIPlayableMana() explicitly excludes abilities that have a mana cost. With the latest revision, the AI appears to be capable of automatically computing and using some of these abilities so is this restriction still necessary?

Working examples:
Forest;Unknown Shores -> cast Soldier of the Pantheon
Mystic Gate;Island -> cast Azorius Charm
Mystic Gate;Island;Plains -> cast Azorius Charm (ignores Mystic Gate since it is a two colour source and is ranked last)

Buggy:
Mystic Gate;Island -> cast Frostburn Weird (correctly taps for UU but still requests the user to select U from mana pool)

By adding checks for the net mana generated, getAvailableMana() should be able to rank them appropriately so that simple filters like Unknown Shores are ranked behind fixers like Azorius Signet.
excessum
 
Posts: 177
Joined: 21 Oct 2013, 02:30
Has thanked: 0 time
Been thanked: 19 times

Re: Question about mana abilities with cost

Postby Sloth » 16 Sep 2014, 12:40

excessum wrote:I noticed that ComputerUtilMana.getAIPlayableMana() explicitly excludes abilities that have a mana cost. With the latest revision, the AI appears to be capable of automatically computing and using some of these abilities so is this restriction still necessary?
The AI always tried to cast spells without being able to pay the mana in the past, but we can test whether it works now.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Question about mana abilities with cost

Postby excessum » 17 Sep 2014, 12:53

Sloth wrote:The AI always tried to cast spells without being able to pay the mana in the past, but we can test whether it works now.
I think this can be safely ignored at this point. The auto payment only works in the cases where the ability payment can be made at that specific point within the "while (!cost.isPaid())" loop. Trying to make canPayManaCost() aware of abilities used in such payments only led to problems with "undo" returning too little/much mana and/or failing to untap lands properly.
excessum
 
Posts: 177
Joined: 21 Oct 2013, 02:30
Has thanked: 0 time
Been thanked: 19 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 86 guests


Who is online

In total there are 86 users online :: 0 registered, 0 hidden and 86 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 86 guests

Login Form