Ai deck builders
Re: Ai deck builders
I think you missed out a ; on line 1854 of AIPlayerBaka.cpp for r4730.
Re: Ai deck builders
I'll fix that tonight, though Im sure the compiler automatically assumed it. I found the problem though, when I originally coded it, i made it possible to code holding multiple of the same. that was still in the works. hold(<2>dark rituals) states that the combo happens when you have 2 in your hand. anyways give it a try now.
Re: Ai deck builders
I think it might be necessary to FORCE the AI to follow any given combos 100% to prevent random silliness. By setting up repeated evil twin demo matches for the following, the AI will still randomly play Dark RItual to nothing or Dark Ritual to Bloodline Keeper. The second is still reasonable though annoying and the first is just crazy.
I would think that any deck builder with the inclination to write such hints will want them to be followed, especially for more complicated combos where the individual pieces will be useless to the AI. Using toggledifficulty to allow the AI to "forget" the combo would be better if you think that 100%-followed combos are too powerful.
Code: Select all
#HINT:combo hold(dark ritual|myhand)^until(phyrexian obliterator|myhand)^cast(dark ritual|myhand)^cast(phyrexian obliterator|myhand)^totalmananeeded({1}{B})
phyrexian obliterator * 4
bloodline keeper * 4
dark ritual * 4
Swamp * 6
Re: Ai deck builders
Please do a svn update and ensure you are on current. i fixed that last night. ai should never cast a combo card unless it's doing a combo.
edit:
i found the issue, sorry! ok, its now currently corrected, the system is 100% operational! i also went ahead and added dontblockwith( as requested.
remember you can denote as many combo lines as you want. they can use cards located in previous combo lines also, the ai will look for the combo it can actually do, if done correctly you can make a deck play pretty amazingly. as it would seem with just about 5 or so combos using a couple cards shared in the combos makes ai look like it has some freaking clue what the card does lol!
i hope you enjoy it!!!
edit:
i found the issue, sorry! ok, its now currently corrected, the system is 100% operational! i also went ahead and added dontblockwith( as requested.
remember you can denote as many combo lines as you want. they can use cards located in previous combo lines also, the ai will look for the combo it can actually do, if done correctly you can make a deck play pretty amazingly. as it would seem with just about 5 or so combos using a couple cards shared in the combos makes ai look like it has some freaking clue what the card does lol!
i hope you enjoy it!!!

Re: Ai deck builders
Two new questions:
1) Is there a way to control the {x} cost for combos? If it is lucky, the AI will have exactly the amount of mana available after meeting the restriction, but I prefer to have better control. The main offender is with Immortal Servitude which is the AI cannot figure out how to use other than depleting all mana for {x}.
2) Is the combohint system able to target card abilities (equip, choice options) and ETB effects (Disciple of Bolas sacrifice creature, Restoration Angel bounce)?
Sidenote:
The restriction() clause is only used to ensure that the spells to cast have valid targets right? The until() clause seems to take care of every other situation.
1) Is there a way to control the {x} cost for combos? If it is lucky, the AI will have exactly the amount of mana available after meeting the restriction, but I prefer to have better control. The main offender is with Immortal Servitude which is the AI cannot figure out how to use other than depleting all mana for {x}.
2) Is the combohint system able to target card abilities (equip, choice options) and ETB effects (Disciple of Bolas sacrifice creature, Restoration Angel bounce)?
Sidenote:
The restriction() clause is only used to ensure that the spells to cast have valid targets right? The until() clause seems to take care of every other situation.
Re: Ai deck builders
its restriction{ blah }, the same way as we write them in the cards primitives.
the "until()" clause is a targetchooser where restrictions can handle things such as
#HINT:combo hold(dark ritual|myhand)^until(phyrexian obliterator|myhand)^cast(dark ritual|myhand)^cast(phyrexian obliterator|myhand)^restriction{turn>=3}^totalmananeeded({1}{B})
restriction{mycombatdamage}
or any other restriction in the game
the other 2 questions is no not yet unfortunately. give the base system a go once we work the kinks out ill gladly work on suggestions for it.
the "until()" clause is a targetchooser where restrictions can handle things such as
#HINT:combo hold(dark ritual|myhand)^until(phyrexian obliterator|myhand)^cast(dark ritual|myhand)^cast(phyrexian obliterator|myhand)^restriction{turn>=3}^totalmananeeded({1}{B})
restriction{mycombatdamage}
or any other restriction in the game
the other 2 questions is no not yet unfortunately. give the base system a go once we work the kinks out ill gladly work on suggestions for it.
Re: Ai deck builders
Here are a couple of hints that I have verified to be working as expected:
to prevent the AI from spamming global enchantments
to prevent the AI from immediately dumping its burns before the opponent even gets to summon creatures
Is it possible to have phase-specific hints like restriction{opponentendofturn}? What is the restriction{} syntax for specific cards? I tried restriction{(Blood Moon|inplay)~lessthan~1} but it does not work.
Code: Select all
#HINT:combo hold(Blood Moon|myhand)^cast(Blood Moon|myhand)^restriction{type(enchantment|inplay)~lessthan~1}^totalmananeeded({2}{R})
Code: Select all
#HINT:combo hold(instant|myhand)^cast(instant|myhand)^restriction{turn:2}^totalmananeeded({R})
Is it possible to have phase-specific hints like restriction{opponentendofturn}? What is the restriction{} syntax for specific cards? I tried restriction{(Blood Moon|inplay)~lessthan~1} but it does not work.
Re: Ai deck builders
restriction{(Blood Moon|inplay)~lessthan~1}
thats not how thats coded, look in the primitives for examples on restrictions
restriction{type(Blood Moon|myBattlefield)~lessthan~1}
you can use anything that is possible with restriction= or restriction{ it this runs through the same code to parse
hopefully you can add some real combos to those decks
although you have clever uses for the combo hint, thats not really what i coded it for.
oh and to control the "x" amount of an "x" cost spell. just add up what you want "x" to be and add it to "totalmananeeded({12}{r})" <--fireball for 12
thats not how thats coded, look in the primitives for examples on restrictions
restriction{type(Blood Moon|myBattlefield)~lessthan~1}
you can use anything that is possible with restriction= or restriction{ it this runs through the same code to parse

hopefully you can add some real combos to those decks

oh and to control the "x" amount of an "x" cost spell. just add up what you want "x" to be and add it to "totalmananeeded({12}{r})" <--fireball for 12
Re: Ai deck builders
Is it possible to have multiple ^restriction{} like ^until()? How should I code a restriction{} for the Morbid (@movedtograveyard(creature)) ability?
The {x} in totalmananeeded appear to be more of a minimum value rather than an enforced value for the combo. From my experience setting {2}{B}{B}{B} for Immortal Servitude only means that the AI will cast it with {x >= 2} rather than {x == 2} since by time it meets the other restrictions, it will have more mana available and dump it all into the newly "unlocked" combo.
Lastly, can cast(blah) be used to force flashback (ie. cast(blah|mygraveyard)) since otherwise, the second argument for cast() is redundant as all castable spells must obviously be from myhand.
The {x} in totalmananeeded appear to be more of a minimum value rather than an enforced value for the combo. From my experience setting {2}{B}{B}{B} for Immortal Servitude only means that the AI will cast it with {x >= 2} rather than {x == 2} since by time it meets the other restrictions, it will have more mana available and dump it all into the newly "unlocked" combo.
Lastly, can cast(blah) be used to force flashback (ie. cast(blah|mygraveyard)) since otherwise, the second argument for cast() is redundant as all castable spells must obviously be from myhand.
Re: Ai deck builders
[card]
name=Brimstone Volley
target=creature,player
auto=ifnot morbid then damage:3
auto=if morbid then damage:5
text=Brimstone Volley deals 3 damage to target creature or player. -- Morbid - Brimstone Volley deals 5 damage to that creature or player instead if a creature died this turn.
mana={2}{R}
type=Instant
[/card]
restriction{morbid}^restriction{blah}^restriction{blah} I'm pretty sure this works. either way try the next line.
restriction{blah,blah,balh} with comma seperator...as many as you want to add to it.
The {x} in totalmananeeded appear to be more of a minimum value rather than an enforced value for the combo.
im not so sure about that, the combo runs with the mana you stated was required, it never evaluates the "dump everything into x" rule that we have in the engine. and once a combo starts ai will only want to cast the items in the combo nothing else.
name=Brimstone Volley
target=creature,player
auto=ifnot morbid then damage:3
auto=if morbid then damage:5
text=Brimstone Volley deals 3 damage to target creature or player. -- Morbid - Brimstone Volley deals 5 damage to that creature or player instead if a creature died this turn.
mana={2}{R}
type=Instant
[/card]
restriction{morbid}^restriction{blah}^restriction{blah} I'm pretty sure this works. either way try the next line.
restriction{blah,blah,balh} with comma seperator...as many as you want to add to it.
The {x} in totalmananeeded appear to be more of a minimum value rather than an enforced value for the combo.
im not so sure about that, the combo runs with the mana you stated was required, it never evaluates the "dump everything into x" rule that we have in the engine. and once a combo starts ai will only want to cast the items in the combo nothing else.