Page 5 of 7

Re: Implementing NEW stuff to Magarena

PostPosted: 04 Mar 2014, 10:44
by hong yie
About high priority issue 114,
How about make the Ai less aggressive?
only attack when total power + all positive buff is greater than total opponent's toughness or maybe other pessimistic formula ?
i've seen enough my VIP creatures used to do meaningless kamikaze attacks. these VIP creatures including non aggressive creatures that would increase winning chance when they can be kept alive. Such as creatures with lords abilities, or token factories like Thraben Doomsayer, Imperious Perfect.
what can a 2/2 Thraben Doomsayer, 2/2 Imperious Perfect do good in a combat?
it would be OK, if they're 4/4 or more stronger. The Ai just failed to appreciate the value of these VIP creatures.
Let the Ai feel more fear and act more cautiously, i think. thanx. :)

Re: Implementing NEW stuff to Magarena

PostPosted: 04 Mar 2014, 12:32
by melvin
The blocking item on this is to be able to replicate the bad attack decision in a controlled setting with specific cards. Without that we can't tell if changes are going to make this worse or make it better. In concrete terms, we need to have a setup which we can run to get the bad attack decision. Such a setup, should specify what are the permanents on the board, what are the cards in hand and library, and current life points of both players.

Re: Implementing NEW stuff to Magarena

PostPosted: 04 Mar 2014, 16:11
by ShawnieBoy
melvin wrote:Agree, we have grown beyond creature enchantments. Will rename to getEnchantedPermanent. On a separate note, I was thinking we should consolidate enchanted, equipped, paired to just one attachedPermanent.
Thanks for that :)

Using attachedPermanent does makes sense, however while fiddling with Artificer's Hex, there doesn't seem to be a simple way to find out if an equipment is attached to a permanent. You can go the other way, find out if a permanent is being equipped/enchanted. I was first thinking that .isEquipped() would refer to the equipment, but it doesn't.

If there would be a way to also add .isAttached() and/or .isBeingAttached() Boolean. Or a way for a .getAttachedPermanent() to somehow return that there's nothing there in a way that can be used?

(Or I could be missing something simple which can already do the same thing)

Re: Implementing NEW stuff to Magarena

PostPosted: 05 Mar 2014, 01:56
by melvin
Currently to test if an equipment is attached is getEquippedCreature().isValid(), true if attached, false otherwise.

This is rather ugly, will fix as part of converging to attach instead of the more specific equip, enchant, pair. So in the future that will be isAttached (is this permanent attached to another). The other way round (does this permanent have an equipment, enchantment, etc) remain as isEquipped, isEnchanted, isPaired.

Re: Implementing NEW stuff to Magarena

PostPosted: 05 Mar 2014, 04:12
by hong yie
melvin wrote:The blocking item on this is to be able to replicate the bad attack decision in a controlled setting with specific cards. Without that we can't tell if changes are going to make this worse or make it better. In concrete terms, we need to have a setup which we can run to get the bad attack decision. Such a setup, should specify what are the permanents on the board, what are the cards in hand and library, and current life points of both players.
i have report some bad Ai decision made during play test in firemind.ch
i'm sure that should be helpful.

Re: Implementing NEW stuff to Magarena

PostPosted: 05 Mar 2014, 05:36
by melvin
hong yie wrote:i have report some bad Ai decision made during play test in firemind.ch
i'm sure that should be helpful.
It does, just that we haven't been able to repeatedly replicate any of them.. so right now more reports isn't that useful. What we need is a way to replicate existing reported bad attack decisions.

Re: Implementing NEW stuff to Magarena

PostPosted: 05 Mar 2014, 23:11
by ShawnieBoy
Now that I've got my head around making and testing scenarios, I'll see if I can make one - I have a few theories about what causes the suicide attacks, would be good to put them to the test.

Re: Implementing NEW stuff to Magarena

PostPosted: 06 Mar 2014, 01:43
by hong yie
i'm sure firemind.ch keep the play log when the suicide attack occurred and surely there's a pattern that trigger such decision. it would be good if the log contain local variables & memory addresses that come into consideration to make the decision, like in compiler's debugging report. :)
i'll try to review my decks in firemind.ch and report some more suicide decision.

Re: Implementing NEW stuff to Magarena

PostPosted: 06 Mar 2014, 01:55
by melvin
@ShawnieBoy: That's great! Thanks.

@hong yie: Having more detailed logs is not enough, we need a way to trigger the decision on demand. This way when we make a "fix", we can trigger the decision again and see if the AI makes a better one.

Re: Implementing NEW stuff to Magarena

PostPosted: 06 Mar 2014, 04:29
by Huggybaby
If you had save states it would be possible to send a game in progress right before the questionable move, wouldn't it?

Re: Implementing NEW stuff to Magarena

PostPosted: 06 Mar 2014, 17:21
by ShawnieBoy
Sorry to come in a bit off-topic (But yes - save states would probably give an eye on what's going on, undo after strange play then submit) Just had a thought about card submissions - With the amount of parsing and debugging that Magarena can already do for itself, wouldn't it be possible to have a card submissions page from within Magarena? Could also have the Wiki embedded to teach/aid.

Re: Implementing NEW stuff to Magarena

PostPosted: 07 Mar 2014, 01:12
by hong yie
Huggybaby wrote:If you had save states it would be possible to send a game in progress right before the questionable move, wouldn't it?
i do agree with this. save state can jump the game directly to the test spot. only need to save all cards in play, combat attacking, defending, graveyards, hands, spells in stack, mana pool (not available in Magarena), tap/ untap status, current phase. just dump all memory value used by Magarena into a file to be reloaded. that should be a useful tool in this matter. :)

Re: Implementing NEW stuff to Magarena

PostPosted: 14 Mar 2014, 23:13
by hong yie
here is an example of suicide attack. i have more creatures, greater total toughness than AI's total creature's power and still decide to attack.

Re: Implementing NEW stuff to Magarena

PostPosted: 15 Mar 2014, 00:01
by ShawnieBoy
hong yie wrote:here is an example of suicide attack. i have more creatures, greater total toughness than AI's total creature's power and still decide to attack.
I wouldn't count that as a suicide attack (as in the ones we're looking out for), as the AI will be dead on your turn anyway. Has no way to defend all those fliers (I'm assuming from the one card in hand), so may as well attack all-out as they can't block the lethal damage.

Re: Implementing NEW stuff to Magarena

PostPosted: 15 Mar 2014, 02:35
by hong yie
I wouldn't count that as a suicide attack (as in the ones we're looking out for), as the AI will be dead on your turn anyway. Has no way to defend all those fliers (I'm assuming from the one card in hand), so may as well attack all-out as they can't block the lethal damage.
i think you're right. i forgot those tokens are flyers. i ever use this move to force the flyers to block my attacker too. :)