StaticEffectFactory
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
66 posts
• Page 3 of 5 • 1, 2, 3, 4, 5
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: StaticEffectFactory
by Chris H. » 11 Jul 2011, 02:04
`jeffwadsworth wrote:Chris, AILogic$ Curse.
Thank you Jeff.
-
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: StaticEffectFactory
by friarsol » 11 Jul 2011, 02:28
The AI is still pretty rudimentary as I got caught up in the Women's World Cup this morning/afternoon instead of adding more AI.
It looks like there's about 10 or so cards that give Power bonuses, but Toughness reductions. That might be enough to have it's own Logic. For now I'd say just use Pump for those, and I'll try to add a check to filter out creatures that would get killed by the Aura before I goto sleep tonight.
It looks like there's about 10 or so cards that give Power bonuses, but Toughness reductions. That might be enough to have it's own Logic. For now I'd say just use Pump for those, and I'll try to add a check to filter out creatures that would get killed by the Aura before I goto sleep tonight.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: StaticEffectFactory
by Chris H. » 11 Jul 2011, 11:53
`friarsol wrote:The AI is still pretty rudimentary as I got caught up in the Women's World Cup this morning/afternoon instead of adding more AI.
It looks like there's about 10 or so cards that give Power bonuses, but Toughness reductions. That might be enough to have it's own Logic. For now I'd say just use Pump for those, and I'll try to add a check to filter out creatures that would get killed by the Aura before I goto sleep tonight.
Thank you Sol. Yeah, these cards can be tricky for the computer. The aura keywords were not updated to handle this well.
It might be (?) worth the effort to have it's own logic. With creatures that are unblockable, trample, first/double strike, etc. It can get tricky.
-
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: StaticEffectFactory
by friarsol » 11 Jul 2011, 12:16
Well, at the very least it won't kill a Creature now when playing (I tested with Twisted Experiment ) The next piece of AI is not over-Enchanting cards. enPump did this by simply Filtering out any Cards that are being Enchanted. That's probably a fine way to get something in place, since this filter would happen after Enchant Magnets. I would like to flesh out the other Logics, and I (or someone else) can beef up specifics in Pump after.Chris H. wrote:Thank you Sol. Yeah, these cards can be tricky for the computer. The aura keywords were not updated to handle this well.
It might be (?) worth the effort to have it's own logic. With creatures that are unblockable, trample, first/double strike, etc. It can get tricky.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: StaticEffectFactory
by Chris H. » 11 Jul 2011, 13:39
`friarsol wrote:Well, at the very least it won't kill a Creature now when playing (I tested with Twisted Experiment ) The next piece of AI is not over-Enchanting cards. enPump did this by simply Filtering out any Cards that are being Enchanted. That's probably a fine way to get something in place, since this filter would happen after Enchant Magnets. I would like to flesh out the other Logics, and I (or someone else) can beef up specifics in Pump after.
I tested your code change and it is working. I did notice that the computer did not cast the Twisted Experiment as soon as it had a creature with a toughness greater than 1. The computer waited a few turns and then casted the aura. Not a complaint, just an observation.
-
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: StaticEffectFactory
by friarsol » 11 Jul 2011, 13:52
Just like all AFs there is a base canPlayAI() that determines if the SA will actually be cast. The Logic portion of the AF is simply to determine the best candidate, if any. We can tweak the numbers in canPlayAI() to cast Auras more aggressively (Like say be much more likely to play Auras before combat, and if the card returned doesn't have any suitable defenders for the next combat.)Chris H. wrote:I tested your code change and it is working. I did notice that the computer did not cast the Twisted Experiment as soon as it had a creature with a toughness greater than 1. The computer waited a few turns and then casted the aura. Not a complaint, just an observation.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: StaticEffectFactory
by timmermac » 11 Jul 2011, 19:04
The problem with setting any kind of limitation on the number enchantments an item will get is that there are cards that get power/toughness boosts for every enchantment that gets placed on them. Rabid Wombat is an example.friarsol wrote:Well, at the very least it won't kill a Creature now when playing (I tested with Twisted Experiment ) The next piece of AI is not over-Enchanting cards. enPump did this by simply Filtering out any Cards that are being Enchanted. That's probably a fine way to get something in place, since this filter would happen after Enchant Magnets. I would like to flesh out the other Logics, and I (or someone else) can beef up specifics in Pump after.Chris H. wrote:Thank you Sol. Yeah, these cards can be tricky for the computer. The aura keywords were not updated to handle this well.
It might be (?) worth the effort to have it's own logic. With creatures that are unblockable, trample, first/double strike, etc. It can get tricky.
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
Re: StaticEffectFactory
by jeffwadsworth » 11 Jul 2011, 19:26
No doubt Sol will take that into account with the AI portion.timmermac wrote:The problem with setting any kind of limitation on the number enchantments an item will get is that there are cards that get power/toughness boosts for every enchantment that gets placed on them. Rabid Wombat is an example.friarsol wrote:Well, at the very least it won't kill a Creature now when playing (I tested with Twisted Experiment ) The next piece of AI is not over-Enchanting cards. enPump did this by simply Filtering out any Cards that are being Enchanted. That's probably a fine way to get something in place, since this filter would happen after Enchant Magnets. I would like to flesh out the other Logics, and I (or someone else) can beef up specifics in Pump after.Chris H. wrote:Thank you Sol. Yeah, these cards can be tricky for the computer. The aura keywords were not updated to handle this well.
It might be (?) worth the effort to have it's own logic. With creatures that are unblockable, trample, first/double strike, etc. It can get tricky.
The card Training Grounds and Power Artifact are other ones to take into account for this AF.
Last edited by jeffwadsworth on 11 Jul 2011, 19:45, edited 1 time in total.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: StaticEffectFactory
by friarsol » 11 Jul 2011, 19:28
"That's probably a fine way to get something in place, since this filter would happen after Enchant Magnets." Rabid Wombat is one of those "Enchant Magnets" I referenced. If an Enchant Magnet is available one is used.timmermac wrote:The problem with setting any kind of limitation on the number enchantments an item will get is that there are cards that get power/toughness boosts for every enchantment that gets placed on them. Rabid Wombat is an example.
Currently enPump has this exact same restriction in place, so it wouldn't have any functional difference as the current state of Auras.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: StaticEffectFactory
by Chris H. » 11 Jul 2011, 20:03
I put together the original Rabid Wombat test in enPump. It worked but needed a lot of refinement. The only thing that is still around is the term that I coined Aura/Enchant Magnet. 
At some point Sloth (I believe) created a SVar for cards that want to be enchanted.
We now have two variants, "SVar:EnchantMe:Multiple" and "SVar:EnchantMe:Once".
The SVar can be added to the scripts for those cards that need auras. Which in turn prevents us from having to go back and change the code every time a similar card is released.

At some point Sloth (I believe) created a SVar for cards that want to be enchanted.
We now have two variants, "SVar:EnchantMe:Multiple" and "SVar:EnchantMe:Once".
The SVar can be added to the scripts for those cards that need auras. Which in turn prevents us from having to go back and change the code every time a similar card is released.
-
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: StaticEffectFactory
by Chris H. » 13 Jul 2011, 02:02
`Sloth wrote:I'm pretty sure all stPumpEnchanted keywords can be converted to continuous static effects already.Chris H. wrote:It should be possible to replace the "K:enPump:0/0" keyword now and to replace the static keyword portion once the StaticAbility AF can handle this.
I have started on these auras. I was right about replacing the "K:enPump:0/0" keyword and the only question here is the auras with stPumpEnchanted. Many of them are simple enough to convert. Some of them may not be doable?
- Aboshan's Desire | Open
- Name:Aboshan's Desire
ManaCost:U
Types:Enchantment Aura
Text:no text
K:Enchant creature
K:enPump:Flying
K:stPumpEnchanted:Creature:0/0/Shroud:Threshold:Threshold - Enchanted creature has shroud as long as seven or more cards are in your graveyard. (It can't be the target of spells or abilities.)
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/aboshans_desire.jpg
SetInfo:ODY|Common|http://magiccards.info/scans/en/od/59.jpg
End
- Clout of the Dominus | Open
- Name:Clout of the Dominus
ManaCost:UR
Types:Enchantment Aura
Text:no text
K:Enchant creature
K:enPump:+0/+0
K:stPumpEnchanted:Creature.Blue:1/1/Shroud:No Condition:As long as enchanted creature is blue, it gets +1/+1 and has shroud. (It can't be the target of spells or abilities.)
K:stPumpEnchanted:Creature.Red:1/1/Haste:No Condition:As long as enchanted creature is red, it gets +1/+1 and has haste.
SVar:PlayMain1:TRUE
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/clout_of_the_dominus.jpg
SetInfo:EVE|Common|http://magiccards.info/scans/en/eve/99.jpg
End
-
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: StaticEffectFactory
by jeffwadsworth » 13 Jul 2011, 02:58
Chris, just do something likeChris H. wrote:`Sloth wrote:I'm pretty sure all stPumpEnchanted keywords can be converted to continuous static effects already.Chris H. wrote:It should be possible to replace the "K:enPump:0/0" keyword now and to replace the static keyword portion once the StaticAbility AF can handle this.
I have started on these auras. I was right about replacing the "K:enPump:0/0" keyword and the only question here is the auras with stPumpEnchanted. Many of them are simple enough to convert. Some of them may not be doable?
- Aboshan's Desire | Open
- Name:Aboshan's Desire
ManaCost:U
Types:Enchantment Aura
Text:no text
K:Enchant creature
K:enPump:Flying
K:stPumpEnchanted:Creature:0/0/Shroud:Threshold:Threshold - Enchanted creature has shroud as long as seven or more cards are in your graveyard. (It can't be the target of spells or abilities.)
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/aboshans_desire.jpg
SetInfo:ODY|Common|http://magiccards.info/scans/en/od/59.jpg
End
- Clout of the Dominus | Open
- Name:Clout of the Dominus
ManaCost:UR
Types:Enchantment Aura
Text:no text
K:Enchant creature
K:enPump:+0/+0
K:stPumpEnchanted:Creature.Blue:1/1/Shroud:No Condition:As long as enchanted creature is blue, it gets +1/+1 and has shroud. (It can't be the target of spells or abilities.)
K:stPumpEnchanted:Creature.Red:1/1/Haste:No Condition:As long as enchanted creature is red, it gets +1/+1 and has haste.
SVar:PlayMain1:TRUE
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/clout_of_the_dominus.jpg
SetInfo:EVE|Common|http://magiccards.info/scans/en/eve/99.jpg
End
S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Blue | AddPower$ 1 | AddToughness$ 1 | AddKeyword$ Shroud
and use
Threshold$ True for the other one.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: StaticEffectFactory
by friarsol » 13 Jul 2011, 03:13
Man look at Jeff, all the tough love and dedication really paid offjeffwadsworth wrote:Chris, just do something like
S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Blue | AddPower$ 1 | AddToughness$ 1 | AddKeyword$ Shroud
and use
Threshold$ True for the other one.

- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: StaticEffectFactory
by jeffwadsworth » 13 Jul 2011, 03:57
More like obsession...the good kind.friarsol wrote:Man look at Jeff, all the tough love and dedication really paid offjeffwadsworth wrote:Chris, just do something like
S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Blue | AddPower$ 1 | AddToughness$ 1 | AddKeyword$ Shroud
and use
Threshold$ True for the other one.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
66 posts
• Page 3 of 5 • 1, 2, 3, 4, 5
Who is online
Users browsing this forum: No registered users and 32 guests