It is currently 11 Sep 2025, 20:47
   
Text Size

StaticEffectFactory

Post MTG Forge Related Programming Questions Here

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

Re: StaticEffectFactory

Postby jeffwadsworth » 11 Jul 2011, 01:55

Chris, AILogic$ Curse.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: StaticEffectFactory

Postby Chris H. » 11 Jul 2011, 02:04

jeffwadsworth wrote:Chris, AILogic$ Curse.
`
Thank you Jeff.
User avatar
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

Postby 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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticEffectFactory

Postby 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.
User avatar
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

Postby friarsol » 11 Jul 2011, 12:16

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.
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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticEffectFactory

Postby 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.
User avatar
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

Postby friarsol » 11 Jul 2011, 13:52

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.
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.)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticEffectFactory

Postby timmermac » 11 Jul 2011, 19:04

friarsol wrote:
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.
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.
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.
"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
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 times

Re: StaticEffectFactory

Postby jeffwadsworth » 11 Jul 2011, 19:26

timmermac wrote:
friarsol wrote:
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.
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.
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.
No doubt Sol will take that into account with the AI portion.

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

Postby friarsol » 11 Jul 2011, 19:28

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.
"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.

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

Postby 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.
User avatar
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

Postby Chris H. » 13 Jul 2011, 02:02

Sloth wrote:
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'm pretty sure all stPumpEnchanted keywords can be converted to continuous static effects already. :D
`
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
User avatar
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

Postby jeffwadsworth » 13 Jul 2011, 02:58

Chris H. wrote:
Sloth wrote:
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'm pretty sure all stPumpEnchanted keywords can be converted to continuous static effects already. :D
`
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, 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

Re: StaticEffectFactory

Postby friarsol » 13 Jul 2011, 03:13

jeffwadsworth 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.
Man look at Jeff, all the tough love and dedication really paid off :D
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticEffectFactory

Postby jeffwadsworth » 13 Jul 2011, 03:57

friarsol wrote:
jeffwadsworth 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.
Man look at Jeff, all the tough love and dedication really paid off :D
More like obsession...the good kind.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 32 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 32 users online :: 0 registered, 0 hidden and 32 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 32 guests

Login Form