spPumpTgt - Targeted Pump Spells
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: spPumpTgt - Targeted Pump Spells
by Chris H. » 21 Aug 2009, 01:48
I happened to stumble across several spells that we missed earlier:
I will send this data and the cards pics to Dennis via pm.
- Code: Select all
Infiltrate
U
Instant
Target creature is unblockable this turn.
spPumpTgt:Unblockable
Touch of Invisibility
3 U
Sorcery
Target creature is unblockable this turn. Draw a card.
Draw a card.
spPumpTgt:Unblockable
Cantrip
Trailblazer
2 G G
Instant
Target creature is unblockable this turn.
spPumpTgt:Unblockable
I will send this data and the cards pics to Dennis via pm.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: spPumpTgt - Targeted Pump Spells
by Chris H. » 04 Sep 2009, 14:39
I think that the computer will use the spPumpTgt: spells on flying creatures.Chris H. wrote:On a related note, I tested a deck with Giant Growth and the computer will not cast it on it's own Kird Ape.
It appears that the spPumpTgt keyword creates a dead card that the computer can not play, whether or not the Power buff/boost is negative or positive.
I was having problems getting the computer to cast these spells. I tried several test decks with non-flying creatures and these spPumpTgt: spells appeared to be a dead card. I looked at the source code and it dawned on me that the computer might be looking for a target with flying.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: spPumpTgt - Targeted Pump Spells
by Rob Cashwalker » 04 Sep 2009, 16:10
First thing it does is get a list of attackers then sorts that list by flying creatures first. It filters the list for a few criteria, then chooses the first creature that survived all iterations.
This AI has two things working against it:
First, the list returned by getAttackers may not necessarily always return any of the creatures in play, it evaluates board position, ignoring the "hand position" of having Giant Growth in hand or as an ability available on another permanent on the field. This I think is the more important areas of the AI that needs to be tweaked - humans base the attack decision on the knowledge of having a pump effect; the computer is reversed - it bases the pump decision on the knowledge of attacking.
Second, the AI code only tells the computer that the spell is OK to play, there are likely a number of other spells or abilities that the computer has available and all responded "Yes" to canPlayAI(?).
I didn't change the AI very much from the original model pump spell. There's certainly room for improvement, but I have a feeling the underlying cause is not in this layer.
This AI has two things working against it:
First, the list returned by getAttackers may not necessarily always return any of the creatures in play, it evaluates board position, ignoring the "hand position" of having Giant Growth in hand or as an ability available on another permanent on the field. This I think is the more important areas of the AI that needs to be tweaked - humans base the attack decision on the knowledge of having a pump effect; the computer is reversed - it bases the pump decision on the knowledge of attacking.
Second, the AI code only tells the computer that the spell is OK to play, there are likely a number of other spells or abilities that the computer has available and all responded "Yes" to canPlayAI(?).
I didn't change the AI very much from the original model pump spell. There's certainly room for improvement, but I have a feeling the underlying cause is not in this layer.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: spPumpTgt - Targeted Pump Spells
by Chris H. » 05 Sep 2009, 00:02
Hmm, I was able to get the computer to use a Wildsize but not a Giant Growth.
I checked the CardFactory.java and cards.txt files. It turns out that Wildsize is still hard-coded and also contains the spPumpTgt keyword.
None of the other cards with the spPumpTgt keyword could be found in the CardFactory.java file.
I checked the CardFactory.java and cards.txt files. It turns out that Wildsize is still hard-coded and also contains the spPumpTgt keyword.
None of the other cards with the spPumpTgt keyword could be found in the CardFactory.java file.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: spPumpTgt - Targeted Pump Spells
by mtgrares » 10 Sep 2009, 19:17
To answer your question "What if many cards return Yes to canPlayAI()?" As I remember it, if the AI has 4 lands it will try to play a 4 mana creature card and if it can't, it tries to play a 4 mana spell card, and then a 3 mana creature card etc... To see the AI for yourself checkout ComputerAI_General.java which calls ComputerUtil.java.Second, the AI code only tells the computer that the spell is OK to play, there are likely a number of other spells or abilities that the computer has available and all responded "Yes" to canPlayAI(?).
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
20 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 80 guests